From b0ba9e3e85a259a9de6cc6687cf09c9e1b494705 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 20:03:00 +0800 Subject: [PATCH] [TextInput1]Add UICompare testcase 1223 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宝迪 --- .../ActionEventWillClickReplacement.test.ets | 61 + .../entry/src/ohosTest/ets/test/List.test.ets | 90 + ...buteBackgroundSeriableReplacement.test.ets | 106 + .../UIComponentTypeUrlInterface001.test.ets | 354 ++ .../UIComponentContainerInterface001.test.ets | 57 + ...ComponentFrameNodeTextReplacement.test.ets | 500 +++ ...UIComponentInputKeyboardAvoidMode.test.ets | 100 + .../UIComponentOnSubmitReplacement.test.ets | 348 ++ ...ponentSetFontSizeScaleReplacement.test.ets | 70 + .../UIComponentSpanInterface001.test.ets | 1555 +++++++ ...nentTextCommonClickReplacement001.test.ets | 1635 ++++++++ ...mponentTextCommonEmojiReplacement.test.ets | 234 ++ ...onentTextCopyAttributeReplacement.test.ets | 779 ++++ ...mponentTextHalfleadingReplacement.test.ets | 80 + ...nentTextInputPasswordInterface001.test.ets | 1050 +++++ ...tTextInputPhoneNumberInterface001.test.ets | 236 ++ ...nentTextInputPopupBoxInterface001.test.ets | 1943 +++++++++ .../UIComponentTextInterface001.test.ets | 1146 ++++++ ...omponentTextSafePasteInterface001.test.ets | 175 + ...UIComponentTextSelectionInterface.test.ets | 553 +++ ...mponentTextSelectionMenuJingXiang.test.ets | 672 ++++ ...omponentTextSelectionOptimization.test.ets | 507 +++ .../UIComponentTextTextAbility.test.ets | 130 + .../UIComponentTextTextAction.test.ets | 167 + .../UIComponentTextTextCustomMenu.test.ets | 598 +++ .../UIComponentTextTextInputCursor.test.ets | 3556 +++++++++++++++++ ...entTextTextInputKeepEditableState.test.ets | 477 +++ ...onentTextTextStringParagraphStyle.test.ets | 95 + .../UIComponentTextTransparency.test.ets | 676 ++++ ...mponentUISupportColorInterface001.test.ets | 375 ++ ...ICustomTextShortCutKeyReplacement.test.ets | 438 ++ .../UISearchInterface001.test.ets | 231 ++ .../UITextAreaInterface001.test.ets | 228 ++ ...UITextBoxDisablePasteInterface001.test.ets | 796 ++++ .../UITextInputInterface001.test.ets | 2609 ++++++++++++ .../src/ohosTest/ets/test/model/Settings.ets | 8 +- .../src/ohosTest/ets/test/model/Utils.ets | 79 +- .../ohosTest/ets/testability/TestAbility.ets | 32 +- .../ActionEventWillClickReplacement0170.ets | 219 + ...ibuteBackgroundSeriableReplacement0040.ets | 67 + .../UIAttributeFontInterface001.ets | 35 + .../UIComponentContainerSpanInterface001.ets | 35 + .../UIComponentContainerSpanInterface002.ets | 34 + ...IComponentFrameNodeTextReplacement0010.ets | 257 ++ ...IComponentFrameNodeTextReplacement0100.ets | 396 ++ .../UIComponentInputKeyboardAvoidMode0160.ets | 54 + .../UIComponentOnSubmitReplacement0020.ets | 193 + .../UIComponentOnSubmitReplacement0090.ets | 91 + ...mponentSetFontSizeScaleReplacement0010.ets | 41 + ...mponentSetFontSizeScaleReplacement0150.ets | 39 + ...mponentSetFontSizeScaleReplacement0160.ets | 39 + .../UIComponentSpanInterface001.ets | 51 + .../UIComponentSpanInterface002.ets | 30 + .../UIComponentSpanInterface003.ets | 44 + .../UIComponentSpanInterface004.ets | 55 + .../UIComponentSymbolGlyphInterface0010.ets | 37 + .../UIComponentSymbolGlyphInterface0011.ets | 49 + .../UIComponentSymbolGlyphInterface0012.ets | 37 + .../UIComponentSymbolGlyphInterface0013.ets | 49 + .../UIComponentSymbolGlyphInterface0014.ets | 37 + .../UIComponentSymbolGlyphInterface0015.ets | 49 + .../UIComponentSymbolGlyphInterface0016.ets | 37 + .../UIComponentSymbolGlyphInterface0017.ets | 73 + .../UIComponentSymbolGlyphInterface0018.ets | 38 + .../UIComponentSymbolGlyphInterface0019.ets | 52 + .../UIComponentSymbolGlyphInterface0020.ets | 37 + .../UIComponentSymbolGlyphInterface0021.ets | 42 + .../UIComponentSymbolGlyphInterface0022.ets | 42 + .../UIComponentSymbolGlyphInterface0023.ets | 74 + .../UIComponentSymbolGlyphInterface0024.ets | 36 + .../UIComponentSymbolGlyphInterface0025.ets | 36 + .../UIComponentSymbolGlyphInterface0026.ets | 48 + .../UIComponentSymbolGlyphInterface0027.ets | 36 + .../UIComponentSymbolGlyphInterface0028.ets | 48 + .../UIComponentSymbolGlyphInterface0029.ets | 36 + .../UIComponentSymbolGlyphInterface0030.ets | 48 + .../UIComponentSymbolGlyphInterface0031.ets | 74 + .../UIComponentSymbolGlyphInterface0032.ets | 36 + .../UIComponentSymbolGlyphInterface0033.ets | 38 + .../UIComponentSymbolGlyphInterface0034.ets | 51 + .../UIComponentSymbolGlyphInterface0035.ets | 36 + .../UIComponentSymbolGlyphInterface0036.ets | 180 + .../UIComponentSymbolGlyphInterface0037.ets | 245 ++ .../UIComponentSymbolGlyphInterface0038.ets | 185 + .../UIComponentSymbolGlyphInterface0039.ets | 155 + .../UIComponentSymbolGlyphInterface0040.ets | 39 + .../UIComponentSymbolGlyphInterface0041.ets | 54 + .../UIComponentSymbolGlyphInterface0042.ets | 74 + .../UIComponentSymbolGlyphInterface007.ets | 38 + .../UIComponentSymbolGlyphInterface008.ets | 71 + .../UIComponentSymbolGlyphInterface009.ets | 36 + .../UIComponentSymbolSpanInterface003.ets | 67 + .../UIComponentSymbolSpanInterface004.ets | 90 + .../UIComponentSymbolSpanInterface005.ets | 55 + .../UIComponentSymbolSpanInterface006.ets | 63 + .../UIComponentSymbolSpanInterface007.ets | 76 + .../UIComponentTextCommonClickReplacement.ets | 119 + ...omponentTextCommonClickReplacement0010.ets | 45 + ...omponentTextCommonClickReplacement0020.ets | 27 + ...omponentTextCommonClickReplacement0080.ets | 26 + ...omponentTextCommonClickReplacement0090.ets | 31 + ...omponentTextCommonClickReplacement0100.ets | 30 + ...omponentTextCommonClickReplacement0110.ets | 30 + ...omponentTextCommonClickReplacement0130.ets | 50 + ...omponentTextCommonClickReplacement0140.ets | 34 + .../UIComponentTextCommonEmojiReplacement.ets | 34 + ...ponentTextCopyAttributeReplacement0010.ets | 229 ++ ...ponentTextCopyAttributeReplacement0020.ets | 221 + ...ponentTextCopyAttributeReplacement0030.ets | 215 + ...ponentTextCopyAttributeReplacement0040.ets | 213 + ...ponentTextCopyAttributeReplacement0050.ets | 211 + ...ponentTextCopyAttributeReplacement0390.ets | 261 ++ ...ponentTextCopyAttributeReplacement0400.ets | 263 ++ ...ponentTextCopyAttributeReplacement0410.ets | 252 ++ ...ponentTextCopyAttributeReplacement0420.ets | 252 ++ ...ponentTextCopyAttributeReplacement0430.ets | 213 + ...ponentTextCopyAttributeReplacement0440.ets | 209 + ...ponentTextCopyAttributeReplacement0450.ets | 270 ++ ...ponentTextCopyAttributeReplacement0460.ets | 269 ++ ...ponentTextCopyAttributeReplacement0470.ets | 264 ++ ...ponentTextCopyAttributeReplacement0480.ets | 267 ++ ...ponentTextCopyAttributeReplacement0490.ets | 265 ++ ...ponentTextCopyAttributeReplacement0500.ets | 279 ++ ...omponentTextHalfleadingReplacement0100.ets | 44 + ...ComponentTextInputPasswordInterface001.ets | 46 + ...ComponentTextInputPasswordInterface002.ets | 44 + ...ComponentTextInputPasswordInterface003.ets | 44 + ...ComponentTextInputPasswordInterface004.ets | 44 + ...omponentTextInputPasswordInterface0070.ets | 44 + ...omponentTextInputPasswordInterface0080.ets | 44 + ...omponentTextInputPasswordInterface0090.ets | 44 + ...omponentTextInputPasswordInterface0100.ets | 44 + ...omponentTextInputPasswordInterface0200.ets | 37 + ...omponentTextInputPasswordInterface0220.ets | 52 + ...ponentTextInputPhoneNumberInterface001.ets | 164 + ...ponentTextInputPhoneNumberInterface002.ets | 35 + ...ponentTextInputPhoneNumberInterface003.ets | 36 + ...ComponentTextInputPopupBoxInterface001.ets | 29 + ...omponentTextInputPopupBoxInterface0010.ets | 30 + ...omponentTextInputPopupBoxInterface0011.ets | 30 + ...omponentTextInputPopupBoxInterface0012.ets | 30 + ...omponentTextInputPopupBoxInterface0013.ets | 30 + ...omponentTextInputPopupBoxInterface0014.ets | 52 + ...omponentTextInputPopupBoxInterface0015.ets | 30 + ...omponentTextInputPopupBoxInterface0016.ets | 44 + ...omponentTextInputPopupBoxInterface0017.ets | 52 + ...omponentTextInputPopupBoxInterface0018.ets | 51 + ...omponentTextInputPopupBoxInterface0019.ets | 44 + ...ComponentTextInputPopupBoxInterface002.ets | 36 + ...omponentTextInputPopupBoxInterface0020.ets | 52 + ...omponentTextInputPopupBoxInterface0021.ets | 59 + ...omponentTextInputPopupBoxInterface0022.ets | 70 + ...omponentTextInputPopupBoxInterface0023.ets | 52 + ...omponentTextInputPopupBoxInterface0024.ets | 29 + ...omponentTextInputPopupBoxInterface0026.ets | 31 + ...omponentTextInputPopupBoxInterface0027.ets | 57 + ...omponentTextInputPopupBoxInterface0028.ets | 49 + ...omponentTextInputPopupBoxInterface0029.ets | 33 + ...ComponentTextInputPopupBoxInterface003.ets | 28 + ...omponentTextInputPopupBoxInterface0030.ets | 36 + ...omponentTextInputPopupBoxInterface0031.ets | 70 + ...omponentTextInputPopupBoxInterface0032.ets | 50 + ...omponentTextInputPopupBoxInterface0033.ets | 50 + ...omponentTextInputPopupBoxInterface0034.ets | 33 + ...omponentTextInputPopupBoxInterface0035.ets | 32 + ...omponentTextInputPopupBoxInterface0036.ets | 64 + ...omponentTextInputPopupBoxInterface0037.ets | 34 + ...omponentTextInputPopupBoxInterface0038.ets | 33 + ...omponentTextInputPopupBoxInterface0039.ets | 32 + ...ComponentTextInputPopupBoxInterface004.ets | 36 + ...omponentTextInputPopupBoxInterface0040.ets | 55 + ...omponentTextInputPopupBoxInterface0041.ets | 65 + ...omponentTextInputPopupBoxInterface0042.ets | 33 + ...omponentTextInputPopupBoxInterface0043.ets | 32 + ...ComponentTextInputPopupBoxInterface005.ets | 44 + ...ComponentTextInputPopupBoxInterface006.ets | 44 + ...ComponentTextInputPopupBoxInterface007.ets | 30 + ...ComponentTextInputPopupBoxInterface008.ets | 36 + ...ComponentTextInputPopupBoxInterface009.ets | 36 + ...omponentTextInputPopupBoxInterface0500.ets | 94 + .../UIComponentTextInterface001.ets | 59 + .../UIComponentTextInterface0012.ets | 58 + .../UIComponentTextInterface0013.ets | 54 + .../UIComponentTextInterface0014.ets | 53 + .../UIComponentTextInterface0015.ets | 60 + .../UIComponentTextInterface0016.ets | 60 + .../UIComponentTextInterface002.ets | 57 + .../UIComponentTextInterface003.ets | 57 + .../UIComponentTextInterface004.ets | 57 + .../UIComponentTextInterface005.ets | 57 + .../UIComponentTextInterface006.ets | 62 + .../UIComponentTextInterface007.ets | 58 + .../UIComponentTextInterface008.ets | 65 + .../UIComponentTextInterface009.ets | 116 + .../UIComponentTextSafePasteInterface001.ets | 39 + .../UIComponentTextSafePasteInterface002.ets | 39 + .../UIComponentTextSafePasteInterface003.ets | 50 + .../UIComponentTextSafePasteInterface004.ets | 34 + .../UIComponentTextSelectionInterface0080.ets | 64 + .../UIComponentTextSelectionInterface0110.ets | 71 + .../UIComponentTextSelectionInterface0120.ets | 47 + .../UIComponentTextSelectionInterface0130.ets | 46 + .../UIComponentTextSelectionInterface0170.ets | 36 + .../UIComponentTextSelectionInterface0300.ets | 61 + .../UIComponentTextSelectionInterface0310.ets | 61 + .../UIComponentTextSelectionInterface0340.ets | 60 + .../UIComponentTextSelectionInterface0360.ets | 35 + .../UIComponentTextSelectionInterface0370.ets | 35 + .../UIComponentTextSelectionInterface0380.ets | 35 + .../UIComponentTextSelectionInterface0390.ets | 36 + .../UIComponentTextSelectionInterface0400.ets | 35 + .../UIComponentTextSelectionInterface0410.ets | 36 + ...UIComponentTextSelectionInterface_menu.ets | 88 + ...omponentTextSelectionMenuJingXiang0010.ets | 74 + ...omponentTextSelectionMenuJingXiang0020.ets | 67 + ...omponentTextSelectionMenuJingXiang0030.ets | 74 + ...omponentTextSelectionMenuJingXiang0040.ets | 67 + ...omponentTextSelectionMenuJingXiang0050.ets | 68 + ...omponentTextSelectionMenuJingXiang0060.ets | 68 + ...omponentTextSelectionMenuJingXiang0070.ets | 74 + ...omponentTextSelectionMenuJingXiang0080.ets | 66 + ...omponentTextSelectionMenuJingXiang0090.ets | 70 + ...omponentTextSelectionMenuJingXiang0100.ets | 83 + ...omponentTextSelectionMenuJingXiang0110.ets | 83 + ...omponentTextSelectionMenuJingXiang0120.ets | 86 + ...omponentTextSelectionMenuJingXiang0130.ets | 91 + ...ponentTextSelectionMenuJingXiang0140_1.ets | 45 + ...ponentTextSelectionMenuJingXiang0140_2.ets | 59 + ...ponentTextSelectionMenuJingXiang0140_3.ets | 43 + ...ponentTextSelectionMenuJingXiang0140_4.ets | 70 + ...ponentTextSelectionMenuJingXiang0140_5.ets | 82 + ...omponentTextSelectionMenuJingXiang0160.ets | 94 + ...mponentTextSelectionOptimization0010_1.ets | 59 + ...mponentTextSelectionOptimization0010_2.ets | 69 + ...mponentTextSelectionOptimization0010_3.ets | 67 + ...mponentTextSelectionOptimization0030_1.ets | 123 + ...mponentTextSelectionOptimization0030_2.ets | 117 + ...mponentTextSelectionOptimization0030_3.ets | 112 + ...mponentTextSelectionOptimization0040_1.ets | 65 + ...mponentTextSelectionOptimization0040_2.ets | 68 + ...mponentTextSelectionOptimization0040_3.ets | 66 + ...mponentTextSelectionOptimization0050_1.ets | 95 + ...mponentTextSelectionOptimization0050_2.ets | 90 + ...mponentTextSelectionOptimization0060_1.ets | 104 + ...mponentTextSelectionOptimization0060_2.ets | 126 + ...mponentTextSelectionOptimization0060_3.ets | 102 + ...mponentTextSelectionOptimization0070_1.ets | 83 + ...mponentTextSelectionOptimization0070_2.ets | 86 + ...mponentTextSelectionOptimization0070_3.ets | 81 + ...mponentTextSelectionOptimization0080_1.ets | 83 + ...mponentTextSelectionOptimization0080_2.ets | 86 + ...mponentTextSelectionOptimization0080_3.ets | 81 + ...mponentTextSelectionOptimization0090_1.ets | 83 + ...mponentTextSelectionOptimization0090_2.ets | 85 + ...mponentTextSelectionOptimization0090_3.ets | 81 + ...mponentTextSelectionOptimization0100_1.ets | 105 + ...mponentTextSelectionOptimization0100_3.ets | 102 + ...mponentTextSelectionOptimization0110_1.ets | 83 + ...mponentTextSelectionOptimization0110_2.ets | 85 + ...mponentTextSelectionOptimization0110_3.ets | 81 + ...mponentTextSelectionOptimization0120_1.ets | 83 + ...mponentTextSelectionOptimization0120_2.ets | 85 + ...mponentTextSelectionOptimization0120_3.ets | 81 + ...mponentTextSelectionOptimization0130_1.ets | 95 + ...mponentTextSelectionOptimization0130_2.ets | 91 + ...mponentTextSelectionOptimization0130_3.ets | 88 + ...ComponentTextSelectionOptimization0140.ets | 127 + .../UIComponentTextTextAbility0130.ets | 54 + .../UIComponentTextTextAbility0150.ets | 61 + .../UIComponentTextTextAbility0570.ets | 61 + .../UIComponentTextTextAction0020.ets | 47 + .../UIComponentTextTextAction0040.ets | 40 + .../UIComponentTextTextAction0050.ets | 78 + .../UIComponentTextTextAction0060.ets | 70 + .../UIComponentTextTextAction0080.ets | 41 + .../UIComponentTextTextAction0100.ets | 49 + .../UIComponentTextTextAction0110.ets | 48 + .../UIComponentTextTextAction0180.ets | 61 + .../UIComponentTextTextCustomMenu0010.ets | 53 + .../UIComponentTextTextCustomMenu0020.ets | 53 + .../UIComponentTextTextCustomMenu0030.ets | 52 + .../UIComponentTextTextCustomMenu0040.ets | 55 + .../UIComponentTextTextCustomMenu0050.ets | 56 + .../UIComponentTextTextCustomMenu0060.ets | 55 + .../UIComponentTextTextCustomMenu0070.ets | 53 + .../UIComponentTextTextCustomMenu0080.ets | 51 + .../UIComponentTextTextCustomMenu0090.ets | 67 + .../UIComponentTextTextCustomMenu0100.ets | 65 + .../UIComponentTextTextCustomMenu0110.ets | 91 + .../UIComponentTextTextCustomMenu0120.ets | 39 + .../UIComponentTextTextCustomMenu0130.ets | 71 + .../UIComponentTextTextCustomMenu0140.ets | 62 + .../UIComponentTextTextCustomMenu0150.ets | 62 + .../UIComponentTextTextCustomMenu0160.ets | 72 + .../UIComponentTextTextCustomMenu0170.ets | 73 + .../UIComponentTextTextCustomMenu0180.ets | 72 + .../UIComponentTextTextCustomMenu0190.ets | 72 + .../UIComponentTextTextCustomMenu0200.ets | 72 + .../UIComponentTextTextCustomMenu0210.ets | 68 + .../UIComponentTextTextCustomMenu0220.ets | 109 + .../UIComponentTextTextCustomMenu0230.ets | 71 + .../UIComponentTextTextInputCursor0010.ets | 47 + .../UIComponentTextTextInputCursor0030.ets | 54 + .../UIComponentTextTextInputCursor0040.ets | 48 + .../UIComponentTextTextInputCursor0060.ets | 48 + .../UIComponentTextTextInputCursor0080.ets | 51 + .../UIComponentTextTextInputCursor0090.ets | 54 + .../UIComponentTextTextInputCursor0110.ets | 54 + .../UIComponentTextTextInputCursor0130.ets | 54 + .../UIComponentTextTextInputCursor0150.ets | 54 + .../UIComponentTextTextInputCursor0180.ets | 54 + .../UIComponentTextTextInputCursor0190.ets | 54 + .../UIComponentTextTextInputCursor0210.ets | 54 + .../UIComponentTextTextInputCursor0230.ets | 54 + .../UIComponentTextTextInputCursor0250.ets | 53 + .../UIComponentTextTextInputCursor0260.ets | 53 + .../UIComponentTextTextInputCursor0270.ets | 53 + .../UIComponentTextTextInputCursor0280.ets | 53 + .../UIComponentTextTextInputCursor0290.ets | 53 + .../UIComponentTextTextInputCursor0300.ets | 54 + .../UIComponentTextTextInputCursor0320.ets | 54 + .../UIComponentTextTextInputCursor0340.ets | 54 + .../UIComponentTextTextInputCursor0360.ets | 54 + .../UIComponentTextTextInputCursor0380.ets | 57 + .../UIComponentTextTextInputCursor0450.ets | 65 + .../UIComponentTextTextInputCursor0460.ets | 58 + .../UIComponentTextTextInputCursor0470.ets | 58 + .../UIComponentTextTextInputCursor0480.ets | 58 + .../UIComponentTextTextInputCursor0490.ets | 58 + .../UIComponentTextTextInputCursor0510.ets | 58 + .../UIComponentTextTextInputCursor0520.ets | 58 + .../UIComponentTextTextInputCursor0570.ets | 46 + .../UIComponentTextTextInputCursor0590.ets | 47 + .../UIComponentTextTextInputCursor0610.ets | 47 + .../UIComponentTextTextInputCursor0630.ets | 55 + .../UIComponentTextTextInputCursor0640.ets | 54 + .../UIComponentTextTextInputCursor0650.ets | 54 + .../UIComponentTextTextInputCursor0670.ets | 54 + .../UIComponentTextTextInputCursor0690.ets | 54 + .../UIComponentTextTextInputCursor0710.ets | 54 + .../UIComponentTextTextInputCursor0730.ets | 54 + .../UIComponentTextTextInputCursor0750.ets | 60 + .../UIComponentTextTextInputCursor0770.ets | 55 + .../UIComponentTextTextInputCursor0790.ets | 54 + .../UIComponentTextTextInputCursor0810.ets | 59 + .../UIComponentTextTextInputCursor0820.ets | 54 + .../UIComponentTextTextInputCursor0830.ets | 54 + .../UIComponentTextTextInputCursor0840.ets | 54 + .../UIComponentTextTextInputCursor0850.ets | 54 + .../UIComponentTextTextInputCursor0860.ets | 58 + .../UIComponentTextTextInputCursor0880.ets | 58 + .../UIComponentTextTextInputCursor0900.ets | 58 + .../UIComponentTextTextInputCursor0920.ets | 58 + .../UIComponentTextTextInputCursor0940.ets | 56 + .../UIComponentTextTextInputCursor0990.ets | 55 + .../UIComponentTextTextInputCursor1010.ets | 65 + .../UIComponentTextTextInputCursor1020.ets | 65 + .../UIComponentTextTextInputCursor1030.ets | 67 + .../UIComponentTextTextInputCursor1040.ets | 67 + .../UIComponentTextTextInputCursor1050.ets | 67 + .../UIComponentTextTextInputCursor1060.ets | 67 + .../UIComponentTextTextInputCursor1070.ets | 67 + .../UIComponentTextTextInputCursor1080.ets | 59 + .../UIComponentTextTextInputCursor1130.ets | 57 + .../UIComponentTextTextInputCursor1150.ets | 58 + .../UIComponentTextTextInputCursor1170.ets | 58 + .../UIComponentTextTextInputCursor1190.ets | 66 + .../UIComponentTextTextInputCursor1200.ets | 58 + .../UIComponentTextTextInputCursor1210.ets | 54 + .../UIComponentTextTextInputCursor1220.ets | 58 + .../UIComponentTextTextInputCursor1250.ets | 54 + .../UIComponentTextTextInputCursor1260.ets | 58 + .../UIComponentTextTextInputCursor1290.ets | 58 + .../UIComponentTextTextInputCursor1310.ets | 54 + .../UIComponentTextTextInputCursor1330.ets | 54 + .../UIComponentTextTextInputCursor1340.ets | 58 + .../UIComponentTextTextInputCursor1370.ets | 53 + .../UIComponentTextTextInputCursor1380.ets | 58 + .../UIComponentTextTextInputCursor1390.ets | 58 + .../UIComponentTextTextInputCursor1400.ets | 58 + .../UIComponentTextTextInputCursor1410.ets | 58 + .../UIComponentTextTextInputCursor1420.ets | 58 + .../UIComponentTextTextInputCursor1440.ets | 58 + .../UIComponentTextTextInputCursor1460.ets | 58 + .../UIComponentTextTextInputCursor1480.ets | 58 + .../UIComponentTextTextInputCursor1500.ets | 57 + .../UIComponentTextTextInputCursor1550.ets | 57 + .../UIComponentTextTextInputCursor1570.ets | 64 + .../UIComponentTextTextInputCursor1580.ets | 64 + .../UIComponentTextTextInputCursor1590.ets | 58 + .../UIComponentTextTextInputCursor1600.ets | 58 + .../UIComponentTextTextInputCursor1610.ets | 58 + .../UIComponentTextTextInputCursor1620.ets | 58 + .../UIComponentTextTextInputCursor1630.ets | 58 + .../UIComponentTextTextInputCursor1640.ets | 57 + .../UIComponentTextTextInputCursor1690.ets | 151 + .../UIComponentTextTextInputCursor1720.ets | 126 + .../UIComponentTextTextInputCursor1750.ets | 43 + ...nentTextTextInputKeepEditableState0010.ets | 61 + ...nentTextTextInputKeepEditableState0020.ets | 61 + ...nentTextTextInputKeepEditableState0030.ets | 62 + ...nentTextTextInputKeepEditableState0040.ets | 58 + ...nentTextTextInputKeepEditableState0060.ets | 93 + ...nentTextTextInputKeepEditableState0070.ets | 94 + ...nentTextTextInputKeepEditableState0100.ets | 62 + ...nentTextTextInputKeepEditableState0120.ets | 93 + ...nentTextTextInputKeepEditableState0130.ets | 91 + ...nentTextTextInputKeepEditableState0140.ets | 59 + ...nentTextTextInputKeepEditableState0150.ets | 93 + ...nentTextTextInputKeepEditableState0180.ets | 85 + ...ponentTextTextStringParagraphStyle0010.ets | 61 + ...ponentTextTextStringParagraphStyle0020.ets | 119 + .../UIComponentTextTransparency0010.ets | 48 + .../UIComponentTextTransparency0020.ets | 47 + .../UIComponentTextTransparency0110.ets | 56 + .../UIComponentTextTransparency0120.ets | 62 + .../UIComponentTextTransparency0130.ets | 56 + .../UIComponentTextTransparency0140.ets | 71 + .../UIComponentTextTransparency0150.ets | 71 + .../UIComponentTextTransparency0160.ets | 56 + .../UIComponentTextTransparency0170.ets | 56 + .../UIComponentTextTransparency0180.ets | 61 + .../UIComponentTextTransparency0190.ets | 61 + .../UIComponentTextTransparency0200.ets | 61 + .../UIComponentTextTransparency0210.ets | 58 + .../UIComponentTextTransparency0220.ets | 56 + .../UIComponentTextTransparency0230.ets | 56 + .../UIComponentTextTransparency0240.ets | 60 + .../UIComponentTextTransparency0250.ets | 60 + .../UIComponentTextTransparency0260.ets | 60 + .../UIComponentTextTransparency0270.ets | 56 + .../UIComponentTextTransparency0311.ets | 63 + .../UIComponentTextTransparency0312.ets | 64 + .../UIComponentTypeUrlInterface001.ets | 42 + .../UIComponentTypeUrlInterface0010.ets | 28 + .../UIComponentTypeUrlInterface0011.ets | 35 + .../UIComponentTypeUrlInterface0012.ets | 58 + .../UIComponentTypeUrlInterface0013.ets | 32 + .../UIComponentTypeUrlInterface002.ets | 34 + .../UIComponentTypeUrlInterface003.ets | 46 + .../UIComponentTypeUrlInterface004.ets | 35 + .../UIComponentTypeUrlInterface005.ets | 34 + .../UIComponentTypeUrlInterface006.ets | 34 + .../UIComponentTypeUrlInterface007.ets | 37 + .../UIComponentTypeUrlInterface008.ets | 37 + .../UIComponentTypeUrlInterface009.ets | 82 + .../UIComponentUISupportColorInterface001.ets | 50 + .../UIComponentUISupportColorInterface002.ets | 49 + .../UIComponentUISupportColorInterface003.ets | 49 + .../UIComponentUISupportColorInterface004.ets | 49 + .../UIComponentUISupportColorInterface005.ets | 63 + .../UIComponentUISupportColorInterface006.ets | 63 + ...UICustomTextShortCutKeyReplacement0010.ets | 46 + ...UICustomTextShortCutKeyReplacement0020.ets | 46 + ...UICustomTextShortCutKeyReplacement0030.ets | 46 + ...UICustomTextShortCutKeyReplacement0040.ets | 46 + ...UICustomTextShortCutKeyReplacement0050.ets | 46 + ...UICustomTextShortCutKeyReplacement0060.ets | 48 + ...UICustomTextShortCutKeyReplacement0070.ets | 57 + ...UICustomTextShortCutKeyReplacement0080.ets | 49 + ...UICustomTextShortCutKeyReplacement0090.ets | 70 + ...UICustomTextShortCutKeyReplacement0140.ets | 49 + .../UISearchInterface001.ets | 44 + .../UISearchInterface002.ets | 44 + .../UISearchInterface003.ets | 44 + .../UISearchInterface004.ets | 49 + .../UISearchInterface005.ets | 36 + .../UISearchInterface006.ets | 36 + .../UITextAreaInterface001.ets | 44 + .../UITextAreaInterface002.ets | 44 + .../UITextAreaInterface003.ets | 44 + .../UITextAreaInterface004.ets | 51 + .../UITextAreaInterface005.ets | 36 + .../UITextBoxDisablePasteInterface001.ets | 49 + .../UITextBoxDisablePasteInterface002.ets | 49 + .../UITextBoxDisablePasteInterface003.ets | 47 + .../UITextBoxDisablePasteInterface004.ets | 51 + .../UITextBoxDisablePasteInterface005.ets | 48 + .../UITextBoxDisablePasteInterface006.ets | 48 + .../UITextBoxDisablePasteInterface007.ets | 51 + .../UITextInputInterface001.ets | 50 + .../UITextInputInterface0010.ets | 44 + .../UITextInputInterface0011.ets | 44 + .../UITextInputInterface0012.ets | 38 + .../UITextInputInterface0013.ets | 34 + .../UITextInputInterface0014.ets | 35 + .../UITextInputInterface0015.ets | 40 + .../UITextInputInterface0016.ets | 40 + .../UITextInputInterface0017.ets | 41 + .../UITextInputInterface0018.ets | 30 + .../UITextInputInterface0019.ets | 30 + .../UITextInputInterface002.ets | 67 + .../UITextInputInterface0020.ets | 34 + .../UITextInputInterface0021.ets | 33 + .../UITextInputInterface0022.ets | 30 + .../UITextInputInterface0023.ets | 34 + .../UITextInputInterface0024.ets | 34 + .../UITextInputInterface0025.ets | 31 + .../UITextInputInterface0026.ets | 34 + .../UITextInputInterface0027.ets | 34 + .../UITextInputInterface0028.ets | 34 + .../UITextInputInterface0029.ets | 35 + .../UITextInputInterface003.ets | 97 + .../UITextInputInterface0030.ets | 32 + .../UITextInputInterface0031.ets | 33 + .../UITextInputInterface0032.ets | 33 + .../UITextInputInterface0033.ets | 33 + .../UITextInputInterface0034.ets | 30 + .../UITextInputInterface0035.ets | 30 + .../UITextInputInterface0036.ets | 30 + .../UITextInputInterface0037.ets | 30 + .../UITextInputInterface0038.ets | 30 + .../UITextInputInterface0039.ets | 34 + .../UITextInputInterface004.ets | 66 + .../UITextInputInterface0040.ets | 37 + .../UITextInputInterface0041.ets | 34 + .../UITextInputInterface0042.ets | 38 + .../UITextInputInterface0043.ets | 34 + .../UITextInputInterface0044.ets | 30 + .../UITextInputInterface0045.ets | 34 + .../UITextInputInterface0046.ets | 31 + .../UITextInputInterface0047.ets | 35 + .../UITextInputInterface0048.ets | 30 + .../UITextInputInterface0049.ets | 33 + .../UITextInputInterface005.ets | 50 + .../UITextInputInterface0050.ets | 32 + .../UITextInputInterface0051.ets | 34 + .../UITextInputInterface0052.ets | 29 + .../UITextInputInterface0053.ets | 35 + .../UITextInputInterface0054.ets | 43 + .../UITextInputInterface0055.ets | 43 + .../UITextInputInterface0056.ets | 27 + .../UITextInputInterface0057.ets | 31 + .../UITextInputInterface0058.ets | 42 + .../UITextInputInterface0059.ets | 41 + .../UITextInputInterface006.ets | 44 + .../UITextInputInterface0060.ets | 46 + .../UITextInputInterface0061_pc.ets | 40 + .../UITextInputInterface0065.ets | 39 + .../UITextInputInterface008.ets | 34 + .../UITextInputInterface0100.ets | 58 + .../uicompare/entry/src/ohosTest/module.json5 | 24 + .../resources/base/element/color.json | 4 + .../resources/base/profile/test_pages.json | 518 ++- .../resources/dark/element/color.json | 12 + 545 files changed, 55532 insertions(+), 27 deletions(-) create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventWillClickReplacementTest/ActionEventWillClickReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponenTypeUrlInterfaceTest/UIComponentTypeUrlInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentContainerInterfaceTest/UIComponentContainerInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFrameNodeTextReplacementTest/UIComponentFrameNodeTextReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInputKeyboardAvoidModeReplacementTest/UIComponentInputKeyboardAvoidMode.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOnSubmitReplacementTest/UIComponentOnSubmitReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpanInterfaceTest/UIComponentSpanInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonClickReplacementTest/UIComponentTextCommonClickReplacement001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHalfleadingReplacementTest/UIComponentTextHalfleadingReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPasswordInterfaceTest/UIComponentTextInputPasswordInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPhoneNumberInterfaceTest/UIComponentTextInputPhoneNumberInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPopupBoxInterfaceTest/UIComponentTextInputPopupBoxInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInterfaceTest/UIComponentTextInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSafePasteInterfaceTest/UIComponentTextSafePasteInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionInterfaceTest/UIComponentTextSelectionInterface.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionMenuJingXiangTest/UIComponentTextSelectionMenuJingXiang.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionOptimizationTest/UIComponentTextSelectionOptimization.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAbilityTest/UIComponentTextTextAbility.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextActionTest/UIComponentTextTextAction.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextCustomMenuTest/UIComponentTextTextCustomMenu.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputCursorTest/UIComponentTextTextInputCursor.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputKeepEditableStateTest/UIComponentTextTextInputKeepEditableState.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextStringParagraphStyleTest/UIComponentTextTextStringParagraphStyle.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTransparencyTest/UIComponentTextTransparency.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorInterfaceTest/UIComponentUISupportColorInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UISearchInterfaceTest/UISearchInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextAreaInterfaceTest/UITextAreaInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextBoxDisablePasteInterfaceTest/UITextBoxDisablePasteInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextInputInterfaceTest/UITextInputInterface001.test.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventWillClickReplacement/ActionEventWillClickReplacement0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidModeReplacement/UIComponentInputKeyboardAvoidMode0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0011.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0012.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0013.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0014.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0015.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0016.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0018.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0019.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0021.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0022.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0024.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0025.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0026.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0027.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0028.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0029.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0032.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0033.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0034.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0035.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0036.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0037.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0038.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0039.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0041.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface009.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0390.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0400.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0410.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0420.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0430.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0440.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0450.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0460.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0470.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0480.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0490.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0500.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHalfleadingReplacement/UIComponentTextHalfleadingReplacement0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0220.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0011.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0012.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0013.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0015.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0019.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0024.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0026.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0027.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0028.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0029.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0032.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0033.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0034.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0035.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0037.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0038.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0039.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0042.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0043.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface009.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0012.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0013.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0014.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0015.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0016.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface009.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0300.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0340.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0360.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0370.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0380.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0390.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0400.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0410.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface_menu.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_4.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_5.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_1.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_2.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_3.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0570.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0190.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0220.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0230.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0190.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0230.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0250.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0260.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0270.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0280.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0290.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0300.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0320.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0340.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0360.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0450.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0460.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0470.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0480.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0490.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0510.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0520.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0570.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0590.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0610.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0630.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0640.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0650.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0670.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0690.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0710.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0730.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0750.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0770.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0790.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0810.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0820.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0830.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0840.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0850.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0860.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0880.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0900.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0920.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0990.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1190.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1250.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1290.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1310.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1330.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1370.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1380.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1390.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1400.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1410.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1420.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1440.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1460.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1480.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1550.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1570.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1580.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1590.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1600.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1610.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1620.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1630.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1750.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0110.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0120.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0130.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0150.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0160.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0170.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0180.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0190.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0200.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0210.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0220.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0230.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0240.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0250.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0260.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0311.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0312.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0011.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0012.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0013.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface009.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0070.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0080.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0140.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface007.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface001.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0010.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0011.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0012.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0013.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0014.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0015.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0016.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0017.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0018.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0019.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface002.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0020.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0021.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0022.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0023.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0024.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0025.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0026.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0027.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0028.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0029.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface003.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0030.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0031.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0032.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0033.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0034.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0035.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0036.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0037.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0038.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0039.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface004.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0040.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0041.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0042.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0043.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0044.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0045.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0046.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0047.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0048.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0049.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface005.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0050.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0051.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0052.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0053.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0054.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0055.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0056.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0057.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0058.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0059.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface006.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0060.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0061_pc.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0065.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface008.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0100.ets create mode 100755 function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/dark/element/color.json diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventWillClickReplacementTest/ActionEventWillClickReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventWillClickReplacementTest/ActionEventWillClickReplacement.test.ets new file mode 100755 index 00000000..87919e4c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventWillClickReplacementTest/ActionEventWillClickReplacement.test.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { 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 { Driver, MouseButton, ON } from '@kit.TestKit'; + +export default function ActionEventWillClickReplacement() { + + describe('ActionEventWillClickReplacement', () => { + 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_ACTION_EVENT_WILLCLICK_0170 + * @tc.name SUB_ACE_ACTION_EVENT_WILLCLICK_0170 + * @tc.desc + */ + it('SUB_ACE_ACTION_EVENT_WILLCLICK_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_WILLCLICK_0170 start.`); + Settings.createWindow("testability/pages/ActionEventWillClickReplacement/ActionEventWillClickReplacement0170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let pageOne = await driver.findComponent(ON.text('push pageOne')); + await Utils.sleep(1000); + await pageOne.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_WILLCLICK_0170 finish.`); + done(); + }) + }) +} \ No newline at end of file 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 0860e123..1a2db71c 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,60 @@ import UIComponentPopupBoxToastStyleInterface001 from './UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test'; import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import UIComponentContainerInterface001 + from './UIComponentContainerInterfaceTest/UIComponentContainerInterface001.test'; +import UIComponentSpanInterface001 from './UIComponentSpanInterfaceTest/UIComponentSpanInterface001.test'; +import UIComponentTextInputPasswordInterface001 + from './UIComponentTextInputPasswordInterfaceTest/UIComponentTextInputPasswordInterface001.test'; +import UIComponentTextInputPhoneNumberInterface001 + from './UIComponentTextInputPhoneNumberInterfaceTest/UIComponentTextInputPhoneNumberInterface001.test'; +import UIComponentTextInputPopupBoxInterface001 + from './UIComponentTextInputPopupBoxInterfaceTest/UIComponentTextInputPopupBoxInterface001.test'; +import UIComponentTextInterface001 from './UIComponentTextInterfaceTest/UIComponentTextInterface001.test'; +import UIComponentUISupportColorInterface001 + from './UIComponentUISupportColorInterfaceTest/UIComponentUISupportColorInterface001.test'; +import UIComponentTypeUrlInterface001 from './UIComponenTypeUrlInterfaceTest/UIComponentTypeUrlInterface001.test'; +import UISearchInterface001 from './UISearchInterfaceTest/UISearchInterface001.test'; +import UITextAreaInterface001 from './UITextAreaInterfaceTest/UITextAreaInterface001.test'; +import UITextInputInterface001 from './UITextInputInterfaceTest/UITextInputInterface001.test'; +import UIComponentTextSelectionInterface + from './UIComponentTextSelectionInterfaceTest/UIComponentTextSelectionInterface.test'; +import UIComponentTextSelectionMenuJingXiang + from './UIComponentTextSelectionMenuJingXiangTest/UIComponentTextSelectionMenuJingXiang.test'; +import UIComponentTextTextAbility from './UIComponentTextTextAbilityTest/UIComponentTextTextAbility.test'; +import UIComponentTextTextAction from './UIComponentTextTextActionTest/UIComponentTextTextAction.test' +import UIComponentTextTextCustomMenu from './UIComponentTextTextCustomMenuTest/UIComponentTextTextCustomMenu.test'; +import UIComponentTextTextInputCursor from './UIComponentTextTextInputCursorTest/UIComponentTextTextInputCursor.test'; +import UIComponentTextTextInputKeepEditableState + from './UIComponentTextTextInputKeepEditableStateTest/UIComponentTextTextInputKeepEditableState.test'; +import UIComponentTextTextStringParagraphStyle + from './UIComponentTextTextStringParagraphStyleTest/UIComponentTextTextStringParagraphStyle.test'; +import UIComponentTextTransparency from './UIComponentTextTransparencyTest/UIComponentTextTransparency.test'; +import UITextBoxDisablePasteInterface001 + from './UITextBoxDisablePasteInterfaceTest/UITextBoxDisablePasteInterface001.test'; +import UIComponentTextSelectionOptimization from './UIComponentTextSelectionOptimizationTest/UIComponentTextSelectionOptimization.test'; +import UIComponentTextSafePasteInterface001 + from './UIComponentTextSafePasteInterfaceTest/UIComponentTextSafePasteInterface001.test'; +import UIComponentTextCommonClickReplacement001 + from './UIComponentTextCommonClickReplacementTest/UIComponentTextCommonClickReplacement001.test'; +import UIComponentTextCopyAttributeReplacement + from "./UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement.test"; +import UIComponentSetFontSizeScaleReplacement + from "./UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement.test"; +import UIComponentTextCommonEmojiReplacement + from './UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.test'; +import UICustomTextShortCutKeyReplacement + from './UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement.test'; +import UIComponentOnSubmitReplacement from './UIComponentOnSubmitReplacementTest/UIComponentOnSubmitReplacement.test'; +import UIAttributeBackgroundSeriableReplacement + from './UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement.test'; +import UIComponentInputKeyboardAvoidMode + from './UIComponentInputKeyboardAvoidModeReplacementTest/UIComponentInputKeyboardAvoidMode.test'; +import UIComponentTextHalfleadingReplacement + from './UIComponentTextHalfleadingReplacementTest/UIComponentTextHalfleadingReplacement.test'; +import ActionEventWillClickReplacement from './ActionEventWillClickReplacementTest/ActionEventWillClickReplacement.test'; +import UIComponentFrameNodeTextReplacementTest + from './UIComponentFrameNodeTextReplacementTest/UIComponentFrameNodeTextReplacement.test'; export default function testsuite() { ComponentTextRicheditorFontfeatures(); @@ -239,6 +293,42 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + + UIComponentTextSafePasteInterface001(); + UITextBoxDisablePasteInterface001(); + UIComponentUISupportColorInterface001(); + UIComponentTypeUrlInterface001(); + UIComponentTextInputPhoneNumberInterface001(); + UIComponentTextInputPasswordInterface001(); + UIComponentTextInputPopupBoxInterface001(); + UITextInputInterface001(); + UISearchInterface001(); + UITextAreaInterface001(); + UIComponentSpanInterface001(); + UIComponentContainerInterface001(); + UIComponentTextInterface001(); + UIComponentTextSelectionInterface(); + UIComponentTextSelectionMenuJingXiang(); + UIComponentTextTextAbility(); + UIComponentTextTextAction(); + UIComponentTextTextCustomMenu(); + UIComponentTextTextInputCursor(); + UIComponentTextTextInputKeepEditableState(); + UIComponentTextTextStringParagraphStyle(); + UIComponentTextTransparency(); + UIComponentTextSelectionOptimization(); + UIComponentTextCommonClickReplacement001(); + UIComponentTextCopyAttributeReplacement(); + UIComponentSetFontSizeScaleReplacement(); + + UIComponentTextCommonEmojiReplacement(); + UICustomTextShortCutKeyReplacement(); + UIComponentOnSubmitReplacement(); + UIAttributeBackgroundSeriableReplacement(); + UIComponentInputKeyboardAvoidMode(); + UIComponentFrameNodeTextReplacementTest(); + UIComponentTextHalfleadingReplacement(); + ActionEventWillClickReplacement(); } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement.test.ets new file mode 100755 index 00000000..036f59de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement.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 { Driver, ON, Component, MouseButton } from '@ohos.UiTest'; +import { KeyCode } from '@kit.InputKit' + +export default function UIAttributeBackgroundSeriableReplacement() { + + describe('UIAttributeBackgroundSeriableReplacement', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + let driver: Driver = Driver.create(); + await driver.click(300, 300); + await Utils.sleep(1000); + 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_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_1 + * @tc.name SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_1 + * @tc.desc splice + */ + it('SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_1 start.`); + Settings.createWindow('testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('SeriableReplacement0040_1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_2 + * @tc.name SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_2 + * @tc.desc splice + */ + it('SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_1 start.`); + Settings.createWindow('testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('SeriableReplacement0040_1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_3 + * @tc.name SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_3 + * @tc.desc splice + */ + it('SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_3 start.`); + Settings.createWindow('testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('SeriableReplacement0040_1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BCAKGROUND_SERIABLE_0040_3 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponenTypeUrlInterfaceTest/UIComponentTypeUrlInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponenTypeUrlInterfaceTest/UIComponentTypeUrlInterface001.test.ets new file mode 100755 index 00000000..024c1cb8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponenTypeUrlInterfaceTest/UIComponentTypeUrlInterface001.test.ets @@ -0,0 +1,354 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_TEXT_CONTAINERSPAN_0010:ContainerSpan 文档测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentTypeUrlInterface001() { + + describe('UIComponentTypeUrlInterface001', () => { + 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_TYPE_URL_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0020 + * @tc.desc change inputType + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface001_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface001_button_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await driver.triggerKey(2728) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0030 + * @tc.desc textInput type=url & inline + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface002") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface002_textInput_001')) + await Utils.sleep(500) + await textInput.inputText('这是测试文本,type=url,内联模式不生效,这是测试文本,type=url,内联模式不生效') + // await Utils.sleep(500) + // let selectAll: Component = await driver.findComponent(ON.text('全选')) + // await selectAll.click() + // await Utils.sleep(500) + // let copy: Component = await driver.findComponent(ON.text('复制')) + // await copy.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0040 + * @tc.desc textInput type=url & enterKeyType + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface003") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface003_textInput_001')) + let searchBtn: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface003_button_001')) + let sendBtn: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface003_button_002')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await searchBtn.click() + await Utils.sleep(500) + await sendBtn.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0050 + * @tc.desc textInput type=url & '[0-9]' + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface004") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface004_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("wwww.baidu.com123") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0060 + * @tc.desc textInput type=url & decoration + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface005") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface005_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("wwww.baidu.com123") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0070 + * @tc.desc textInput type=url & showUnderline + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface006") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface006_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("wwww.baidu.com123") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0080 + * @tc.desc textInput type=url & onChange + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface007") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface007_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await driver.triggerKey(2039) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0090 + * @tc.desc textInput type=url & Input method avoids cursor + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface008") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface008_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0100 + * @tc.desc textInput type=url & enablePreviewText + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0013") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface0013_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + let point = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.inputText({ + x: 0, y: point.y + }, "www.") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0110 + * @tc.desc textInput type=url & custom keyboard + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0012") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface0012_textInput_001')) + let textInputTwo: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface0012_textInput_002')) + let textInputThree: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface0012_textInput_003')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + await textInputTwo.click() + await Utils.sleep(1000) + await textInputThree.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0140 + * @tc.desc textInput type=url & dialog + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface009") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface009_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface009_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0150 + * @tc.desc textInput type=url & searchButton + */ + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0010") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface0010_search_001')) + await Utils.sleep(1000) + await textInput.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TYPE_URL_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TYPE_URL_0160 + * @tc.desc textInput type=url & Modifier + */ + + it('SUB_ACE_UI_COMPONENT_TYPE_URL_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0011") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UIComponentTypeUrlInterface0011_search_001')) + await Utils.sleep(1000) + await textInput.inputText("https://***.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TYPE_URL_0160 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentContainerInterfaceTest/UIComponentContainerInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentContainerInterfaceTest/UIComponentContainerInterface001.test.ets new file mode 100755 index 00000000..18a46590 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentContainerInterfaceTest/UIComponentContainerInterface001.test.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_TEXT_CONTAINERSPAN_0010:ContainerSpan 文档测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentContainerInterface001() { + + describe('UIComponentContainerInterface001', () => { + 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(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFrameNodeTextReplacementTest/UIComponentFrameNodeTextReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFrameNodeTextReplacementTest/UIComponentFrameNodeTextReplacement.test.ets new file mode 100755 index 00000000..18abf18d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFrameNodeTextReplacementTest/UIComponentFrameNodeTextReplacement.test.ets @@ -0,0 +1,500 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { Driver, ON, Component, MouseButton } from '@ohos.UiTest'; +import { KeyCode } from '@kit.InputKit' + +export default function UIComponentFrameNodeTextReplacement() { + + describe('UIComponentFrameNodeTextReplacement', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + let driver: Driver = Driver.create(); + await driver.click(300, 300); + await Utils.sleep(1000); + 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_FRAMENODE_TEXT_0100_1 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_1 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_1 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button1')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + await driver.drag(point.left+30,point.top+30,point.left+100,point.top+30); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_2 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_2 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_2 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button2')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + await driver.drag(point.left+30,point.top+30,point.left+100,point.top+30); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_3 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_3 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_3 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button3')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + await driver.drag(point.left+30,point.top+30,point.left+100,point.top+30); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0100_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0160 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0160 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button4')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0170 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0170 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button5')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0170 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0180 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0180 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button6')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_NEXT); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_NEXT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0180 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0210 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0210 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button7')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await driver.longClick(point.left+50,point.top+30); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0210 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0250 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0250 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button8')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0250 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0260 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0260 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button9')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0260 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0270 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0270 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button10')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0270 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0280 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0280 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button11')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0280 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_1 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_1 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_1 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button12_1')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + await driver.drag(point.left+30,point.top+30,point.left+100,point.top+30); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_2 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_2 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_2 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button12_2')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + await driver.drag(point.left+30,point.top+30,point.left+100,point.top+30); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_3 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_3 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_3 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button12_3')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + await driver.drag(point.left+30,point.top+30,point.left+100,point.top+30); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0360_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0480 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0480 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0480 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button13')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await driver.longClick(point.left+50,point.top+30); + await Utils.sleep(1000); + let cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(1000); + await cut.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0480 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0500 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0500 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0500 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button14')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await driver.longClick(point.left+50,point.top+30); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0500 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0550 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0550 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0550 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button15')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await driver.click(point.left+50,point.top+30); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0550 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0560 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0560 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0560 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button16')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await driver.click(point.left+50,point.top+30); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0560 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0570 + * @tc.name SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0570 + * @tc.desc textArea + */ + it('SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0570 start.`); + Settings.createWindow('testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('button17')); + let textArea: Component = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_FRAMENODE_TEXT_0570 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInputKeyboardAvoidModeReplacementTest/UIComponentInputKeyboardAvoidMode.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInputKeyboardAvoidModeReplacementTest/UIComponentInputKeyboardAvoidMode.test.ets new file mode 100755 index 00000000..93dbc1aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInputKeyboardAvoidModeReplacementTest/UIComponentInputKeyboardAvoidMode.test.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 { 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 { Driver, ON, Component, MouseButton } from '@ohos.UiTest'; +import { KeyCode } from '@kit.InputKit' + +export default function UIComponentInputKeyboardAvoidMode() { + + describe('UIComponentInputKeyboardAvoidMode', () => { + 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_INPUT_KEYBOARDAVOIDMODE_0160_1 + * @tc.name SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_1 start.`); + Settings.createWindow('testability/pages/UIComponentInputKeyboardAvoidModeReplacement/UIComponentInputKeyboardAvoidMode0160'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('KeyboardAvoidMode0160_1')); + let textInput: Component = await driver.findComponent(ON.id('KeyboardAvoidMode0160_4')); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1000); + await driver.inputText(point, 'addddddd'); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_FORWARD_DEL); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_2 + * @tc.name SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_2 start.`); + Settings.createWindow('testability/pages/UIComponentInputKeyboardAvoidModeReplacement/UIComponentInputKeyboardAvoidMode0160'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('KeyboardAvoidMode0160_2')); + let textInput: Component = await driver.findComponent(ON.id('KeyboardAvoidMode0160_4')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_A); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_X); + await Utils.sleep(1000); + await textInput.inputText('adddddddddd'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0160_2 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOnSubmitReplacementTest/UIComponentOnSubmitReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOnSubmitReplacementTest/UIComponentOnSubmitReplacement.test.ets new file mode 100755 index 00000000..61782b8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOnSubmitReplacementTest/UIComponentOnSubmitReplacement.test.ets @@ -0,0 +1,348 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { Driver, ON, Component, MouseButton } from '@ohos.UiTest'; +import { KeyCode } from '@kit.InputKit' + +export default function UIComponentOnSubmitReplacement() { + + describe('UIComponentOnSubmitReplacement', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + let driver: Driver = Driver.create(); + await driver.click(300,300); + await Utils.sleep(1000); + 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_ONSUBMIT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0010 + * @tc.desc textArea:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0010 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020')); + let btn: Component = await driver.findComponent(ON.text('case0010')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(500); + for (let index = 0; index < 7; index++) { + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0020 + * @tc.desc textArea:no keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0020 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020')); + let btn: Component = await driver.findComponent(ON.text('case0020')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + for (let index = 0; index < 7; index++) { + await textArea.click(); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(500); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0030 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0030 + * @tc.desc textArea:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0030 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020')); + let btn1: Component = await driver.findComponent(ON.text('case0010')); + let btn2: Component = await driver.findComponent(ON.text('case0030')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0040 + * @tc.desc textArea:INLINE & keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0040 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020')); + let btn: Component = await driver.findComponent(ON.text('case0040')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0050 + * @tc.desc Search:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0050 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020_2')); + let btn: Component = await driver.findComponent(ON.text('case0050')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await search.click(); + for (let index = 0; index < 7; index++) { + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0060 + * @tc.desc Search:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0060 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020_2')); + let btn: Component = await driver.findComponent(ON.text('case0060')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let SEARCH: Component = await driver.findComponent(ON.text('SEARCH')); + let point = await search.getBounds(); + await Utils.sleep(1000); + await search.click(); + await Utils.sleep(1000); + await SEARCH.click(); + await Utils.sleep(1000); + await driver.mouseClick({ + x: point.left + 30, y: point.top + 45 + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await search.click(); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_ENTER); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0070 + * @tc.desc Search:no keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0070 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020_2')); + let btn: Component = await driver.findComponent(ON.text('case0070')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let SEARCH: Component = await driver.findComponent(ON.text('SEARCH')); + let point = await search.getBounds(); + await Utils.sleep(1000); + await driver.mouseClick({ + x: point.left + 30, y: point.top + 45 + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await search.click(); + await Utils.sleep(1000); + await SEARCH.click(); + await Utils.sleep(1000); + for (let index = 0; index < 7; index++) { + await search.click(); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_ENTER); + await Utils.sleep(500); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0080 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0080 + * @tc.desc Search:no keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0080 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020_2')); + let btn: Component = await driver.findComponent(ON.text('case0080')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let SEARCH: Component = await driver.findComponent(ON.text('SEARCH')); + let point = await search.getBounds(); + await Utils.sleep(1000); + await driver.mouseClick({ + x: point.left + 30, y: point.top + 45 + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await search.click(); + await Utils.sleep(1000); + await SEARCH.click(); + await Utils.sleep(1000); + for (let index = 0; index < 7; index++) { + await search.click(); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_ENTER); + await Utils.sleep(500); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ONSUBMIT_0090 + * @tc.name SUB_ACE_UI_COMPONENT_ONSUBMIT_0090 + * @tc.desc Search:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_ONSUBMIT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0090 start.`); + Settings.createWindow('testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0090'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('OnSubmitReplacement0020_2')); + let SEARCH: Component = await driver.findComponent(ON.text('SEARCH')); + let btn: Component = await driver.findComponent(ON.text('case0090')); + await Utils.sleep(1000); + let point = await search.getBounds(); + await Utils.sleep(1000); + await Utils.sleep(1000); + await search.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_ENTER); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.left + 30, y: point.top + 45 + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await SEARCH.click(); + await Utils.sleep(1000); + + await btn.click(); + await Utils.sleep(1000); + await search.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_NUMPAD_ENTER); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.left + 30, y: point.top + 45 + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await SEARCH.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ONSUBMIT_0090 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement.test.ets new file mode 100755 index 00000000..bccb9c4b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement.test.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +export default function UIComponentSetFontSizeScaleReplacement() { + + describe('UIComponentSetFontSizeScaleReplacement', () => { + 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_SETFONTSIZESCALE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_SETFONTSIZESCALE_0150 + * @tc.desc 应用设置setFontSizeScale,横竖屏切换 + */ + it('SUB_ACE_UI_COMPONENT_SETFONTSIZESCALE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SETFONTSIZESCALE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0150"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(500); + text.click() + await Utils.sleep(2000); + Settings.changeOrientation() + await Utils.sleep(2000); + await windowSnap.snapShot(); + + await Utils.sleep(1000); + Settings.changeOrientation() + await Utils.sleep(2000); + + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SETFONTSIZESCALE_0010 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpanInterfaceTest/UIComponentSpanInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpanInterfaceTest/UIComponentSpanInterface001.test.ets new file mode 100755 index 00000000..d1d04062 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpanInterfaceTest/UIComponentSpanInterface001.test.ets @@ -0,0 +1,1555 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0010:span测试文档 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentSpanInterface001() { + + describe('UIComponentSpanInterface001', () => { + 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_TEXT_SPAN_ACTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0010 + * @tc.desc Paragraph paint displays span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSpanInterface004") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0020 + * @tc.desc Span supports Inspector display + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSpanInterface003") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0030 + * @tc.desc Text display span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_ACTION_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0010 + * @tc.desc Span supports drag and drop + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let textSpan: Component = await driver.findComponent(ON.id('UIComponentSpanInterface001_text_001')) + let textArea: Component = await driver.findComponent(ON.id('UIComponentSpanInterface001_textArea_001')) + await textSpan.longClick() + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000); + await textSpan.dragTo(textArea) + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0020 + * @tc.desc Span supports select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let textSpan: Component = await driver.findComponent(ON.id('UIComponentSpanInterface001_text_001')) + await Utils.sleep(1000) + await textSpan.longClick() + await Utils.sleep(1000) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0030 + * @tc.desc Span supports onClick + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let textSpan: Component = await driver.findComponent(ON.id('UIComponentSpanInterface001_text_001')) + await Utils.sleep(1000) + await textSpan.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SPAN_INTERACTION_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0390 + * @tc.desc SymbolSpan does not support copying + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0390 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface003") + let driver: Driver = Driver.create() + await Utils.sleep(500) + let textOne: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface003_text_001')) + let textTwo: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface003_text_002')) + let textThree: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface003_text_003')) + await Utils.sleep(500) + await textOne.longClick() + await Utils.sleep(500) + windowSnap.snapShot('none') + + await Utils.sleep(500) + await textTwo.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + windowSnap.snapShot('localDevice') + + await Utils.sleep(500) + await textThree.longClick() + await Utils.sleep(500) + let selectAllCross: Component = await driver.findComponent(ON.text('全选')) + await selectAllCross?.click() + await Utils.sleep(500) + windowSnap.snapShot('cross_device') + + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0710 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0710 + * @tc.desc Scroll nested text with multiple spans + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0710 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface004") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let pageButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface004_button_001')) + await Utils.sleep(1000) + for(let i = 0; i<5; i++){ + await pageButton.click() + await Utils.sleep(1000) + } + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MIXEDDISPLAY_0710 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0010 + * @tc.desc Symbol single component dynamic effect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface005") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let scaleButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface005_button_001')) + let hierarchicalButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface005_button_002')) + let noneButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface005_button_003')) + await Utils.sleep(1000) + await scaleButton.click() + await Utils.sleep(200) + windowSnap.snapShot('scale') + + await Utils.sleep(1000) + await hierarchicalButton.click() + await Utils.sleep(200) + windowSnap.snapShot('hierarchical') + + await Utils.sleep(1000) + await noneButton.click() + await Utils.sleep(200) + windowSnap.snapShot('none') + + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0020 + * @tc.desc Symbol single component dynamic effect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface006") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let scaleButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface006_button_001')) + let hierarchicalButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface006_button_002')) + let noneButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface006_button_003')) + await Utils.sleep(1000) + await scaleButton.click() + await Utils.sleep(200) + windowSnap.snapShot('scale') + + await Utils.sleep(1000) + await hierarchicalButton.click() + await Utils.sleep(200) + windowSnap.snapShot('hierarchical') + + await Utils.sleep(1000) + await noneButton.click() + await Utils.sleep(200) + windowSnap.snapShot('none') + + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_1 + * @tc.desc Symbol single component dynamic effect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_1 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let scaleButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface007_button_001')); + await Utils.sleep(1000); + await scaleButton.click(); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_1 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_2 + * @tc.desc Symbol single component dynamic effect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_2 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let hierarchicalButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface007_button_002')); + await Utils.sleep(1000); + await hierarchicalButton.click(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_2 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_3 + * @tc.desc Symbol single component dynamic effect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_3 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let noneButton: Component = await driver.findComponent(ON.id('UIComponentSymbolSpanInterface006_button_003')) + await Utils.sleep(1000); + await noneButton.click(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTION_0040_3 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0010 + * @tc.desc SymbolEffect has no movement effect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface007") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let noneButton: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface007_button_001')) + await Utils.sleep(1000) + await noneButton.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0020 + * @tc.desc ScaleSymbolEffect isActive layered @down + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0020 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface008_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0030 + * @tc.desc ScaleSymbolEffect isActive layered @up + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface008_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0040 + * @tc.desc ScaleSymbolEffect isActive whole @down + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface008_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0050 + * @tc.desc ScaleSymbolEffect isActive whole @pu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface008_button_004')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0060 + * @tc.desc ScaleSymbolEffect isActive Empty parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface009") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface009_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0070 + * @tc.desc HierarchicalSymbolEffect isActive Empty parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0010") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0010_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0080 + * @tc.desc HierarchicalSymbolEffect isActive CUMULATIVE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0011") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0011_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0090 + * @tc.desc HierarchicalSymbolEffect isActive ITERATIVE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0090 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0011") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0011_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0100 + * @tc.desc AppearSymbolEffect isActive Empty parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0012") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0012_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0110 + * @tc.desc AppearSymbolEffect isActive layered + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0013") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0013_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0120 + * @tc.desc AppearSymbolEffect isActive whole + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0013") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0013_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0130 + * @tc.desc DisappearSymbolEffect isActive Empty parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0014") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0014_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0140 + * @tc.desc DisappearSymbolEffect isActive LAYER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0015") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0015_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0150 + * @tc.desc DisappearSymbolEffect isActive WHOLE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0015") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0015_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0150 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0160 + * @tc.desc BounceSymbolEffect isActive LAYER DOWN + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0017_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0170 + * @tc.desc BounceSymbolEffect isActive LAYER UP + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0017_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0180 + * @tc.desc BounceSymbolEffect isActive WHOLE DOWN + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0017_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0180 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0190 + * @tc.desc BounceSymbolEffect isActive WHOLE UP + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0017_button_004')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0200 + * @tc.desc BounceSymbolEffect isActive Empty parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0016_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0210 + * @tc.desc ReplaceSymbolEffect isActive Empty parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0018") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0018_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0210 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0220 + * @tc.desc ReplaceSymbolEffect isActive LAYER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0019") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0019_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0220 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0230 + * @tc.desc ReplaceSymbolEffect isActive WHOLE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0019") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0019_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0240 + * @tc.desc PulseSymbolEffect Empty parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0020") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0020_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0250 + * @tc.desc active is null + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0021") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0021_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0260 + * @tc.desc triggerValue is null + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0022") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0022_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0270 + * @tc.desc ScaleSymbolEffect triggerValue test @LAYER DOWN + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0023_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0270 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0280 + * @tc.desc ScaleSymbolEffect triggerValue test @LAYER UP + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0023_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0280 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0290 + * @tc.desc ScaleSymbolEffect triggerValue test @WHOLE DOWN + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0290 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0023_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0290 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0300 + * @tc.desc ScaleSymbolEffect triggerValue test @WHOLE UP + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0023_button_004')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0300 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0310 + * @tc.desc ScaleSymbolEffect triggerValue test null param + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0024") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0024_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0310 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0320 + * @tc.desc HierarchicalSymbolEffect triggerValue test null param + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0320 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0025") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0025_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0320 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0330 + * @tc.desc HierarchicalSymbolEffect triggerValue test @CUMULATIVE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0330 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0026") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0026_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0330 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0340 + * @tc.desc HierarchicalSymbolEffect triggerValue test @ITERATIVE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0340 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0026") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0026_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0340 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0350 + * @tc.desc AppearSymbolEffect triggerValue test null param + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0027") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0027_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0350 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0360 + * @tc.desc AppearSymbolEffect triggerValue test LAYER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0028") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0028_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0360 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0370 + * @tc.desc AppearSymbolEffect triggerValue test WHOLE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0370 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0028") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0028_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0370 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0380 + * @tc.desc DisappearSymbolEffect triggerValue test null param + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0380 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0029") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0029_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0390 + * @tc.desc DisappearSymbolEffect triggerValue test LAYER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0390 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0030") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0030_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0400 + * @tc.desc DisappearSymbolEffect triggerValue test WHOLE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0400 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0030") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0030_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0410 + * @tc.desc BounceSymbolEffect triggerValue test @LAYER DOWN + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0410 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0031_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0410 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0420 + * @tc.desc BounceSymbolEffect triggerValue test @LAYER UP + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0420 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0031_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0420 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0430 + * @tc.desc BounceSymbolEffect triggerValue test @WHOLE DOWN + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0430 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0031_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0430 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0440 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0440 + * @tc.desc BounceSymbolEffect triggerValue test @WHOLE UP + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0440 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0031_button_004')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0440 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0450 + * @tc.desc BounceSymbolEffect triggerValue test null param + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0450 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0032") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0032_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0450 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0460 + * @tc.desc ReplaceSymbolEffect triggerValue test null param + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0460 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0033") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0033_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0460 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0470 + * @tc.desc ReplaceSymbolEffect triggerValue test LAYER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0470 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0034") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0034_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0470 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0480 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0480 + * @tc.desc ReplaceSymbolEffect triggerValue test WHOLE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0480 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0034") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0034_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0480 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0490 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0490 + * @tc.desc PulseSymbolEffect triggerValue test null param + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0490 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0035") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0035_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0490 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0500 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0500 + * @tc.desc test all animation @parma trash... + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0500 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0036") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0036_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0500 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0510 + * @tc.desc test all animation @parma mic... + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0510 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0037") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0037_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0510 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_520 + * @tc.desc test all animation @parma checkmark_circle... + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_520 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0038") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0038_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_520 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_530 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_530 + * @tc.desc test all animation @parma play_circle... + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_530 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0039") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0039_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_530 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_540 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_540 + * @tc.desc test all animation @parma play_circle... add Horizontal and vertical screen switching + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_540 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0033") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0033_button_001')) + await Utils.sleep(500) + await Settings.changeOrientation() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(500) + await windowSnap.snapShot('horizontal') + await Utils.sleep(500) + await Settings.changeOrientation() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot('vertical') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_540 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0550 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0550 + * @tc.desc Multiple settings of symbolEffect have no effect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0550 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0040") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0040_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0550 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0560 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0560 + * @tc.desc set renderingStrategy and symbolEffect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0560 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0041") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0041_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0560 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0570 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0570 + * @tc.desc set effectStrategy value is SymbolEffectStrategy.NONE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0570 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0042_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0570 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0580 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0580 + * @tc.desc set effectStrategy value is SymbolEffectStrategy.SCALE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0580 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0042_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0580 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0590 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0590 + * @tc.desc set effectStrategy value is SymbolEffectStrategy.HIERARCHICAL + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0590 start.`); + Settings.createWindow("testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042") + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button: Component = await driver.findComponent(ON.id('UIComponentSymbolGlyphInterface0042_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SYMBOL_MOTIONENHANCEMENT_0590 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonClickReplacementTest/UIComponentTextCommonClickReplacement001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonClickReplacementTest/UIComponentTextCommonClickReplacement001.test.ets new file mode 100755 index 00000000..e1f3391f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonClickReplacementTest/UIComponentTextCommonClickReplacement001.test.ets @@ -0,0 +1,1635 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { KeyboardAvoidMode } from '@ohos.arkui.UIContext'; +import { KeyCode } from '@kit.InputKit'; + +export default function UIComponentTextCommonClickReplacement001() { + + describe('UIComponentTextCommonClickReplacement001', () => { + 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_TEXT_COMMON_CLICK_0010_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_01 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_01 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_001')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000) + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500) + await copy?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500) + await paste?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_01 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_02 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_02 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_002')); + await Utils.sleep(500); + await textInput.click() + await Utils.sleep(1000); + let point = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000) + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500) + await copy?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500) + await paste?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_02 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_03 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_03 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_003')); + await Utils.sleep(500); + await search.click() + await Utils.sleep(1000); + let point = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000) + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500) + await copy?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500) + await paste?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010_03 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0020 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_001')); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_002')); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_003')); + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point1 = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point1.x, point1.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0030 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_001')); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_002')); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_003')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.drag(100, 300, 300, 300, 500) + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point1 = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point1.x, point1.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0040 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_001')); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_002')); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_003')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 150, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x + 150, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point1 = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point1.x + 150, point1.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_01 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_01 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_001')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(1000) + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500) + await copy?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500) + await paste?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_01 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_02 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_02 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_002')); + await Utils.sleep(500); + await textInput.click() + await Utils.sleep(500); + let point = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(1000) + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500) + await copy?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500) + await paste?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_02 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_03 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_03 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0010_003')); + await Utils.sleep(500); + await search.click() + await Utils.sleep(500); + let point = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(1000) + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500) + await copy?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500) + await paste?.click() + await Utils.sleep(500) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0050_03 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0060 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0020_001')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point0 = await textArea.getBounds() + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.left + 50, point.y / 2) + } + await Utils.sleep(1000) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0070 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0020_001')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point0 = await textArea.getBounds() + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + let one: number = point.y / 2; + for (let index = 0; index < 3; index++) { + await driver.click(point0.left + 10, one) + } + await Utils.sleep(1000) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, point.y) + } + await Utils.sleep(1000) + console.log("rjj:" + point.y + " one:" + one) + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 200, 150) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0080 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0080'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0080_001')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_01 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_01 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0090_001')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + for (let index = 0; index < 2; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_01 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_02 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_02 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0090_002')); + await Utils.sleep(500); + await textInput.click() + await Utils.sleep(500); + let point = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x - 200, point.y) + } + await Utils.sleep(1000); + for (let index = 0; index < 2; index++) { + await driver.click(point.x - 100, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_02 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_03 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_03 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let Search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0090_003')); + await Utils.sleep(500); + await Search.click() + await Utils.sleep(500); + let point = await Search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + for (let index = 0; index < 2; index++) { + await driver.click(point.x - 100, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090_03 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0100_001')); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0100_002')); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0100_003')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point1 = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point1.x, point1.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_01 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_01 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0110'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0110_001')); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0110_002')); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0110_003')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point1 = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point1.x, point1.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_01 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_02 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_02 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0110'); + await Utils.sleep(500); + await Settings.changeOrientation() + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0110_001')); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0110_002')); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0110_003')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point1 = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point1.x, point1.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Settings.changeOrientation() + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0110_02 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_01 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_01 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0130_001')); + let textArea_btn: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0130_button_001')); + await Utils.sleep(500); + await textArea.click(); + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500); + await driver.triggerKey(2) + await Utils.sleep(500); + await driver.triggerKey(2) + await Utils.sleep(500); + await textArea_btn.click() + await Utils.sleep(1000); + await textArea.click() + await Utils.sleep(1000); + let point0 = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_01 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_02 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_02 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0130_002')); + let textInput_btn: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0130_button_002')); + await Utils.sleep(500); + await textInput.click() + await Utils.sleep(500); + let point = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500); + await driver.triggerKey(2) + await Utils.sleep(500); + await driver.triggerKey(2) + await Utils.sleep(500); + await textInput_btn.click() + await Utils.sleep(1000); + await textInput.click() + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_02 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_03 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_03 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let search: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0130_003')); + let search_btn: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0130_button_003')); + await Utils.sleep(500); + await search.click() + await Utils.sleep(500); + let point = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(500); + await driver.triggerKey(2) + await Utils.sleep(500); + await driver.triggerKey(2) + await Utils.sleep(500); + await search_btn.click() + await Utils.sleep(1000); + await search.click() + await Utils.sleep(1000); + let point0 = await search.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0130_03 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0140 + * @tc.desc test click + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0140'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0140_001')); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextCommonClickReplacement0140_002')); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + let point0 = await textInput.getBoundsCenter() + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await driver.click(point0.x, point0.y) + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let btn11: Component = await driver.findComponent(ON.id('ClickReplacement_11')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn11.click(); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let btn11: Component = await driver.findComponent(ON.id('ClickReplacement_11')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn11.click(); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + let point2 = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point2.x, point2.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0150_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0160 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await driver.click(300,300); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let btn9: Component = await driver.findComponent(ON.id('ClickReplacement_9')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + await btn9.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.left + 10, point.top + 20); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let btn10: Component = await driver.findComponent(ON.id('ClickReplacement_10')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + await btn10.click(); + await Utils.sleep(1000); + let point = await textArea.getBounds(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.left, point.top + 20); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0170_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await driver.inputText(point, ' '); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 50, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await driver.inputText(point, '\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00'); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 50, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_3 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_3 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await driver.inputText(point, 'hello world,hi'); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x + 50, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0180_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let btn6: Component = await driver.findComponent(ON.id('ClickReplacement_6')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + await btn6.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let btn7: Component = await driver.findComponent(ON.id('ClickReplacement_7')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + await btn7.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_3 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_3 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let btn8: Component = await driver.findComponent(ON.id('ClickReplacement_8')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + await btn8.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0190_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0200 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0200 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y); + } + await driver.click(point.x, point.y + 100); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0200 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0210 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0210 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.id('ClickReplacement_4')); + let btn5: Component = await driver.findComponent(ON.id('ClickReplacement_5')); + let textArea: Component = await driver.findComponent(ON.id('ClickReplacement_1')); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await btn4.click(); + await Utils.sleep(1000); + await btn5.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.click(point.x, point.y); + } + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_A); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_BACK); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0210 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.test.ets new file mode 100755 index 00000000..4a45cdda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.test.ets @@ -0,0 +1,234 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { afterEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { KeyCode } from '@kit.InputKit'; + +export default function UIComponentTextCommonEmojiReplacement() { + + describe('UIComponentTextCommonEmojiReplacement', () => { + 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_TEXT_COMMON_EMOJI_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130 + * @tc.desc emoji + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + let textinput = await driver.findComponent(ON.id('textinput')); + await textinput.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_1 + * @tc.desc emoji + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + let textarea = await driver.findComponent(ON.id('textarea')); + await textarea.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_2 + * @tc.desc emoji + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('search')); + await search.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0130_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190 + * @tc.desc emoji + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + let textinput = await driver.findComponent(ON.id('textinput')); + await textinput.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_1 + * @tc.desc emoji + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + let textarea = await driver.findComponent(ON.id('textarea')); + await textarea.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_2 + * @tc.desc emoji + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement'); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('search')); + await search.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Z); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_Y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_EMOJI_0190_2 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement.test.ets new file mode 100755 index 00000000..f6d7fde2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement.test.ets @@ -0,0 +1,779 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +export default function UIComponentTextCopyAttributeReplacement() { + + describe('UIComponentTextCopyAttributeReplacement', () => { + 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_Text_Copy_Attribute_0010 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0010 + * @tc.desc Text组件设置文字样式、设置fontFeature与textshadow属性 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0010"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0020 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0020 + * @tc.desc Text组件设置文字样式,不设置fontFeature与textshadow属性 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0020"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0030 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0030 + * @tc.desc Text组件属性字符串设置装饰线、大小写 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0030"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0040 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0040 + * @tc.desc Text组件设置文本字号样式。 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0040"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0050 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0050 + * @tc.desc Text组件不设置文本字号样式。 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0050"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0390 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0390 + * @tc.desc Text组件包含imagespan子组件设置imag + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0390 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0390"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0400 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0400 + * @tc.desc Text组件包含imagespan子组件设置图片宽高 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0400 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0400"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0410 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0410 + * @tc.desc Text组件只添加属性字符串 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0410 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0410"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0410 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0420 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0420 + * @tc.desc Text组件添加属性字符串属性和text组件属性 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0420 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0420"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0420 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0430 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0430 + * @tc.desc Text组件不设置任何属性 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0430 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0430"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0430 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0440 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0440 + * @tc.desc Text组件设置异常属性值 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0440 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0440"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0440 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0450 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0450 + * @tc.desc Text组件包含多个子组件,选中全部文本内容 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0450 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0450"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0450 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0460 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0460 + * @tc.desc Text组件包含多个子组件,选中部分文本内容 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0460 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0460"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0460 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0470 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0470 + * @tc.desc Text组件文本包含emoji表情 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0470 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0470"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0470 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0480 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0480 + * @tc.desc Text组件文本包含混合语种 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0480 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0480"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0480 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0490 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0490 + * @tc.desc Text组件包含symbolspan组件并设置属性 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0490 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0490"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(2000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click(); + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0490 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0500 + * @tc.name SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0500 + * @tc.desc Text组件包含containerSpan组件并设置属性 + */ + it('SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0500 start.`); + Settings.createWindow("testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0500"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + await Utils.sleep(500); + + let allow: Component = await driver.findComponent(ON.text('始终允许')) + await Utils.sleep(1000); + if (allow) { + await allow.click() + await Utils.sleep(1000); + } + + let text: Component = await driver.findComponent(ON.id('text')) + await Utils.sleep(1000); + await text.longClick() + await Utils.sleep(2000); + let allSelect: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(200); + await allSelect.click() + await Utils.sleep(1000); + + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(200); + await copy.click() + await Utils.sleep(1000); + + let getData: Component = await driver.findComponent(ON.id('getData')) + await Utils.sleep(200); + await getData.click() + await Utils.sleep(1500); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_Text_Copy_Attribute_0500 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHalfleadingReplacementTest/UIComponentTextHalfleadingReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHalfleadingReplacementTest/UIComponentTextHalfleadingReplacement.test.ets new file mode 100755 index 00000000..531aacc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHalfleadingReplacementTest/UIComponentTextHalfleadingReplacement.test.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { 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 { Driver, ON, Component, MouseButton } from '@ohos.UiTest'; +import { KeyCode } from '@kit.InputKit' + +export default function UIComponentTextHalfleadingReplacement() { + + describe('UIComponentTextHalfleadingReplacement', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + let driver: Driver = Driver.create(); + await driver.click(300, 300); + await Utils.sleep(1000); + 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_TEXT_HALFLEADING_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0100 + * @tc.desc halfLeading + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextHalfleadingReplacement/UIComponentTextHalfleadingReplacement0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('TextHalfleading_1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0120 + * @tc.desc halfLeading + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextHalfleadingReplacement/UIComponentTextHalfleadingReplacement0100'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HALFLEADING_0120 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPasswordInterfaceTest/UIComponentTextInputPasswordInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPasswordInterfaceTest/UIComponentTextInputPasswordInterface001.test.ets new file mode 100755 index 00000000..2dee6efe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPasswordInterfaceTest/UIComponentTextInputPasswordInterface001.test.ets @@ -0,0 +1,1050 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0010:password 文档测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentTextInputPasswordInterface001() { + + describe('UIComponentTextInputPasswordInterface001', () => { + 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_TEXT_TEXTINPUT_SHOWPASSWORD_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0010 + * @tc.desc textInput test showPassword = true + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0028") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0028_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0028_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await textInput.inputText("password") + await Utils.sleep(1000) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.mouseClick({ + x: point.x * 2 - 20, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + await driver.click(100, 50) + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0020 + * @tc.desc textInput test showPassword = false + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0028") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0028_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0028_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await textInput.inputText("password") + await Utils.sleep(500) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.mouseClick({ + x: point.x * 2 - 20, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + await driver.click(100, 50) + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0020 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0030 + * @tc.desc textInput test showPassword = undefined + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0029") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0029_textInput_001')) + await Utils.sleep(1000) + await textInput.inputText("password") + await Utils.sleep(500) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.mouseClick({ + x: point.x * 2 - 20, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + await driver.click(100, 50) + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0130 + * @tc.desc textInput test showPassword = true & padding = 10 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0030") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0030_textInput_001')) + await Utils.sleep(1000) + await textInput.inputText("password") + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0140 + * @tc.desc textInput test showPassword = true & type=normal + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("password123你好;;#") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0150 + * @tc.desc textInput test showPassword = true & type=NEW_PASSWORD + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("password123你好;;#") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0160 + * @tc.desc textInput test showPassword = true & type=NUMBER_PASSWORD + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("124656551") + await Utils.sleep(2000) + // let point = await textInput.getBoundsCenter(); + // await driver.mouseClick({ + // x: (point.x * 2) - 20, y: point.y + // }, MouseButton.MOUSE_BUTTON_LEFT) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0170 + * @tc.desc textInput test showPassword = true & type=NUMBER_DECIMAL + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_button_004')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246565.19090.45") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0170 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0180 + * @tc.desc textInput test showPassword = true & type=SCREEN_LOCK_PASSWORD + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0031_button_005')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0180 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0230 + * @tc.desc textInput test showPassword = true & minfontSize=-1 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0032") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0032_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0032_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0240 + * @tc.desc textInput test showPassword = true & minfontSize=0 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0032") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0032_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0032_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0250 + * @tc.desc textInput test showPassword = true & minfontSize=10ABC + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0033") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0033_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0033_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0260 + * @tc.desc textInput test showPassword = true & minfontSize=[0,9] + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0033") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0033_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0033_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0270 + * @tc.desc textInput test showPassword = true & minfontSize=undefined + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0034") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0034_textInput_001')) + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0280 + * @tc.desc textInput test showPassword = true & minfontSize=not set + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0280 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0035") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0035_textInput_001')) + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0280 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0290 + * @tc.desc textInput test showPassword = true & maxFontSize = -1 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0290 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0290 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0300 + * @tc.desc textInput test showPassword = true & maxFontSize = 0 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0300 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0310 + * @tc.desc textInput test showPassword = true & maxFontSize = 10ABC + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0310 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0037") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0037_textInput_001')) + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0310 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0320 + * @tc.desc textInput test showPassword = true & maxFontSize = -50 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0320 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0320 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0330 + * @tc.desc textInput test showPassword = true & maxFontSize = undefined + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0330 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0038") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0038_textInput_001')) + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0330 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0340 + * @tc.desc textInput test showPassword = true & maxFontSize = undefined + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0340 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0039") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0039_textInput_001')) + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0340 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0350 + * @tc.desc textInput test showPassword = true & maxFontSize = 19 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0036_button_004')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0350 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0370 + * @tc.desc textInput test showPassword = true & style = default + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0040") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0040_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0040_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好45你cc好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0370 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0370 + * @tc.desc textInput test showPassword = true & style = inLINE + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0380 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0040") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0040_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0040_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好45你cc好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0380 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0400 + * @tc.desc textInput test showPassword = true & fontFeature = sups.on + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0400 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好45你cc好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0410 + * @tc.desc textInput test showPassword = true & fontFeature = numr.on + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0410 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_button_002')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好45你cc好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0410 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0420 + * @tc.desc textInput test showPassword = true & fontFeature = dnom.on + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0420 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_button_003')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好45你cc好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0420 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0430 + * @tc.desc textInput test showPassword = true & fontFeature = subs.off + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0430 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0041_button_004')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await textInput.inputText("1246sdhj565.19090.45你好45你cc好") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0430 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0040 + * @tc.desc showPassword属性值改变:true切换到true + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface001_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface001_button_002')) + await Utils.sleep(1000) + await buttonUp.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0050 + * @tc.desc showPassword属性值改变:true切换到false + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface001_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface001_button_002')) + await Utils.sleep(1000) + await buttonDown.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0060 + * @tc.desc showPassword属性值改变:true切换到undefined + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface002_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface002_button_002')) + await Utils.sleep(1000) + await buttonUp.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0070 + * @tc.desc showPassword属性值改变:false切换到true + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0070") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0070_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0070_button_002')) + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0070 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0080 + * @tc.desc showPassword属性值改变:false切换到false + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0080") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0080_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0080_button_002')) + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0090 + * @tc.desc showPassword属性值改变:false切换到undefined + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0090") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0090_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0090_button_002')) + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0090 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0100 + * @tc.desc showPassword属性值改变:undefined切换到true + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface003_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface003_button_002')) + await Utils.sleep(1000) + await buttonUp.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0110 + * @tc.desc showPassword属性值改变:undefined切换到false + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface003_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface003_button_002')) + await Utils.sleep(1000) + await buttonDown.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0120 + * @tc.desc showPassword属性值改变:undefined切换到undefined + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let buttonUp: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface004_button_001')) + let buttonDown: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface004_button_002')) + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(500) + await buttonUp.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0200 + * @tc.desc showPassword属性值改变:false切换到false + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0200") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let eyeIcon: Component = + await driver.findComponent(ON.type('Image')) + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0200_textInput_001')) + await Utils.sleep(1000) + await eyeIcon.longClick() + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0220 + * @tc.desc showPassword属性值改变:false切换到true use modifier + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0220") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPasswordInterface0220_button_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_SHOWPASSWORD_0220 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPhoneNumberInterfaceTest/UIComponentTextInputPhoneNumberInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPhoneNumberInterfaceTest/UIComponentTextInputPhoneNumberInterface001.test.ets new file mode 100755 index 00000000..8775a346 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPhoneNumberInterfaceTest/UIComponentTextInputPhoneNumberInterface001.test.ets @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_TEXT_CONTAINERSPAN_0010:ContainerSpan 文档测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentTextInputPhoneNumberInterface001() { + + describe('UIComponentTextInputPhoneNumberInterface001', () => { + 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_TEXTINPUT_PHONENUMBER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0010 + * @tc.desc textInput test type=PhoneNumber && onchange + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CONTAINERSPAN_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface001_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("13912345678") + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CONTAINERSPAN_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0020 + * @tc.desc textInput test type=PhoneNumber && onchange + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CONTAINERSPAN_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface001_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("13912345678123456789") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0030 + * @tc.desc textInput test type=PhoneNumber && onchange + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface001_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("13912345678123456789") + await Utils.sleep(1000) + for (let index = 0; index < 5; index++) { + await Utils.sleep(500) + await driver.triggerKey(2071) + } + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0030 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0040 + * @tc.desc textInput test type=PhoneNumber && Special characters + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface002_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("123+-*#()()") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0060 + * @tc.desc textInput test type=PhoneNumber && Special characters + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface002_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是123+-*#()Abc") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0070 + * @tc.desc textInput test type=PhoneNumber && paste + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface003_textInput_001')) + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface003_text_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0080 + * @tc.desc textInput test type=PhoneNumber && paste + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface001_textInput_001')) + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPhoneNumberInterface001_text_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0080 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPopupBoxInterfaceTest/UIComponentTextInputPopupBoxInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPopupBoxInterfaceTest/UIComponentTextInputPopupBoxInterface001.test.ets new file mode 100755 index 00000000..d98190a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputPopupBoxInterfaceTest/UIComponentTextInputPopupBoxInterface001.test.ets @@ -0,0 +1,1943 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0010:POPUPBOX 文档测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentTextInputPopupBoxInterface001() { + + describe('UIComponentTextInputPopupBoxInterface001', () => { + 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_TEXT_TEXTINPUT_POPUPBOX_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0010 + * @tc.desc richText test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let richText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface001_richText_001')) + await Utils.sleep(500) + await richText.longClick() + await Utils.sleep(500) + await richText.click() + await Utils.sleep(1000) + let point = await richText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0020 + * @tc.desc setEnabled is false. + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface002_search_001')) + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface002_textInput_001')) + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface002_textArea_001')) + await Utils.sleep(500) + await searchText.longClick() + await Utils.sleep(1000) + await inputText.longClick() + await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0030 + * @tc.desc inputText test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface003_textInput_001')) + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(1000) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0040 + * @tc.desc touchEnabled is false. + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface004_search_001')) + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface004_textInput_001')) + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface004_textArea_001')) + await Utils.sleep(500) + await searchText.longClick() + await Utils.sleep(1000) + await inputText.longClick() + await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0050 + * @tc.desc search test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface005_search_001')) + await Utils.sleep(500) + await searchText.click() + await Utils.sleep(1000) + await searchText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await searchText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0060 + * @tc.desc textArea test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface005_textArea_001')) + await Utils.sleep(500) + await areaText.click() + await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_1 + * @tc.desc textArea test Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface006"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface006_textArea_001')); + await Utils.sleep(1000); + let point = await areaText.getBounds(); + await Utils.sleep(1000); + await driver.longClick(point.left+50,point.top+20); + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_2 + * @tc.desc textArea test Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface006"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let areaText: Component = await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface006_textArea_001')); + let btn: Component = await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface006_text_001')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1000); + let row: Component = await driver.findComponent(ON.type('Row')); + let point = await row.getBoundsCenter(); + await Utils.sleep(1000); + await driver.longClick(point.x,point.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0070_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0080 + * @tc.desc textInput test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface007"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface007_textInput_001')); + await Utils.sleep(500); + await inputText.longClick(); + await Utils.sleep(1000); + await driver.click(100, 50); + let point = await inputText.getBoundsCenter(); + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000); + await driver.drag(point.x, point.y, 0, point.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0090 + * @tc.desc search test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface005_search_001')) + await Utils.sleep(500) + await searchText.click() + await Utils.sleep(1000) + await searchText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await searchText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0100 + * @tc.desc search test popupBox CopyOptions.InApp, + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface008") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface008_search_001')) + await Utils.sleep(500) + await searchText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await searchText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0110 + * @tc.desc search test popupBox CopyOptions.None, + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface009") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface009_search_001')) + await Utils.sleep(500) + let point = await searchText.getBoundsCenter() + await driver.click(point.x / 2, point.y) + await Utils.sleep(1000) + await searchText.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0120 + * @tc.desc search test popupBox CopyOptions.InApp & TextAlign.Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0010_search_001')) + await Utils.sleep(500) + await searchText.longClick() + await Utils.sleep(1000) + await driver.click(200, 200) + let point = await searchText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0130 + * @tc.desc search test popupBox CopyOptions.InApp & TextAlign.End + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0011") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0011_search_001')) + await Utils.sleep(500) + await searchText.longClick() + await Utils.sleep(1000) + await driver.click(200, 200) + let point = await searchText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0140 + * @tc.desc search test popupBox CopyOptions.InApp & TextAlign.JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0012") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0012_search_001')) + await Utils.sleep(500) + await searchText.longClick() + await Utils.sleep(1000) + await driver.click(200, 200) + let point = await searchText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0150 + * @tc.desc search test popupBox CopyOptions.InApp & TextAlign.Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0013") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let searchText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0013_search_001')) + await Utils.sleep(500) + await searchText.longClick() + await Utils.sleep(1000) + await driver.click(200, 200) + let point = await searchText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0150 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0160 + * @tc.desc textArea test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface005_textArea_001')) + await Utils.sleep(500) + await areaText.click() + await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0170 + * @tc.desc textArea test popupBox & CopyOptions.InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0014_textArea_001')) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0014_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await areaText.click() + await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0180 + * @tc.desc textArea test popupBox & CopyOptions.LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0014_textArea_001')) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0014_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await areaText.click() + await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0180 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0190 + * @tc.desc textArea test popupBox & CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0190 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0014_textArea_001')) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0014_button_003')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await areaText.click() + await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0190 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0200 + * @tc.desc textArea test popupBox & not set maxLength + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0015_textArea_001')) + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + for (let i = 0; i < 3; i++) { + let pointStart = await areaText.getBoundsCenter() + await driver.inputText({ + x: pointStart.x / 2, y: pointStart.y + }, "输入测试文本无限输入,这里此操作循环4次") + await Utils.sleep(500) + } + // await areaText.click() + // await Utils.sleep(1000) + await areaText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0210 + * @tc.desc textArea test popupBox & set maxLength = -1 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0210 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0016_textArea_001')) + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + for (let i = 0; i < 3; i++) { + let pointStart = await areaText.getBoundsCenter() + await driver.inputText({ + x: pointStart.x / 2, y: pointStart.y + }, "maxLength = -1输入测试文本无限输入,这里此操作循环4次") + await Utils.sleep(500) + } + await areaText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0210 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0220 + * @tc.desc textArea test popupBox & set maxLength = 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0016_textArea_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0016_button_001')) + await Utils.sleep(500) + await button.click(); + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + let pointStart = await areaText.getBoundsCenter() + await driver.inputText({ + x: pointStart.x / 2, y: pointStart.y + }, "maxLength = 0") + await Utils.sleep(500) + await areaText.longClick() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0220 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0230 + * @tc.desc textArea test popupBox & set maxLength = 20 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0016_textArea_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0016_button_002')) + await Utils.sleep(500) + await button.click(); + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + await areaText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0240 + * @tc.desc textArea test popupBox & set TextAlign = Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0017_textArea_001')) + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + await areaText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0250 + * @tc.desc textArea test popupBox & set TextAlign = end + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0017_textArea_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0017_button_001')) + await Utils.sleep(500) + await button.click(); + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + await areaText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0260 + * @tc.desc textArea test popupBox & set TextAlign = JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0017_textArea_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0017_button_002')) + await Utils.sleep(500) + await button.click(); + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + await areaText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0270 + * @tc.desc textArea test popupBox & set TextAlign = Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0270 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let areaText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0017_textArea_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0017_button_003')) + await Utils.sleep(500) + await button.click(); + await Utils.sleep(500) + await areaText.click(); + await Utils.sleep(500) + await areaText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await areaText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0270 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0280 + * @tc.desc textInput test popupBox + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0280 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface007") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface007_textInput_001')) + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(1000) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0280 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0290 + * @tc.desc textInput test popupBox & CopyOptions.InAppp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0290 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0018_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0018_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0290 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0300 + * @tc.desc textInput test popupBox & CopyOptions.LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0018_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0018_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0300 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0310 + * @tc.desc textInput test popupBox & CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0310 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0018_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0018_button_003')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0310 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0320 + * @tc.desc textInput test popupBox & shoeUnderLine = true + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0320 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0019_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0019_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x / 2, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0320 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0330 + * @tc.desc textInput test popupBox & shoeUnderLine = false + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0330 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0019_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0019_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0330 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0340 + * @tc.desc textInput test popupBox & style= inLine + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0340 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0020") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0020_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0020_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.doubleClick() + await Utils.sleep(500) + await inputText.click() + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0340 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0350 + * @tc.desc textInput test popupBox & style= default + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0020") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0020_textInput_002')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0020_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0350 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0360 + * @tc.desc textInput test popupBox & textAlign= center + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0360 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0360 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0370 + * @tc.desc textInput test popupBox & textAlign= end + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0370 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0370 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0380 + * @tc.desc textInput test popupBox & textAlign= JUSTIFY + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0380 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_button_003')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0390 + * @tc.desc textInput test popupBox & textAlign= start + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0390 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0021_button_004')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0390 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0400 + * @tc.desc textInput test popupBox & inputType= email + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0400 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(500) + await driver.drag(0, point.y, point.x / 2, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0410 + * @tc.desc textInput test popupBox & inputType= normal + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0410 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0410 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0420 + * @tc.desc textInput test popupBox & inputType= number + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0420 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_button_003')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0420 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0430 + * @tc.desc textInput test popupBox & inputType= password + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0430 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_button_004')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0430 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0440 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0440 + * @tc.desc textInput test popupBox & inputType= phoneNumber + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0440 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_textInput_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0022_button_005')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await inputText.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(500) + await driver.drag(0, point.y, point.x / 2, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0440 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0450 + * @tc.desc text test popupBox & CopyOptions = None + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0440 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_text_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0450 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0460 + * @tc.desc text test popupBox & CopyOptions = InApp + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0460 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_text_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_button_002')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await text.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(0, point.y, point.x, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0460 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0470 + * @tc.desc text test popupBox & CopyOptions = LocalDevice + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0470 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_text_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_button_003')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await text.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(0, point.y, point.x, point.y) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0470 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0490 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0490 + * @tc.desc textInput test popupBox & fontSize = 50 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0490 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0024") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0024_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + let point = await textInput.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + await Utils.sleep(500) + await driver.drag(0, point.y, point.x, point.y) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0490 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_1 + * @tc.desc textInput test popupBox & fontSize = 50 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('PBInterface0500_tInput')) + let btn: Component = await driver.findComponent(ON.id('PBInterface0500_1')) + await Utils.sleep(500) + await btn.click(); + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(1000) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(1000) + } + let point = await textInput.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.triggerKey(2082); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x + 100, point.y) + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(500) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(500) + } + await driver.triggerKey(2049); + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_2 + * @tc.desc textInput test popupBox & fontSize = 50 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('PBInterface0500_tInput')) + let btn: Component = await driver.findComponent(ON.id('PBInterface0500_2')) + await Utils.sleep(500) + await btn.click(); + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(1000) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(1000) + } + let point = await textInput.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.triggerKey(2082); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x + 100, point.y) + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(500) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(500) + } + await driver.triggerKey(2049); + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_3 + * @tc.desc textInput test popupBox & fontSize = 50 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('PBInterface0500_tInput')) + let btn: Component = await driver.findComponent(ON.id('PBInterface0500_3')) + await Utils.sleep(500) + await btn.click(); + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(1000) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(1000) + } + let point = await textInput.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.triggerKey(2082); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x + 100, point.y) + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(500) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(500) + } + await driver.triggerKey(2049); + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_3 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_4 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_4 + * @tc.desc textInput test popupBox & fontSize = 50 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_4 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('PBInterface0500_tInput')) + let btn: Component = await driver.findComponent(ON.id('PBInterface0500_4')) + await Utils.sleep(500) + await btn.click(); + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(1000) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(1000) + } + let point = await textInput.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.triggerKey(2082); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x + 100, point.y) + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(500) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(500) + } + await driver.triggerKey(2049); + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0500_4 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0560 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0560 + * @tc.desc textInput test popupBox & fontSize = 50 + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0560 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('PBInterface0500_tInput')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(1000) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(1000) + } + let point = await textInput.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.triggerKey(2082); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x +300, point.y) + await Utils.sleep(500) + for (let index = 0; index < 2; index++) { + let moreBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await moreBtn.click() + await Utils.sleep(500) + let backBtn: Component = await driver.findComponent(ON.type('SelectMoreOrBackButton')) + await backBtn.click() + await Utils.sleep(500) + } + await driver.triggerKey(2049); + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0560 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0510 + * @tc.desc textInput test popupBox & copy to other text + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0510 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0026") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0026_text_001')) + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0026_textInput_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0510 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0540 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0540 + * @tc.desc text test popupBox & lineSpacing + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0510 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0043") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0043_text_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + await driver.click(100, 200) + await Utils.sleep(500) + let potion = await text.getBoundsCenter() + await Utils.sleep(500) + await driver.drag(potion.x, potion.y, 0, potion.y) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0510 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0550 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0550 + * @tc.desc textInput test popupBox & copy to other text + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0550 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0026") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0026_text_001')) + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0026_textInput_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0550 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0520 + * @tc.desc text test popupBox & CopyOptions = LocalDevice & setOrientation + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0520 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_text_001')) + let button: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0023_button_003')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + await driver.click(100, 50) + await Utils.sleep(500) + await Settings.changeOrientation() + await Utils.sleep(500) + let point = await text.getBoundsCenter() + console.log("point: " + point.x + " y : " + point.y); + await Utils.sleep(500) + await driver.drag(point.x, point.y, point.x * 2, point.y) + // await Utils.sleep(500) + // await driver.drag(0, point.y, point.x, point.y) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + await Settings.changeOrientation() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0520 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0580 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0580 + * @tc.desc textInput test popupBox & router + * + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0580 start.`); + Settings.createWindow("testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0027") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0027_textInput_001')) + let column: Component = + await driver.findComponent(ON.id('UIComponentTextInputPopupBoxInterface0027_column_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + column.click() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_POPUPBOX_0580 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInterfaceTest/UIComponentTextInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInterfaceTest/UIComponentTextInterface001.test.ets new file mode 100755 index 00000000..7049a512 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInterfaceTest/UIComponentTextInterface001.test.ets @@ -0,0 +1,1146 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { i18n } from '@kit.LocalizationKit' +import { BusinessError } from '@kit.BasicServicesKit' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' +import Window from '@ohos.window' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0010:text的direction测试case + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentTextInterface001() { + + describe('UIComponentTextInterface001', () => { + 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_TEXT_TEXT_DIRECTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0010 + * @tc.desc test direction @parma Auto/Rtl/ltr zh + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface001") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('zh-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface001_button_001')) + await Utils.sleep(500) + await windowSnap.snapShot('Auto') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0020 + * @tc.desc test direction @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface001") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface001_button_001')) + await Utils.sleep(500) + await windowSnap.snapShot('Auto') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0030 + * @tc.desc test direction @parma Auto and overflow , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface002") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface002_button_001')) + await Utils.sleep(500) + await windowSnap.snapShot('clip') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0040 + * @tc.desc test direction @parma Rtl and overflow , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface003") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch(error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface003_button_001')) + await Utils.sleep(500) + await windowSnap.snapShot('clip') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0050 + * @tc.desc test direction @parma Ltr and overflow , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface004") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface004_button_001')) + await Utils.sleep(500) + await windowSnap.snapShot('clip') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0060 + * @tc.desc language is ug and test direction @parma Auto and overflow , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface002") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface002_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface002_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await windowSnap.snapShot('clip') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0070 + * @tc.desc language is ug and test direction @parma Rtl and overflow , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface003") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch(error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface003_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface003_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await windowSnap.snapShot('clip') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0080 + * @tc.desc language is ug and test direction @parma Ltr and overflow , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface004") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface004_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface004_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await windowSnap.snapShot('clip') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0090 + * @tc.desc language is ug and test direction @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface001") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface001_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface001_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await windowSnap.snapShot('Auto') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0100 + * @tc.desc language is ug and test direction @parma Auto/Rtl/ltr zh + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface001") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('zh-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface001_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface001_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await windowSnap.snapShot('Auto') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0110 + * @tc.desc language is ug and test direction @parma Ltr and TextAlign , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface005") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface005_button_001')) + await Utils.sleep(500) + switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('center') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('end') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0120 + * @tc.desc language is zh and test direction @parma Ltr and TextAlign , ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface005") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface005_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface005_001')) + await Utils.sleep(500) + text.click() + await Utils.sleep(500) + + switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('center') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('end') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0130 + * @tc.desc language is ug and test textShadow+ @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface006") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface006_button_001')) + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('ltr') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0140 + * @tc.desc language is ug and test textShadow+ @parma Auto/Rtl/ltr zh + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface006") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('zh-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface006_button_001')) + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('ltr') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0150 + * @tc.desc language is zh and test textShadow+ @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface006") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface006_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface006_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('ltr') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0160 + * @tc.desc language is zh and test textShadow+ @parma Auto/Rtl/ltr zh + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface006") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('zh-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(1000) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface006_button_001')) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface006_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('Rtl') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('ltr') + + await Utils.sleep(500) + await switchButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0170 + * @tc.desc language is ug and test copy&drag+ @parma Auto ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface007") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let text: Component = await driver.findComponent(ON.id('UIComponentTextInterface007_001')) + let textArea: Component = await driver.findComponent(ON.id('UIComponentTextInterface007_textArea_001')) + await text.longClick() + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000); + await text.dragTo(textArea) + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_01 + * @tc.desc language is ug and test Direction.Auto + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_01 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_02 + * @tc.desc language is ug and test Direction.Auto + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_02 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(500); + + await Settings.changeOrientation() + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_02 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_03 + * @tc.desc language is ug and test Direction.Auto + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_03 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(500); + + await Settings.changeOrientation() + await Utils.sleep(500); + //click ltr + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(500) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_04 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_04 + * @tc.desc language is ug and test Direction.Auto + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_04', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_04 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(500); + + await Settings.changeOrientation() + await Utils.sleep(500); + //click ltr + await button.click() + await Utils.sleep(500); + await Settings.changeOrientation() + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_04 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_05 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_05 + * @tc.desc language is ug and test Direction.Auto + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_05', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_05 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(500); + + await Settings.changeOrientation() + await Utils.sleep(500); + //click ltr + await button.click() + await Utils.sleep(500); + await Settings.changeOrientation() + await Utils.sleep(500); + //click rtl + await button.click() + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_05 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_06 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_06 + * @tc.desc language is ug and test Direction.Auto + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_06', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_04 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(500); + + await Settings.changeOrientation() + await Utils.sleep(500); + //click ltr + await button.click() + await Utils.sleep(500); + await Settings.changeOrientation() + await Utils.sleep(500); + //click rtl + await button.click() + await Utils.sleep(500); + await Settings.changeOrientation() + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(500); + await Settings.changeOrientation() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0180_06 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_01 + * @tc.desc language is ug and test changeOrientation @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_01 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(1000); + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_02 + * @tc.desc language is ug and test changeOrientation @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_02 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(1000) + //click ltr + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_02 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_03 + * @tc.desc language is ug and test changeOrientation @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_03 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0016") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let button: Component = await driver.findComponent(ON.id('UIComponentTextInterface0016_button_001')) + await Utils.sleep(500) + //click auto + await button.click() + await Utils.sleep(1000) + //click ltr + await button.click() + await Utils.sleep(1000) + //click rtl + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0190_03 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0220 + * @tc.desc language is ug and test changeOrientation @parma Auto/Rtl/ltr ug+zh + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0012") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface0012_button_001')) + await Utils.sleep(500) + await switchButton.click(); + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0220 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0230 + * @tc.desc language is ug and test textIndent&letterSpace @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0013") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface0013_button_001')) + await Utils.sleep(500) + await switchButton.click(); + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0240 + * @tc.desc language is ug and test fontFeature:frac @parma Auto/Rtl/ltr ug + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0014") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('ug-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface0014_button_001')) + await Utils.sleep(500) + await switchButton.click(); + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0250 + * @tc.desc language is zh and test span&ImageSpan @parma Auto/Rtl/ltr zh + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTextInterface/UIComponentTextInterface0015") + let driver: Driver = Driver.create() + await Utils.sleep(500) + try { + i18n.System.setAppPreferredLanguage('zh-CN'); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + await Utils.sleep(500) + let switchButton: Component = await driver.findComponent(ON.id('UIComponentTextInterface0015_button_001')) + await Utils.sleep(500) + await switchButton.click(); + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + await switchButton.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_DIRECTION_0250 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSafePasteInterfaceTest/UIComponentTextSafePasteInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSafePasteInterfaceTest/UIComponentTextSafePasteInterface001.test.ets new file mode 100755 index 00000000..032efb8a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSafePasteInterfaceTest/UIComponentTextSafePasteInterface001.test.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentTextSafePasteInterface001() { + + describe('UIComponentTextSafePasteInterface001', () => { + 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_ATTRIBUTES_FONT_INTERFACE_0010 + * @tc.name SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010 + * @tc.desc textInput set selectionMenuHidden为true + */ + it('SUB_ACE_UI_TEXT_SAFEPASTE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface001") + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface001_textInput_001")); + let text = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface001_text_001")); + await Utils.sleep(500); + await textInput.longClick() + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')) + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(500) + await text.click() + await Utils.sleep(500); + await textInput.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0010 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_TEXT_SAFEPASTE_0110 + * @tc.name SUB_ACE_UI_TEXT_SAFEPASTE_0110 + * @tc.desc textArea set selectionMenuHidden为true + */ + it('SUB_ACE_UI_TEXT_SAFEPASTE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface002") + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface002_textArea_001")); + let text = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface002_text_001")); + await Utils.sleep(500); + await textInput.longClick() + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')) + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(500) + await text.click() + await Utils.sleep(500); + await textInput.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0110 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_TEXT_SAFEPASTE_0220 + * @tc.name SUB_ACE_UI_TEXT_SAFEPASTE_0220 + * @tc.desc test pastButton + */ + it('SUB_ACE_UI_TEXT_SAFEPASTE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface003") + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface003_textInput_001")); + let text = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface003_text_001")); + let pastButton = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface003_paste_001")); + await Utils.sleep(500); + await text.longClick() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await Utils.sleep(500) + await copy?.click() + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500); + await driver.triggerCombineKeys(2072,2038) + await Utils.sleep(500) + await pastButton.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0220 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_TEXT_SAFEPASTE_0060 + * @tc.name SUB_ACE_UI_TEXT_SAFEPASTE_0060 + * @tc.desc selectionMenuHidden为true + */ + it('SUB_ACE_UI_TEXT_SAFEPASTE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface004") + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface004_textInput_001")); + let button = await driver.findComponent(ON.id("UIComponentTextSafePasteInterface004_button_01")); + await Utils.sleep(500); + await textInput.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await Utils.sleep(500) + await selectAll?.click() + await Utils.sleep(500) + let cutAll: Component = await driver.findComponent(ON.text('剪切')) + await Utils.sleep(500) + await cutAll?.click() + await Utils.sleep(500); + await button.click() + await Utils.sleep(500); + await textInput.longClick() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_TEXT_SAFEPASTE_0220 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionInterfaceTest/UIComponentTextSelectionInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionInterfaceTest/UIComponentTextSelectionInterface.test.ets new file mode 100755 index 00000000..dcfcb093 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionInterfaceTest/UIComponentTextSelectionInterface.test.ets @@ -0,0 +1,553 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Driver, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentTextSelectionInterface() { + describe('UIComponentTextSelectionInterface', () => { + 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_TEXT_SELECTION_INTERFACE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0080 + * @tc.desc OnCopy() callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0080')); + await Utils.sleep(500); + await textInput.inputText('Start Test for onCopy'); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll.click(); + await Utils.sleep(500); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0090 + * @tc.desc OnCut() callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0080')); + await Utils.sleep(500); + await textInput.inputText('Start Test for onCut'); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll.click(); + await Utils.sleep(500); + let cut: Component = await driver.findComponent(ON.text('剪切')); + await cut.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0100 + * @tc.desc OnPaste() callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0080')); + await Utils.sleep(500); + await textInput.inputText('Start Test for onPaste'); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(500); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await paste?.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0110 + * @tc.desc add Search Component && OnSubmit() callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0110'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0110')); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(1000); + await driver.triggerKey(2119); + await Utils.sleep(100); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0120 + * @tc.desc Image CopyOption set to InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0120'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let image: Component = await driver.findComponent(ON.id('image0120')); + await Utils.sleep(500); + await image.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0130 + * @tc.desc Image CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let image: Component = await driver.findComponent(ON.id('image0130')); + await Utils.sleep(500); + await image.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0140 + * @tc.desc Image CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let image: Component = await driver.findComponent(ON.id('image0130')); + await Utils.sleep(500); + await image.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0150 + * @tc.desc Image CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let image: Component = await driver.findComponent(ON.id('image0130')); + await Utils.sleep(500); + await image.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0160 + * @tc.desc Image CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let image: Component = await driver.findComponent(ON.id('image0130')); + await Utils.sleep(500); + await image?.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170 + * @tc.desc Image CopyOption set to None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0170'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let image: Component = await driver.findComponent(ON.id('image0170')); + await Utils.sleep(500); + await image.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0300 + * @tc.desc TextInput CopyOption set to InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0300 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0300'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0300')); + await textInput.inputText('这是输入文字 可复制'); + await Utils.sleep(500); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0300 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0310 + * @tc.desc TextInput CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0310 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0310')); + await textInput.inputText('这是输入文字 可复制'); + await Utils.sleep(500); + await textInput?.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0310 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0320 + * @tc.desc TextInput CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0320 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0310')); + await textInput.inputText('这是输入文字 可剪切'); + await Utils.sleep(500); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0320 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0330 + * @tc.desc TextInput CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0330 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0310')); + await textInput.inputText('这是输入文字 可粘贴'); + await Utils.sleep(500); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0330 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0340 + * @tc.desc TextInput CopyOption set to None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0340 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0340'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0340')); + await textInput.inputText('这是输入文字 不可复制'); + await Utils.sleep(500); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0340 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0350 + * @tc.desc TextInput CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0350 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('textinputselection0310')); + await textInput.inputText('这是输入文字 可全选'); + await Utils.sleep(500); + await textInput.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0350 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0360 + * @tc.desc Text CopyOption set to InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0360 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0360'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('text_select_0360')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0360 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0370 + * @tc.desc Text CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0370 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0370'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('text_select_0370')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0370 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0380 + * @tc.desc Text CopyOption set to None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0380 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0380'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('text_select_0380')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0380 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0390 + * @tc.desc Text CopyOption set to LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0390 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0390'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('text_select_0390')); + await Utils.sleep(500); + await text.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(500); + await selectAll?.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0390 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0400 + * @tc.desc Text set to not singleLine + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0400 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0400'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('text_select_0400')); + await Utils.sleep(500); + await text.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(500); + await selectAll?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0400 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0410 + * @tc.desc Text set to SingLine + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0410 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0410'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('text_select_0410')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0410 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0420 + * @tc.desc Text set to SingLine + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0420 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0410'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('text_select_0410')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0420 end.`); + done(); + }) + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionMenuJingXiangTest/UIComponentTextSelectionMenuJingXiang.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionMenuJingXiangTest/UIComponentTextSelectionMenuJingXiang.test.ets new file mode 100755 index 00000000..0c5d1cf1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionMenuJingXiangTest/UIComponentTextSelectionMenuJingXiang.test.ets @@ -0,0 +1,672 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, Core } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import { i18n } from '@kit.LocalizationKit'; +import { BusinessError } from '@kit.BasicServicesKit'; + +function switchLocale(): string { + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log('Switch Locales,current appPreferredLanguage=' + appPreferredLanguage); + try { + i18n.System.setAppPreferredLanguage('ug-CN'); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2= ${appPreferredLanguage2}`); + return appPreferredLanguage2; +} + +export default function UIComponentTextSelectionMenuJingXiang() { + describe('UIComponentTextSelectionMenuJingXiang', () => { + 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_TEXT_SELECTIONMENU_JINGXIANG_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0010 + * @tc.desc SelectionMenu only set editorMenuOptions(no icon) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0010"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0010')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0010')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0020 + * @tc.desc SelectionMenu only set editorMenuOptions(1 icon) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0020"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0020')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0020')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0030 + * @tc.desc SelectionMenu only set editorMenuOptions(2 icon) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0030"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0030')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0030')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0040 + * @tc.desc SelectionMenu only set editorMenuOptions(3 icon) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0040"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0040')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0040')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0050 + * @tc.desc SelectionMenu only set editorMenuOptions(4 icon) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0050"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0050')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0050')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0050 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0060 + * @tc.desc SelectionMenu only set editorMenuOptions(5 icon) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0060"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0060')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0060')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0070 + * @tc.desc SelectionMenu only set editorMenuOptions(6 icon) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0070"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0070')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0070')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0080 + * @tc.desc SelectionMenu only set controller(undefined) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0080"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0080')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0080')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0080 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0090 + * @tc.desc SelectionMenu only set controller + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0090"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0090')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0090')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0090 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0100 + * @tc.desc SelectionMenu only set expandedMenuOptions(undefined) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0100"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0100')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0100')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049) + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0110 + * @tc.desc SelectionMenu only set expandedMenuOptions + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0110"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0110')); + let btn: Component = await driver.findComponent(ON.id('text_selectionmenu_btn_0110')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0120 + * @tc.desc SelectionMenu set RichEditorResponseType(LONG_PRESS/RIGHT_CLICK/SELECT) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0120"); + await Utils.sleep(200); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0120')); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(200); + await textInput.longClick(); + await Utils.sleep(400); + + await textInput.inputText('SelectTest'); + await Utils.sleep(100); + await driver?.drag(point.x - 100, point.y, point.x + 200, point.y, 500); + await Utils.sleep(200); + + await textInput.inputText('RightClickTest'); + await Utils.sleep(200); + let point0 = await textInput.getBoundsCenter(); + await driver.mouseClick({ + x: point0.x - 50, y: point0.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(300); + await textInput.inputText('start change locale'); + await Utils.sleep(300); + + // change locale + let changeLocaleStr = switchLocale(); + if ('ug-CN' == changeLocaleStr) { + await textInput.inputText('LongPressTest'); + await Utils.sleep(300); + let point1 = await textInput.getBounds(); + let px = point1.right - 30; + let py = point1.right + await driver.mouseDoubleClick({ + x: px, y: py + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(300); + await textInput.longClick(); + await Utils.sleep(200); + + await textInput.inputText('SelectTest'); + await Utils.sleep(100); + await driver?.drag(point0.x - 200, point0.y, point0.x + 200, point0.y, 500); + await Utils.sleep(200); + + await textInput.inputText('RightClickTest'); + await Utils.sleep(200); + let point2 = await textInput.getBoundsCenter(); + await driver.mouseClick({ + x: point2.x - 120, y: point2.y + 20 + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(200); + await windowSnap.snapShot(); + await Utils.sleep(200); + } + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0130 + * @tc.desc SelectionMenu set RichEditorSpanType(TEXT/IMAGE/MIX) -- modify非长按 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0130"); + await Utils.sleep(200); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0130')); + let point0 = await textInput.getBoundsCenter(); + await Utils.sleep(200); + await driver.triggerKey(2081); + await Utils.sleep(100); + await driver.drag(point0.x - 200, point0.y, point0.x + 200, point0.y, 500); + await Utils.sleep(400); + + await driver.triggerKey(2082); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(400); + + await driver.triggerKey(2081); + await Utils.sleep(100); + await driver.drag(point0.x - 300, point0.y, point0.x + 200, point0.y, 500); + await Utils.sleep(400); + let changeLocaleStr = switchLocale(); + if ('ug-CN' == changeLocaleStr) { + await Utils.sleep(200); + await driver.triggerKey(2081); + await Utils.sleep(100); + await driver.drag(point0.x - 100, point0.y, point0.x + 200, point0.y, 500); + await Utils.sleep(400); + + await driver.triggerKey(2082); + await Utils.sleep(100); + await driver.triggerKey(2084); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(400); + + await driver.triggerKey(2081); + await Utils.sleep(100); + await driver.drag(point0.x - 200, point0.y, point0.x + 200, point0.y, 500); + await Utils.sleep(400); + await windowSnap.snapShot(); + await Utils.sleep(300); + + } + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0160 + * @tc.desc SelectionMenu set RichEditorResponseType(LONG_PRESS/RIGHT_CLICK/SELECT) + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0160"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('text_selectionmenu_0160')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(500); + + await Settings.changeOrientation(); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(500); + await windowSnap.snapShot(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_1 + * @tc.desc SelectionMenu for TEXT Modify + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_1'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textSelectionMenuJingXiang0140_tx')); + let changeLocaleStr = switchLocale(); + if ('ug-CN' == changeLocaleStr) { + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + } + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_2 + * @tc.desc SelectionMenu for TEXTINPUT + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_2'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textSelectionMenuJingXiang0140_txInput')); + let changeLocaleStr = switchLocale(); + if ('ug-CN' == changeLocaleStr) { + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + } + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_3 + * @tc.desc SelectionMenu for TEXTAREA + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_3 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_3'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textSelectionMenuJingXiang0140_txArea')); + let changeLocaleStr = switchLocale(); + if ('ug-CN' == changeLocaleStr) { + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + } + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_3 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_4 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_4 + * @tc.desc SelectionMenu for Search + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_4 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_4'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textSelectionMenuJingXiang0140_search')); + let changeLocaleStr = switchLocale(); + if ('ug-CN' == changeLocaleStr) { + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + } + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_4 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_5 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_5 + * @tc.desc SelectionMenu for RichEdit + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_5', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_5 start.`); + Settings.createWindow('testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_5'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textSelectionMenuJingXiang0140_richEd')); + let changeLocaleStr = switchLocale(); + if ('ug-CN' == changeLocaleStr) { + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + } + Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTIONMENU_JINGXIANG_0140_5 finish.`); + done(); + }) + }) + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionOptimizationTest/UIComponentTextSelectionOptimization.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionOptimizationTest/UIComponentTextSelectionOptimization.test.ets new file mode 100755 index 00000000..5b45c9ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSelectionOptimizationTest/UIComponentTextSelectionOptimization.test.ets @@ -0,0 +1,507 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { Driver, MouseButton, ON } from '@kit.TestKit'; + +export default function UIComponentTextSelectionOptimization() { + + describe('UIComponentTextSelectionOptimization', () => { + 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_TEXT_SELECTION_OPTIMIZATION_0030_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0030_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0030_1_btn')); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + } + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0030_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0030_3_btn')); + await Utils.sleep(1000); + for (let index = 0; index < 4; index++) { + await textArea.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + } + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0030_3 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0050_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0050_1_btn')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_2 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_2") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0050_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0050_2_btn')); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0050_2 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0060_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0060_1_btn')); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + } + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0060_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0060_3_btn')); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.triggerKey(2081); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + } + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0060_3 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0070_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0070_1_btn')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0070_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0070_3_btn')); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0070_3 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0080_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0080_1_btn')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0080_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0080_3_btn')); + await Utils.sleep(1000); + // await driver.triggerKey(2082); + await textArea.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0080_3 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0090_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0090_1_btn')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0090_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0090_3_btn')); + await Utils.sleep(1000); + // await driver.triggerKey(2082); + await textArea.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await Utils.sleep(1000); + await selectAll.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0090_3 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0100_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0100_1_btn')); + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + } + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0100_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0100_3_btn')); + await Utils.sleep(500); + for (let index = 0; index < 3; index++) { + await textArea.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + } + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0100_3 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0110_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0110_1_btn')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0110_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0110_3_btn')); + await Utils.sleep(1000); + // await driver.triggerKey(2082); + await textArea.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0110_3 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_1 + * @tc.desc textInput:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_1") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textSelectionOptimization0120_txInput')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0120_1_btn')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_3 + * @tc.desc textArea:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_3") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textSelectionOptimization0120_txArea')); + let btn = await driver.findComponent(ON.id('textSelectionOptimization0120_3_btn')); + await Utils.sleep(1000); + // await driver.triggerKey(2082); + await textArea.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0120_3 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAbilityTest/UIComponentTextTextAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAbilityTest/UIComponentTextTextAbility.test.ets new file mode 100755 index 00000000..6a7715b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAbilityTest/UIComponentTextTextAbility.test.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentTextTextAbility() { + + describe('UIComponentTextTextAbility', () => { + 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_TEXT_TEXT_ABILITY_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0130 + * @tc.desc Text: onCopy() + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0130'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('textAbility0130')); + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(1500); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0150 + * @tc.desc Text: onTextSelectionChange() + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0150'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let btn: Component = await driver.findComponent(ON.id('btn_textAbility0150')); + let text: Component = await driver.findComponent(ON.id('text_textAbility0150')); + await Utils.sleep(1000); + await text?.click() + await Utils.sleep(1000); + await btn?.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0160 + * @tc.desc Text: onTextSelectionChange() --手柄Modify--use drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0150'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let btn: Component = await driver.findComponent(ON.id('btn02_textAbility015')); + let text: Component = await driver.findComponent(ON.id('text_textAbility0150')); + await Utils.sleep(1000); + await btn?.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0570 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0570 + * @tc.desc Text: ImageSpan + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0570 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0570'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('text_textAbility0570')); + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(1500); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ABILITY_0570 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextActionTest/UIComponentTextTextAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextActionTest/UIComponentTextTextAction.test.ets new file mode 100755 index 00000000..90946d9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextActionTest/UIComponentTextTextAction.test.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentTextTextAction() { + + describe('UIComponentTextTextAction', () => { + 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_TEXT_TEXT_ACTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0020 + * @tc.desc Text: drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0020'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTextAction0020_1')); + let text2 = await driver.findComponent(ON.id('textTextAction0020_2')); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0040 + * @tc.desc Text: focusable --??modify + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0040',0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0040'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textTextAction0040')); + await Utils.sleep(500); + await text.click(); + // await Utils.sleep(500); + // let isFocusable:string = await text?.isFocused()?'ok':'nok' + // expect(isFocusable).assertEqual('ok'); + await Utils.sleep(500) + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0050 + * @tc.desc Text:ParagraphGraph + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0050 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0050'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let btn: Component = await driver.findComponent(ON.id('textTextAction0050_btn')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0050 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0100 + * @tc.desc TEXT:test TextOverflow。MARQUEE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0100'); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let btn: Component = await driver.findComponent(ON.id('textTextAction0100_btn')); + await Utils.sleep(500); + await btn?.click(); + await Utils.sleep(500); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0110 + * @tc.desc TEXT:test textShadow + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0110'); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0180 + * @tc.desc SaveButton + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0180',0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0180 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0180'); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let save_btn1: Component = await driver.findComponent(ON.id('textTextAction0180_btn1')); + let save_btn2: Component = await driver.findComponent(ON.id('textTextAction0180_btn2')); + let save_btn3: Component = await driver.findComponent(ON.id('textTextAction0180_btn3')); + await Utils.sleep(300); + await save_btn1?.click(); + await Utils.sleep(300); + let allowBtn: Component = await driver.findComponent(ON.text('允许')); + await Utils.sleep(700); + await allowBtn?.click(); + await Utils.sleep(1300); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_ACTION_0180 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextCustomMenuTest/UIComponentTextTextCustomMenu.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextCustomMenuTest/UIComponentTextTextCustomMenu.test.ets new file mode 100755 index 00000000..e8a69d45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextCustomMenuTest/UIComponentTextTextCustomMenu.test.ets @@ -0,0 +1,598 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { Driver, MouseButton, ON } from '@kit.TestKit'; +import { Component } from '@ohos.UiTest'; + +export default function UIComponentTextTextCustomMenu() { + + describe('UIComponentTextTextCustomMenu', () => { + 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_TEXT_TEXT_CUSTOMMENU_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0010 + * @tc.desc TextResponseType.LONG_PRESS + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0010"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0010_text')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0020 + * @tc.desc TextResponseType.RIGHT_CLICK + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0020"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0020_text')); + await Utils.sleep(500); + let point0 = await text.getBoundsCenter(); + await driver.mouseClick({ + x: point0.x, y: point0.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0030 + * @tc.desc TextResponseType.SELECT + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0030"); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0030_text')); + await Utils.sleep(500); + text.click(); + await Utils.sleep(500); + let point = await text.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x + 200, y: point.y + }, { + x: point.x - 200, y: point.y + }, 500); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0040 + * @tc.desc TextSpanType.IMAGE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0040"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0040_text')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0050 + * @tc.desc TextSpanType.MIX + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0050"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0050_text')); + let point0 = text.getBounds(); + await driver.drag(0, (await point0).top, (await point0).right - 200, (await point0).top, 500); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0050 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0060 + * @tc.desc TextSpanType.TEXT + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0060"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0060_text')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0070 + * @tc.desc CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0070"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0070_text')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0080 + * @tc.desc CopyOptions.InApp ,text no span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0080"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0080_text')); + await Utils.sleep(500); + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0080 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090 + * @tc.desc CopyOptions.InApp ,change TextSpanType.IMAGE + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0090"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0090_text')); + let btn: Component = await driver.findComponent(ON.id('textCustomMenu0090_btn')); + await Utils.sleep(200); + await driver.triggerKey(2081); + await Utils.sleep(100); + let point = await text.getBounds(); + await driver.drag(0, point.top + 50, point.left + 100, point.top + 50, 500); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090_1'); + await Utils.sleep(300); + + await driver.triggerKey(2082); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090_2'); + await Utils.sleep(300); + + await btn.click(); + await Utils.sleep(500); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090_3'); + await Utils.sleep(500); + + await driver.triggerKey(2082); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(400); + await windowSnap.snapShot(); //SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090_4 + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0100 + * @tc.desc CopyOptions.InApp ,change TextResponseType.SELECT + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0100"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0100_text')); + let btn: Component = await driver.findComponent(ON.id('textCustomMenu0100_btn')); + await Utils.sleep(200); + await text.longClick(); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0100_1'); + await Utils.sleep(300); + + await btn.click(); + await Utils.sleep(1000); + let point = await text.getBoundsCenter(); + // await driver.mouseDrag({x:50, y:point.top+20}, {x:point.right/3, y:point.top+20}, 400); + await driver.drag(point.x - 200, point.y, point.x + 200, point.y, 400); + await Utils.sleep(400); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110 + * @tc.desc customMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0110"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0110_text')); + let point0 = await text.getBounds(); + let right = point0.right; + let bottom = point0.bottom; + await Utils.sleep(200); + await driver.triggerKey(2081); + await Utils.sleep(100); + await driver.drag(0, bottom, right / 4, bottom, 500); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110_1'); + await Utils.sleep(300); + + await driver.triggerKey(2082); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110_2'); + await Utils.sleep(300); + + await driver.triggerKey(2081); + await Utils.sleep(100); + await driver.drag(0, bottom, right / 2, bottom, 500); + await Utils.sleep(400); + await windowSnap.snapShot(); //SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110_3 + await Utils.sleep(300); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0120 + * @tc.desc Text content is undefined + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0120"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0120_text')); + await Utils.sleep(200); + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0130 + * @tc.desc Text bind mutil custom menu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0130"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0130_text')); + await Utils.sleep(200); + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0140 + * @tc.desc Text:selectionMenu onAppear + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0140"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0140_text')); + await Utils.sleep(200); + await text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0150 + * @tc.desc Text:selectionMenu onDisappear + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0150"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0150_text')); + await Utils.sleep(200); + await text.longClick(); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0150_1'); + await Utils.sleep(300); + + await text.click(); + await Utils.sleep(400); + await windowSnap.snapShot(); //SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0150_2 + await Utils.sleep(300); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0160 + * @tc.desc Text: selectionMenu onAppear && onDisappear + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0160"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0160_text')); + let text2: Component = await driver.findComponent(ON.id('textCustomMenu0160_text2')); + await Utils.sleep(200); + await text.longClick(); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0160_1'); + await Utils.sleep(300); + + await text2.click(); + await Utils.sleep(500); + await text2.inputText('TextCustomMenu onDisappear>>'); + await Utils.sleep(1500); + await windowSnap.snapShot(); //SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0160_2 + await Utils.sleep(300); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170 + * @tc.desc Text: onTextSelectionChange,case:TextResponseType.LONG_PRESS + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0170"); + await Utils.sleep(500); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170_1'); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0170_text')); + await Utils.sleep(200); + await text.longClick(); + await Utils.sleep(400); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170_2'); + await Utils.sleep(300); + + let point0 = text.getBounds(); + await driver.drag((await point0).left, (await point0).top, (await point0).right - 200, (await point0).top, 500); + await Utils.sleep(500); + await windowSnap.snapShot(); //SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170_3 + await Utils.sleep(300); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0180 + * @tc.desc Text: onTextSelectionChange,case:TextResponseType.RIGHT_CLICK + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0180"); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0180_text')); + await Utils.sleep(300); + let point0 = await text.getBounds(); + await driver.mouseClick({ + x: point0.right - 200, y: point0.top + }, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0180 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0190 + * @tc.desc Text: onTextSelectionChange,case: TextResponseType.SELECT + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0190 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0190"); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0190_text')); + await Utils.sleep(300); + let point0 = await text.getBounds(); + await driver.drag(point0.left, point0.top, point0.right - 200, point0.top, 500); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0200 + * @tc.desc Text: onTextSelectionChange,case: CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0200"); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0200_text')); + await Utils.sleep(300); + let point0 = await text.getBounds(); + await driver.drag(point0.left, point0.top, point0.right - 200, point0.top, 500); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0200 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0210 + * @tc.desc Text: closeSelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0210 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0210"); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0210_text')); + await Utils.sleep(300); + await text.longClick(); + await Utils.sleep(500); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0210_1'); + await Utils.sleep(300); + + let textMenu1: Component = await driver.findComponent(ON.text('TextMenu1')); + await textMenu1.click(); + await Utils.sleep(600); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0210_2'); + await Utils.sleep(300); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0210 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220 + * @tc.desc Text: closeSelectionMenu,case: two TEXT use one Controller + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0220"); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let text1: Component = await driver.findComponent(ON.id('textCustomMenu0220_text1')); + + await Utils.sleep(300); + await text1.longClick(); + await Utils.sleep(300); + let textMenu1: Component = await driver.findComponent(ON.text('TextMenu1')); + await textMenu1.click(); + await Utils.sleep(600); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220_1'); + + await Utils.sleep(300); + let text2: Component = await driver.findComponent(ON.id('textCustomMenu0220_text2')); + await Utils.sleep(300); + await text2.click(); + await Utils.sleep(500); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220_2'); + await Utils.sleep(300); + + await text2.longClick(); + await Utils.sleep(500); + let textMenu2: Component = await driver.findComponent(ON.text('ImageMenu1')); + await textMenu2.click(); + await Utils.sleep(600); + await windowSnap.snapShot(); //SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220_3 + await Utils.sleep(300); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0220 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0230 + * @tc.desc Text: onTextSelectionChange,case: MOUSE_BUTTON_LEFT + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0230"); + await Utils.sleep(300); + let driver: Driver = Driver.create(); + let text: Component = await driver.findComponent(ON.id('textCustomMenu0230_text')); + await Utils.sleep(300); + let point = await text.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_CUSTOMMENU_0230 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputCursorTest/UIComponentTextTextInputCursor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputCursorTest/UIComponentTextTextInputCursor.test.ets new file mode 100755 index 00000000..a13cde4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputCursorTest/UIComponentTextTextInputCursor.test.ets @@ -0,0 +1,3556 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { Driver, MouseButton, ON } from '@kit.TestKit'; + +export default function UIComponentTextTextInputCursor() { + + describe('UIComponentTextTextInputCursor', () => { + 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_TEXT_TEXTINPUT_CURSOR_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0010 + * @tc.desc search: selectionMenuHidden[default] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0010"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0010')); + await Utils.sleep(500); + await search.longClick() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0020 + * @tc.desc search: selectionMenuHidden[default] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0010"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0010')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0030 + * @tc.desc search: stopEditing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0030"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0030')); + let btn = await driver.findComponent(ON.id('textInputCursor0030_btn')); + await Utils.sleep(500); + await search.click(); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0040 + * @tc.desc search: selectionMenuHidden[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0040"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0040')); + await search.click() + await Utils.sleep(500); + await search.longClick() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0050 + * @tc.desc search: selectionMenuHidden[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0040"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0040')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0050 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0060 + * @tc.desc search: selectionMenuHidden[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0060"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0060')); + await search.longClick() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0070 + * @tc.desc search: selectionMenuHidden[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0060"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0060')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0080 + * @tc.desc search: defaultFocus[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0080"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0080 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0090 + * @tc.desc search: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0090"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0090')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0090 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0100 + * @tc.desc search: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0090"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0090')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0110 + * @tc.desc search: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0110"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0110')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + // await search.click(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 10 + }, { + x: point.x, y: point.y + 10 + }, 500) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0120 + * @tc.desc search: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0110"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0110')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0130 + * @tc.desc search: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0130')); + await Utils.sleep(500); + await search.click(); + await Utils.sleep(500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0140 + * @tc.desc search: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0130')); + await Utils.sleep(500); + await search.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0150 + * @tc.desc search: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0150')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 10 + }, { + x: point.x, y: point.y + 10 + }, 500) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0160 + * @tc.desc search: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0150')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0170 + * @tc.desc search: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130"); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0180 + * @tc.desc search: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0180')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 10 + }, { + x: point.x, y: point.y + 10 + }, 500) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0180 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0190 + * @tc.desc search: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0190 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0190')); + await Utils.sleep(500); + await search.click(); + await Utils.sleep(500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0200 + * @tc.desc search: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0190')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0200 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0210 + * @tc.desc search: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0210 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0210')); + await Utils.sleep(500); + await search.click(); + await Utils.sleep(500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0210 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0220 + * @tc.desc search: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0210')); + await Utils.sleep(500); + await search.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0220 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0230 + * @tc.desc search: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0230"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0230')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 10 + }, { + x: point.x, y: point.y + 10 + }, 500) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0240 + * @tc.desc search: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0230"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0230')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0240 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0250 + * @tc.desc search: onContentScroll + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0250"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0250')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0250 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0260 + * @tc.desc search: onTextSelectionChange[caretStyle({width:50})] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0260"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0260')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(1500); + let selectAll = await driver.findComponent(ON.text('全选')); + await Utils.sleep(1500); + selectAll?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0260 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0270 + * @tc.desc search: onTextSelectionChange[CopyOptions.InApp] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0270 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0270"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0270')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + 10 + }, { + x: point.x + 300, y: point.y + 10 + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0270 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0280 + * @tc.desc search: onTextSelectionChange[CopyOptions.LocalDevice] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0280 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0280"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0280')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0280 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0290 + * @tc.desc search: onTextSelectionChange[CopyOptions.None] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0290 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0290"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0290')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0290 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0300 + * @tc.desc search: TextAlign.Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0300"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0300 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0310 + * @tc.desc search: TextAlign.Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0310 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0300"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0300')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0310 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0320 + * @tc.desc search: TextAlign.END + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0320 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0320"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0320 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0330 + * @tc.desc search: TextAlign.END + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0330 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0320"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0320')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0330 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0340 + * @tc.desc search: TextAlign.JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0340 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0340"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0340 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0350 + * @tc.desc search: TextAlign.JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0340"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0340')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0360 + * @tc.desc search: TextAlign.Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0360 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0360"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0360')); + await Utils.sleep(500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0360 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0370 + * @tc.desc search: TextAlign.Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0370 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0360"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0370 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0380 + * @tc.desc search: cursor on first position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0380 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(1500); + await driver.triggerKey(2081); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0380 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0390 + * @tc.desc search: cursor on any position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0390 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0390 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0400 + * @tc.desc search: cursor position[cut] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0400 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(1500); + let cut = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(1500); + await cut?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0400 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0410 + * @tc.desc search: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0410 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(500); + await search.longClick(); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0410 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0420 + * @tc.desc search: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0420 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0420 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0430 + * @tc.desc search: cursor on first position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0430 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(1500); + await driver.triggerKey(2081); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0430 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0440 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0440 + * @tc.desc search: cursor on any position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0440 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0440 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0450 + * @tc.desc search: stopEditing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0450 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0450"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0450')); + let btn = await driver.findComponent(ON.id('textInputCursor0450_btn')); + await Utils.sleep(1500); + search.click() + await Utils.sleep(1000); + btn.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0450 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0460 + * @tc.desc search: setTextSelection + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0460 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0460"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0460')); + await Utils.sleep(1500); + await search.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0460 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0470 + * @tc.desc search: SearchType.EMAIL + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0470 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0470"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0470')); + await Utils.sleep(1500); + await search.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0470 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0480 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0480 + * @tc.desc search: SearchType.NORMAL + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0480 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0480"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0480')); + await Utils.sleep(1500); + await search.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0480 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0490 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0490 + * @tc.desc search: SearchType.NUMBER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0490 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0490"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0490')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(500); + let selectAll = await driver.findComponent(ON.text('全选')); + await Utils.sleep(1500); + selectAll?.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0490 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0510 + * @tc.desc search: SearchType.PHONE_NUMBER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0510 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0510"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0510')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(500); + let selectAll = await driver.findComponent(ON.text('全选')); + await Utils.sleep(1500); + selectAll?.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0510 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0520 + * @tc.desc search: caretPosition + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0520 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0520"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0520')); + await Utils.sleep(1500); + await search.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0520 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0530 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0530 + * @tc.desc search: cursor position[cut] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0530 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(500); + await search.longClick(); + await Utils.sleep(1500); + let cut = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(1500); + await cut?.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0530 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0540 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0540 + * @tc.desc search: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0540 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + await search.longClick(); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0540 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0550 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0550 + * @tc.desc search: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0550 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + let point = await search.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0550 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0560 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0560 + * @tc.desc search: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0560 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let search = await driver.findComponent(ON.id('textInputCursor0380')); + await Utils.sleep(1500); + await search.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await Utils.sleep(1500); + selectAll?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0560 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0570 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0570 + * @tc.desc TextArea: selectionMenuHidden[default] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0570 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0570"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0570')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0570 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0580 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0580 + * @tc.desc TextArea: selectionMenuHidden[default] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0580 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0570"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0570')); + await Utils.sleep(1500); + let point = await textArea.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0580 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0590 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0590 + * @tc.desc TextArea: selectionMenuHidden[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0590 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0590"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0590')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0590 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0600 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0600 + * @tc.desc TextArea: selectionMenuHidden[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0600 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0590"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0590')); + await Utils.sleep(1500); + let point = await textArea.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0600 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0610 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0610 + * @tc.desc TextArea: selectionMenuHidden[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0610 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0610"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0610')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0610 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0620 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0620 + * @tc.desc TextArea: selectionMenuHidden[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0620 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0610"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0610')); + await Utils.sleep(1500); + let point = await textArea.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0620 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0630 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0630 + * @tc.desc TextArea: stopEditing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0630 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0630"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0630')); + let btn = await driver.findComponent(ON.id('textInputCursor0630_btn')); + await Utils.sleep(1500); + textArea.click() + await Utils.sleep(1500); + btn.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0630 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0640 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0640 + * @tc.desc TextArea: defaultFocus[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0640 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0640"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0640 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0650 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0650 + * @tc.desc TextArea: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0650 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0650"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0650')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0650 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0660 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0660 + * @tc.desc TextArea: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0660 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0650"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0650')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0660 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0670 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0670 + * @tc.desc TextArea: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0670 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0670"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0670')); + await Utils.sleep(1500); + let point = await textArea.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 10 + }, { + x: point.x, y: point.y + 10 + }, 500) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0670 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0680 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0680 + * @tc.desc TextArea: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0680 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0670"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0670')); + await Utils.sleep(500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0680 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0690 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0690 + * @tc.desc TextArea: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0690 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0690"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0690')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0690 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0700 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0700 + * @tc.desc TextArea: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0700 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0690"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0690')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0700 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0710 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0710 + * @tc.desc TextArea: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0710 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0710"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0710')); + await Utils.sleep(1500); + let point = await textArea.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 10 + }, { + x: point.x, y: point.y + 10 + }, 500) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0710 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0720 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0720 + * @tc.desc TextArea: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0720 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0710"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0710')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0720 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0730 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0730 + * @tc.desc TextArea: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0730 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0730"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0730')); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0730 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0740 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0740 + * @tc.desc TextArea: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0740 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0730"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0730')); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0740 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0750 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0750 + * @tc.desc TextArea: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0750 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0750"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0750')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0750 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0760 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0760 + * @tc.desc TextArea: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0760 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0750"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0750')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0760 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0770 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0770 + * @tc.desc TextArea: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0770 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0770"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0770')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0770 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0780 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0780 + * @tc.desc TextArea: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0780', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0780 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0770"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0770')); + await Utils.sleep(500); + await textArea.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0780 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0790 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0790 + * @tc.desc TextArea: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0790 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0790"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0790')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0790 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0800 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0800 + * @tc.desc TextArea: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0790 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0790"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0790')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0800 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0810 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0810 + * @tc.desc TextArea: onContentScroll + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0810 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0810"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0810')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0810 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0820 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0820 + * @tc.desc TextArea: caretStyle + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0820 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0820"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0820')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0820 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0830 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0830 + * @tc.desc TextArea: CopyOptions.InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0830', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0830 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0830"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0830')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0830 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0840 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0840 + * @tc.desc TextArea: CopyOptions.LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0840', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0810 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0840"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0840')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0840 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0850 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0850 + * @tc.desc TextArea: CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0850', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0850 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0850"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0850')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0850 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0860 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0860 + * @tc.desc TextArea: TextAlign.Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0860', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0860 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0860"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0860 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0870 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0870 + * @tc.desc TextArea: TextAlign.Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0870', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0870 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0860"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0860')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0870 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0880 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0880 + * @tc.desc TextArea: TextAlign.End + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0880', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0880 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0880"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0880 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0890 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0890 + * @tc.desc TextArea: TextAlign.End + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0890 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0880"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0880')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0890 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0900 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0900 + * @tc.desc TextArea: TextAlign.JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0900 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0900"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0900 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0910 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0910 + * @tc.desc TextArea: TextAlign.JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0910', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0910 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0900"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0900')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0910 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0920 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0920 + * @tc.desc TextArea: TextAlign.Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0920 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0920"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0920')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0920 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0930 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0930 + * @tc.desc TextArea: TextAlign.Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0930 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0920"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0930 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0940 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0940 + * @tc.desc TextArea: cursor on first position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0430 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await driver.triggerKey(2081); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0940 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0950 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0950 + * @tc.desc TextArea: cursor on default position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0950 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1500); + await textArea.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0950 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0960 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0960 + * @tc.desc TextArea: cursor position with cut + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0960 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(1500); + let cut = await driver.findComponent(ON.text('剪切')); + await cut?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0960 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0970 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0970 + * @tc.desc TextArea: cursor position with change select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0970', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0970 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(1500); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0970 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0980 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0980 + * @tc.desc TextArea: cursor position with select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0980 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0980 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0990 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0990 + * @tc.desc TextArea: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0990', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0990 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0990"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0990')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_0990 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1000 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1000 + * @tc.desc TextArea: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1000 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0990"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0990')); + await Utils.sleep(1500); + await textArea.inputText('start test SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1000') + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1000 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1010 + * @tc.desc TextArea: stopEditing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1010"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1010')); + let btn = await driver.findComponent(ON.id('textInputCursor1010_btn')); + await Utils.sleep(1000); + await textArea.inputText('start test SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1010') + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1500); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1020 + * @tc.desc TextArea: setTextSelection + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1020 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1020')); + let btn = await driver.findComponent(ON.id('textInputCursor1020_btn')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1030 + * @tc.desc TextArea: TextAreaType.EMAIL + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1030"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1030')); + let btn = await driver.findComponent(ON.id('textInputCursor1030_btn')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1040 + * @tc.desc TextArea: TextAreaType.NORMAL + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1040"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1040')); + let btn = await driver.findComponent(ON.id('textInputCursor1040_btn')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1050 + * @tc.desc TextArea: TextAreaType.NUMBER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1050 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1050"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1050')); + let btn = await driver.findComponent(ON.id('textInputCursor1050_btn')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1050 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1070 + * @tc.desc TextArea: TextAreaType.PHONE_NUMBER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1070 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1060"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1060')); + let btn = await driver.findComponent(ON.id('textInputCursor1060_btn')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(1500); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1080 + * @tc.desc TextArea: caretPosition + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1080 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1080"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1080')); + await Utils.sleep(1500); + await textArea.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1080 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1090 + * @tc.desc TextArea: cursor position with cut + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1090 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(1500); + let cut = await driver.findComponent(ON.text('剪切')); + await cut?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1100 + * @tc.desc TextArea: cursor position with change select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1100 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1110 + * @tc.desc TextArea: cursor position with select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1110 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(1500); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1120 + * @tc.desc TextArea: cursor position with all select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1120 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor0940')); + await Utils.sleep(500); + await textArea.longClick(); + await Utils.sleep(500); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1130 + * @tc.desc TextInput: selectionMenuHidden[default] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1130')); + await Utils.sleep(1000); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(1500); + await driver.doubleClick(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1140 + * @tc.desc TextInput: selectionMenuHidden[default] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1140 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1130')); + await Utils.sleep(1000); + let point = await textInput.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1150 + * @tc.desc TextInput: selectionMenuHidden[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1150')); + await Utils.sleep(1000); + await textInput.click(); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(1500); + await driver.doubleClick(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1160 + * @tc.desc TextInput: selectionMenuHidden[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1160 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1150')); + await Utils.sleep(1500); + let point = await textInput.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1170 + * @tc.desc TextInput: selectionMenuHidden[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1170 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1170')); + await Utils.sleep(1000); + await textInput.click(); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(1500); + await driver.doubleClick(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1180 + * @tc.desc TextInput: selectionMenuHidden[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1180 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1170')); + await Utils.sleep(1500); + let point = await textInput.getBoundsCenter(); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT, 2622); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1180 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1190 + * @tc.desc TextInput: stopEditing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1190 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1190')); + let btn = await driver.findComponent(ON.id('textInputCursor1190_btn')); + await Utils.sleep(1500); + textInput.click() + await Utils.sleep(1000); + btn.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1200 + * @tc.desc TextInput: defaultFocus[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1200 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1200"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1200 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1210 + * @tc.desc TextInput: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1210 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1210')); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1210 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1220 + * @tc.desc TextInput: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1220 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1220')); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1220 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1230 + * @tc.desc TextInput: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1230 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1220')); + await Utils.sleep(1500); + let point = await textInput.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 10 + }, { + x: point.x, y: point.y + 10 + }, 500) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1240 + * @tc.desc TextInput: enabled[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1240 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1220')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(1500); + await textInput.doubleClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1240 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1250 + * @tc.desc TextInput: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1250 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1250"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1250')); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1250 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1260 + * @tc.desc TextInput: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1260 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1260')); + await Utils.sleep(1500); + await textInput.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1260 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1270 + * @tc.desc TextInput: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1270 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1260')); + await Utils.sleep(500); + let point = await textInput.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x / 2, y: point.y + 6 + }, { + x: point.x, y: point.y + 6 + }, 500) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1270 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1280 + * @tc.desc TextInput: focusable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1280 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1260')); + await Utils.sleep(1500); + await textInput.doubleClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1280 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1290 + * @tc.desc TextInput: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1290 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1290"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1290')); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1290 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1300 + * @tc.desc TextInput: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1300 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1290"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1290')); + await Utils.sleep(1500); + textInput.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1300 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1310 + * @tc.desc TextInput: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1310 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1310"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1310')); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1310 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1320 + * @tc.desc TextInput: focusable[true] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1320 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1310"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1310')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1320 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1330 + * @tc.desc TextInput: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1330 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1330"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1330')); + await Utils.sleep(1500); + await textInput.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1330 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1340 + * @tc.desc TextInput: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1340 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1340')); + await Utils.sleep(1500); + await textInput.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1340 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1350 + * @tc.desc TextInput: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1350 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1340')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1360 + * @tc.desc TextInput: touchable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1360 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1340')); + await Utils.sleep(1500); + await textInput.doubleClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1360 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1370 + * @tc.desc TextInput: onContentScroll + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1370 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1370"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1370')); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1500); + await driver.triggerKey(2082); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1370 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1380 + * @tc.desc TextInput: caretStyle + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1380 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1380"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1380')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1380 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1390 + * @tc.desc TextInput: CopyOptions.InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1390 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1390"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1390')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1390 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1400 + * @tc.desc TextInput: CopyOptions.LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1400 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1400"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1400')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1400 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1410 + * @tc.desc TextInput: CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1410 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1410"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1410')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1410 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1420 + * @tc.desc TextInput: TextAlign.Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1420 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1420"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1420 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1430 + * @tc.desc TextInput: TextAlign.Center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1430 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1420"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1420')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1430 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1440 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1440 + * @tc.desc TextInput: TextAlign.End + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1440 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1440"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1440 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1450 + * @tc.desc TextInput: TextAlign.End + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1450 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1440"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1440')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1450 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1460 + * @tc.desc TextInput: TextAlign.JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1460 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1460"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1460 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1470 + * @tc.desc TextInput: TextAlign.JUSTIFY + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1470 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1460"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1460')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1470 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1480 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1480 + * @tc.desc TextInput: TextAlign.Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1480 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1480"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1480')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1480 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1490 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1490 + * @tc.desc TextInput: TextAlign.Start + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1490 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1480"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1490 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1500 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1500 + * @tc.desc TextInput: cursor on first position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1500 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1500')); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1500); + await driver.triggerKey(2081); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1500 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1510 + * @tc.desc TextInput: cursor on default position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1510 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1500')); + await Utils.sleep(1000); + await textInput.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1510 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1520 + * @tc.desc TextInput: cursor position with cut + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1520 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1500')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(1500); + let cut = await driver.findComponent(ON.text('剪切')); + await cut?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1520 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1530 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1530 + * @tc.desc TextInput: cursor position with change select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1530 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1500')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 200, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1530 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1540 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1540 + * @tc.desc TextInput: cursor position with select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1540 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1500')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1540 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1550 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1550 + * @tc.desc TextInput: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1550 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1550"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1550')); + await Utils.sleep(1500); + await textInput.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1550 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1560 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1560 + * @tc.desc TextInput: cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1560 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1550"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1550')); + await Utils.sleep(1000); + await textInput.inputText('start test SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1560') + await Utils.sleep(1500); + await textInput.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1560 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1570 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1570 + * @tc.desc TextInput: stopEditing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1570 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1570"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1570')); + let btn = await driver.findComponent(ON.id('textInputCursor1570_btn')); + await Utils.sleep(1000); + await textInput.inputText('start test SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1570') + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1000); + await textInput.doubleClick(); + await Utils.sleep(1500); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1570 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1580 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1580 + * @tc.desc TextInput: setTextSelection + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1580 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1580"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1580')); + let btn = await driver.findComponent(ON.id('textInputCursor1580_btn')); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1580 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1590 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1590 + * @tc.desc TextInput: InputType.EMAIL + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1590 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1590"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1590')); + let btn = await driver.findComponent(ON.id('textInputCursor1030_btn')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1590 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1600 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1600 + * @tc.desc TextInput: InputType.NORMAL + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1600 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1600"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1600')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1600 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1610 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1610 + * @tc.desc TextInput: InputType.NUMBER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1610 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1610"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1610')); + let btn = await driver.findComponent(ON.id('textInputCursor1610_btn')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1610 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1620 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1620 + * @tc.desc TextInput: InputType.Password + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1620 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1620"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1620')); + await Utils.sleep(1000); + await textInput.inputText('bfiuasfhkjlafkj') + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1620 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1630 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1630 + * @tc.desc TextInput: InputType.PHONE_NUMBER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1630 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1630"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1630')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1630 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1640 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1640 + * @tc.desc TextInput: InputType.PHONE_NUMBER + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1640 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1640')); + await Utils.sleep(1500); + await textInput.click(); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1640 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1650 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1650 + * @tc.desc TextInput: cursor position with cut + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1090 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1640')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1500); + let cut = await driver.findComponent(ON.text('剪切')); + await cut?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1650 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1100 + * @tc.desc TextInput: cursor position with change select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1660 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1640')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.x - 100, y: point.y + }, { + x: point.x + 300, y: point.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1660 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1670 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1670 + * @tc.desc TextInput: cursor position with select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1670 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1640')); + await Utils.sleep(1500); + await textInput.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1670 finis94h.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1680 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1680 + * @tc.desc TextInput: cursor position with select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1680 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1640')); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1500); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1680 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1690 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1690 + * @tc.desc TextArea/TextInput/Search:todo scroll&select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1690 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1690_txArea')); + let textInput = await driver.findComponent(ON.id('textInputCursor1690_txInput')); + let search = await driver.findComponent(ON.id('textInputCursor1690_search')); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2054); + await Utils.sleep(1500); + await search.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await driver.triggerKey(2049); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1690 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1700 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1700 + * @tc.desc TextArea/TextInput/Search:todo mouseClick + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1700 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textArea = await driver.findComponent(ON.id('textInputCursor1690_txArea')); + let textInput = await driver.findComponent(ON.id('textInputCursor1690_txInput')); + let search = await driver.findComponent(ON.id('textInputCursor1690_search')); + let taPoint = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await driver.mouseDrag({ + x: taPoint.x - 100, y: taPoint.y + }, { + x: taPoint.x + 300, y: taPoint.y + }, 500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await driver.triggerKey(2049); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1700 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1720 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1720 + * @tc.desc Search:todo requestFocus + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1720 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + focusControl.requestFocus('textInputCursor1690_search'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1720 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1730 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1730 + * @tc.desc TextArea:todo requestFocus + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1730 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690"); + await Utils.sleep(1000); + focusControl.requestFocus('textInputCursor1690_txArea'); + await Utils.sleep(1000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1730 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1740 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1740 + * @tc.desc TextInput:todo requestFocus + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1740 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690"); + await Utils.sleep(1000); + focusControl.requestFocus('textInputCursor1690_txInput'); + await Utils.sleep(1000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1740 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1750 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1750 + * @tc.desc TextInput:change drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1750 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1750"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput = await driver.findComponent(ON.id('textInputCursor1750_txInput')); + let button = await driver.findComponent(ON.id('textInputCursor1750_button')); + await Utils.sleep(500); + await textInput.longClick() + await Utils.sleep(500); + let selectAll = await driver.findComponent(ON.text('全选')); + await Utils.sleep(500); + await selectAll.click() + await Utils.sleep(1000); + await textInput.dragTo(textInput) + await Utils.sleep(1000); + await button.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_CURSOR_1750 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputKeepEditableStateTest/UIComponentTextTextInputKeepEditableState.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputKeepEditableStateTest/UIComponentTextTextInputKeepEditableState.test.ets new file mode 100755 index 00000000..86ed8dfb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInputKeepEditableStateTest/UIComponentTextTextInputKeepEditableState.test.ets @@ -0,0 +1,477 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { Driver, ON, Component } from '@ohos.UiTest'; + +export default function UIComponentTextTextInputKeepEditableState() { + + describe('UIComponentTextTextInputKeepEditableState', () => { + 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_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0010 + * @tc.desc TextInput:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0010'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0010')); + await Utils.sleep(500); + await textInput.inputText('TextInput:test keepEditableState'); + await Utils.sleep(1000); + await driver.triggerKey(2119); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0030 + * @tc.desc TextInput:text,keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0030'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0030')); + await Utils.sleep(500); + await textInput.inputText('TextInput:test text'); + await Utils.sleep(1000); + await driver.triggerKey(2119); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0040 + * @tc.desc TextInput:no keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0040'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0040')); + await Utils.sleep(500); + await textInput.inputText('TextInput:test no keepEditableState'); + await Utils.sleep(1000); + await driver.triggerKey(2119); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0060 + * @tc.desc TextInput:keepEditableState,inputtype=Normal + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0060'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0060')); + await Utils.sleep(500); + await textInput.inputText('TextInput: keepEditableState'); + for (let index = 0; index < 7; index++) { + await Utils.sleep(500); + await driver.triggerKey(2119); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0070 + * @tc.desc TextInput:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0070')); + await Utils.sleep(500); + await textInput.inputText('TextInput: keepEditableState'); + for (let index = 0; index < 7; index++) { + await Utils.sleep(500); + await driver.triggerKey(2119); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0080 + * @tc.desc TextInput:keepEditableState inputtype=Normal + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0100')); + await Utils.sleep(500); + await textInput.inputText('TextInput:test keepEditableState'); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(2054); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0090 + * @tc.desc TextInput:TextInputStyle.Inline + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0070')); + await Utils.sleep(500); + await textInput.inputText('TextInput: keepEditableState'); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(500); + for (let index = 0; index < 7; index++) { + await Utils.sleep(500); + await driver.triggerKey(2119); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0100 + * @tc.desc TextInput:keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0010'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0010')); + await Utils.sleep(500); + await textInput.inputText('TextInput:test keepEditableState'); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(1000); + await driver.triggerKey(2054); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0110 + * @tc.desc TextInput:TextInputStyle.Inline + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0070')); + await Utils.sleep(500); + await textInput.inputText('TextInput:test TextInputStyle.Inline'); + await Utils.sleep(500); + for (let index = 0; index < 7; index++) { + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await driver.triggerKey(2119); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0120 + * @tc.desc TextInput:no keepEditableState,inputtype=Normal + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0120'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0120')); + for (let index = 0; index < 6; index++) { + await Utils.sleep(500); + await driver.triggerKey(2119); + await Utils.sleep(500); + await textInput.click(); + } + await Utils.sleep(500); + await driver.triggerKey(2119); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0130 + * @tc.desc TextInput:no keepEditableState,TextInputStyle.Inline + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0130')); + for (let index = 0; index < 6; index++) { + await Utils.sleep(500); + await driver.triggerKey(2119); + await Utils.sleep(500); + await textInput.click(); + } + await Utils.sleep(500); + await driver.triggerKey(2119); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0140 + * @tc.desc TextInput:no keepEditableState,InputType.Normal + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0140'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0140')); + await Utils.sleep(500); + await textInput.inputText('TextInput:no keepEditableState,InputType.Normal'); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(1000); + await driver.triggerKey(2054); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0150 + * @tc.desc TextInput:no keepEditableState,TextInputStyle.Inline + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0130')); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(500); + for (let index = 0; index < 6; index++) { + await Utils.sleep(500); + await driver.triggerKey(2054); + await Utils.sleep(500); + await textInput.longClick(); + } + await Utils.sleep(500); + await driver.triggerKey(2054); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0160 + * @tc.desc TextInput:no keepEditableState + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0040'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0040')); + await Utils.sleep(500); + await textInput.inputText('TextInput:test no keepEditableState'); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await driver.triggerKey(2054); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0170 + * @tc.desc TextInput:no keepEditableState,TextInputStyle.Inline + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0170 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('textInputKeepEditableState0130')); + await textInput.inputText('TextInput:no keepEditableState') + await Utils.sleep(500); + for (let index = 0; index < 7; index++) { + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await driver.triggerKey(2054); + } + await Utils.sleep(1000); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0170'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0170 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0180 + * @tc.desc TextInput:mutil textInputText + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0180 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0180'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('textInputKeepEditableState0180_1')); + let textInput2: Component = await driver.findComponent(ON.id('textInputKeepEditableState0180_2')); + await Utils.sleep(500); + await textInput1.click(); + await textInput1.inputText('TextInput:has keepEditableState') + await Utils.sleep(500); + await driver.triggerKey(2119); + await Utils.sleep(1000); + + await textInput2.click(); + await textInput2.inputText('TextInput:no keepEditableState') + await Utils.sleep(500); + await driver.triggerKey(2119); + await Utils.sleep(1000); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0180'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0180 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0200 + * @tc.desc TextInput:mutil textInputText + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0200 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0020'); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('textInputKeepEditableState0020')); + await Utils.sleep(500); + await textInput1.click(); + await Utils.sleep(500); + await textInput1.inputText('TextInput:test onSubmit') + await Utils.sleep(500); + await driver.triggerKey(2119); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_KEEPEDITABLESTATE_0200 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextStringParagraphStyleTest/UIComponentTextTextStringParagraphStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextStringParagraphStyleTest/UIComponentTextTextStringParagraphStyle.test.ets new file mode 100755 index 00000000..04811518 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextStringParagraphStyleTest/UIComponentTextTextStringParagraphStyle.test.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 { 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 { Driver,Component,ON } from '@ohos.UiTest' + +export default function UIComponentTextTextStringParagraphStyle() { + + describe('UIComponentTextTextStringParagraphStyle', () => { + 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_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0010 + * @tc.desc StyledString + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0010"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0020 + * @tc.desc StyledString + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('textStringParagraphStyle0020')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0030 + * @tc.desc StyledString + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0020"); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0030 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTransparencyTest/UIComponentTextTransparency.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTransparencyTest/UIComponentTextTransparency.test.ets new file mode 100755 index 00000000..0542a359 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTransparencyTest/UIComponentTextTransparency.test.ets @@ -0,0 +1,676 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import power from '@ohos.power' + +export default function UIComponentTextTransparency() { + + describe('UIComponentTextTransparency', () => { + 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_TEXT_TRANSPARENCY_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0010 + * @tc.desc Text: enable[false] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0010") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0010_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0010_2')); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0020 + * @tc.desc Text: CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0020") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0020_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0020_2')); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0110 + * @tc.desc Search + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0110") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0110_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0110_2')); + await Utils.sleep(1000); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0120 + * @tc.desc Search + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0120") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0120_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0120_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0130 + * @tc.desc Search: mutil color ---fly + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0130") + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0130_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0130_2')); + await Utils.sleep(200); + await text1.longClick(); + await Utils.sleep(200); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(200); + await text1.dragTo(text2); + + await Utils.sleep(200); + await text2.longClick(); + await Utils.sleep(200); + let selectAll1 = await driver.findComponent(ON.text('全选')); + await selectAll1?.click(); + await Utils.sleep(200); + await text2.dragTo(text1); + + await Utils.sleep(500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0140 + * @tc.desc Search:opacity[0.1] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0140") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0140_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0140_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0150 + * @tc.desc Search:opacity[0.6] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0150") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0150_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0150_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0160 + * @tc.desc TextInput + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0160") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0160_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0160_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0170 + * @tc.desc TextInput + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0170") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0170_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0170_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0180 + * @tc.desc TextInput:mutil color--fly + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0180") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0180_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0180_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await text2.longClick(); + await Utils.sleep(1000); + let selectAll1 = await driver.findComponent(ON.text('全选')); + await selectAll1?.click(); + await Utils.sleep(1000); + await text2.dragTo(text1); + + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0180 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0190 + * @tc.desc TextInput:opacity[0.1] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0190 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0190") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0190_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0190_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0200 + * @tc.desc TextInput:opacity[0.6] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0200") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0200_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0200_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0200 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0210 + * @tc.desc TextInput:backgroundColor + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0210 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0210") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0210_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0210_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0210 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0220 + * @tc.desc TextArea + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0220") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0220_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0220_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0220 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0230 + * @tc.desc TextArea + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0230") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0230_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0230_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0240 + * @tc.desc TextArea:mutil color--fly + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0240") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0240_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0240_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await text2.longClick(); + await Utils.sleep(1000); + let selectAll1 = await driver.findComponent(ON.text('全选')); + await selectAll1?.click(); + await Utils.sleep(1000); + await text2.dragTo(text1); + + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0240 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0250 + * @tc.desc TextArea:opacity[0.1] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0250") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0250_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0250_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0250 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0260 + * @tc.desc TextArea:opacity[0.6] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0260") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0260_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0260_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0260 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0270 + * @tc.desc Text----drag action fly + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0270 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0270_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0270_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + // await text1.longClick(); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0300 + * @tc.desc Text----drag action + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0270_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0270_2')); + await Utils.sleep(500); + await text1.longClick(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + await text1.dragTo(text2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0300 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0310 + * @tc.desc Text----mouseDrag action + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0310 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0270_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0270_2')); + await Utils.sleep(500); + let point = await text1.getBounds(); + let point2 = await text2.getBoundsCenter(); + await driver.mouseDrag({ + x: point.left + 20, y: point.top + 20 + }, { + x: point.left + 100, y: point.top + 20 + }, 500); + await Utils.sleep(1000); + await driver.drag(point.left + 50, point.top + 20, point2.x, point2.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0310 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0311 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0311 + * @tc.desc Text----mouseDrag action + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0311', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0311 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0311") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0311_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0311_2')); + let btn = await driver.findComponent(ON.id('textTransparency0311_btn')); + let point = await text1.getBounds(); + let point2 = await text2.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.left + 20, y: point.top + 20 + }, { + x: point.left + 100, y: point.top + 20 + }, 500); + await Utils.sleep(1000); + await driver.drag(point.left + 50, point.top + 20, point2.x, point2.y) + await Utils.sleep(1000); + await text2.inputText('textInput test,textInput CopyOptions'); + await Utils.sleep(500); + await text2.longClick(); + await Utils.sleep(500); + await driver.triggerKey(2049); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(500); + await text2.inputText('textInput test,textInput CopyOptions NONE'); + await Utils.sleep(500); + await text2.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0311 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0312 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0312 + * @tc.desc Text----mouseDrag action + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0312', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0312 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0312") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text1 = await driver.findComponent(ON.id('textTransparency0312_1')); + let text2 = await driver.findComponent(ON.id('textTransparency0312_2')); + let btn = await driver.findComponent(ON.id('textTransparency0312_btn')); + let point = await text1.getBounds(); + let point2 = await text2.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseDrag({ + x: point.left + 20, y: point.top + 20 + }, { + x: point.left + 100, y: point.top + 20 + }, 500); + await Utils.sleep(1000); + await driver.drag(point.left + 50, point.top + 20, point2.x, point2.y) + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(500); + await text2.inputText('textInput inputType'); + await Utils.sleep(500); + await text2.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0312 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorInterfaceTest/UIComponentUISupportColorInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorInterfaceTest/UIComponentUISupportColorInterface001.test.ets new file mode 100755 index 00000000..b5ae030d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorInterfaceTest/UIComponentUISupportColorInterface001.test.ets @@ -0,0 +1,375 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' +import uiAppearance from '@ohos.uiAppearance' + +/* + * SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1760:设置ColorMode + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentUISupportColorInterface001() { + + describe('UIComponentUISupportColorInterface001', () => { + 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_UISUPPORT_COLOR_1760 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1760 + * @tc.desc textArea test ColorMode & Light ~ Light + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1760 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface001_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1760 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1770 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1770 + * @tc.desc textArea test ColorMode & Light ~ Dark + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1770 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface002_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT) + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1770 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1780 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1780 + * @tc.desc textArea test ColorMode & Dark ~ Light + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1780', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1780 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface003_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1780 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1790 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1790 + * @tc.desc textArea test ColorMode & Dark ~ Dark + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1790 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface004_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT) + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1790 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1800 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1800 + * @tc.desc textArea test ThemeColorMode属性为LIGHT + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1800 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface005_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1800 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1810 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1810 + * @tc.desc textArea test ThemeColorMode属性为Dark + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1810 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface005_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1810 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1820 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1820 + * @tc.desc textArea test ThemeColorMode属性为System + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1820 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface005_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1820 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1900 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1900 + * @tc.desc textInput test ColorMode & Light ~ Light + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1900 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface001_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1900 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1910 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1910 + * @tc.desc textInput test ColorMode & Light ~ Dark + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1910', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1910 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface002_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT) + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1910 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1920 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1920 + * @tc.desc textInput test ColorMode & Dark ~ Light + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1780 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface003_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1920 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1930 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1930 + * @tc.desc textInput test ColorMode & Dark ~ Dark + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1790 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface004_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT) + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1790 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1940 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1940 + * @tc.desc textInput test ThemeColorMode属性为LIGHT + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1940 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface006_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1940 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1950 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1950 + * @tc.desc textInput test ThemeColorMode属性为Dark + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1950 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface006_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1950 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1960 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1960 + * @tc.desc textInput test ThemeColorMode属性为System + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1960 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentUISupportColorInterface006_button_001')) + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1960 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement.test.ets new file mode 100755 index 00000000..84e86b1f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement.test.ets @@ -0,0 +1,438 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit' + +export default function UICustomTextShortCutKeyReplacement() { + + describe('UICustomTextShortCutKeyReplacement', () => { + 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_CUSTOM_TEXT_SHORTCUT_KEY_0010 + * @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0010 + * @tc.desc text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0010 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0010") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0010')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0020 + * @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0020 + * @tc.desc text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0020 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0020") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0020')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0030 + * @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0030 + * @tc.desc text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0030 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0030") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0030')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0040 + * @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0040 + * @tc.desc text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0040 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0040") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0040')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0050 + * @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0050 + * @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0050 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0050") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0050')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0050 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0060 + * @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0060 + * @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0060 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0060") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0060')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0070 + * @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0070 + * @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0070 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0070") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0070')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0070 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0080 +* @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0080 +* @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0080 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0080") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0080')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0080 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0090 +* @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0090 +* @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0090 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0090')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0090 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0100 +* @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0100 +* @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0100 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText1')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0090')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0100 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0110 +* @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0110 +* @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0110 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText2')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0090')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0110 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0120 +* @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0120 +* @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0120 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText3')); + await change.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0090')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0120 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0130 +* @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0130 +* @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0130 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText4')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0090')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0130 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0140 +* @tc.name SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0140 +* @tc.desc text +*/ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0140 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0140") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let change = await driver.findComponent(ON.id('changeText')); + await change.click(); + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('UICustomTextShortCutKeyReplacement0140')); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT KEY_0140 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UISearchInterfaceTest/UISearchInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UISearchInterfaceTest/UISearchInterface001.test.ets new file mode 100755 index 00000000..09658007 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UISearchInterfaceTest/UISearchInterface001.test.ets @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0180:search的copy属性测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UISearchInterface001() { + + describe('UISearchInterface001', () => { + 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_TEXT_SELECTION_INTERFACE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0180 + * @tc.desc search set copyOptions:InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UISearchInterface/UISearchInterface001") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let search: Component = await driver.findComponent(ON.id('UISearchInterface001_001')) + await Utils.sleep(500) + await search.inputText('这是输入文字可复制') + await Utils.sleep(500) + await search.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0190 + * @tc.desc search set copyOptions:LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0190 start.`); + Settings.createWindow("testability/pages/UISearchInterface/UISearchInterface002") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let search: Component = await driver.findComponent(ON.id('UISearchInterface002_001')) + await Utils.sleep(500) + await search.inputText('这是输入文字可复制') + await Utils.sleep(500) + await search.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0200 + * @tc.desc search test onCut + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0200 start.`); + Settings.createWindow("testability/pages/UISearchInterface/UISearchInterface003") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let search: Component = await driver.findComponent(ON.id('UISearchInterface003_001')) + await Utils.sleep(500) + await search.inputText('这是输入文字可剪切') + await Utils.sleep(500) + await search.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('剪切')) + await copy?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0200 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0210 + * @tc.desc search test onPaste + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0210 start.`); + Settings.createWindow("testability/pages/UISearchInterface/UISearchInterface004") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UISearchInterface004_text_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + let search: Component = await driver.findComponent(ON.id('UISearchInterface004_001')) + await Utils.sleep(500) + await search.longClick() + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + await driver.click(100, 200) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0210 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0220 + * @tc.desc search test CopyOptions:None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0220 start.`); + Settings.createWindow("testability/pages/UISearchInterface/UISearchInterface005") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let search: Component = await driver.findComponent(ON.id('UISearchInterface005_001')) + await Utils.sleep(500) + await search.inputText('这是输入文字不可复制') + await Utils.sleep(500) + await search.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + if (copy == null) { + await Utils.sleep(1000) + await driver.click(100, 200) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0220 finish.`); + done() + } + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0230 + * @tc.desc search test selectAll and text Light + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0230 start.`); + Settings.createWindow("testability/pages/UISearchInterface/UISearchInterface006") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let search: Component = await driver.findComponent(ON.id('UISearchInterface006_001')) + await Utils.sleep(500) + await search.inputText('这是输入文字全选后高亮') + await Utils.sleep(500) + await search.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0230 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextAreaInterfaceTest/UITextAreaInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextAreaInterfaceTest/UITextAreaInterface001.test.ets new file mode 100755 index 00000000..760ed3e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextAreaInterfaceTest/UITextAreaInterface001.test.ets @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010:textArea 复制/粘贴/剪贴测试 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UITextAreaInterface001() { + + describe('UITextAreaInterface001', () => { + 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_TEXT_SELECTION_INTERFACE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0240 + * @tc.desc textArea set CopyOptions is InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0240 start.`); + Settings.createWindow("testability/pages/UITextAreaInterface/UITextAreaInterface001") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textArea: Component = await driver.findComponent(ON.id('UITextAreaInterface001_001')) + await Utils.sleep(500) + await textArea.inputText('这是输入文字可复制到应用内') + await Utils.sleep(500) + await textArea.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0250 + * @tc.desc textArea set CopyOptions is LocalDevice + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0250 start.`); + Settings.createWindow("testability/pages/UITextAreaInterface/UITextAreaInterface002") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textArea: Component = await driver.findComponent(ON.id('UITextAreaInterface002_001')) + await Utils.sleep(500) + await textArea.inputText('这是输入文字可复制到其他应用') + await Utils.sleep(500) + await textArea.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0260 + * @tc.desc textArea test onCut + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0260 start.`); + Settings.createWindow("testability/pages/UITextAreaInterface/UITextAreaInterface003") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textArea: Component = await driver.findComponent(ON.id('UITextAreaInterface003_001')) + await Utils.sleep(500) + await textArea.inputText('这是输入文字可剪切') + await Utils.sleep(500) + await textArea.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('剪切')) + await copy?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0270 + * @tc.desc textArea test onPaste + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0270 start.`); + Settings.createWindow("testability/pages/UITextAreaInterface/UITextAreaInterface004") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextAreaInterface004_text_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + let textArea: Component = await driver.findComponent(ON.id('UITextAreaInterface004_001')) + await Utils.sleep(500) + await textArea.longClick() + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0270 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0280 + * @tc.desc textArea set CopyOptions is None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0280 start.`); + Settings.createWindow("testability/pages/UITextAreaInterface/UITextAreaInterface005") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let texArea: Component = await driver.findComponent(ON.id('UITextAreaInterface005_001')) + await Utils.sleep(500) + await texArea.inputText('这是输入文字不可复制') + await Utils.sleep(500) + await texArea.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + if(copy == null) { + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0280 finish.`); + done() + } + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0290 + * @tc.desc textArea selectAll and text light + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0290 start.`); + Settings.createWindow("testability/pages/UITextAreaInterface/UITextAreaInterface002") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textArea: Component = await driver.findComponent(ON.id('UITextAreaInterface002_001')) + await Utils.sleep(500) + await textArea.inputText('这是输入文字全选后高亮') + await Utils.sleep(500) + await textArea.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_INTERFACE_0290 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextBoxDisablePasteInterfaceTest/UITextBoxDisablePasteInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextBoxDisablePasteInterfaceTest/UITextBoxDisablePasteInterface001.test.ets new file mode 100755 index 00000000..6895299c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextBoxDisablePasteInterfaceTest/UITextBoxDisablePasteInterface001.test.ets @@ -0,0 +1,796 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' + +/* + * SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010:设置文本颜色 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UITextBoxDisablePasteInterface001() { + + describe('UITextBoxDisablePasteInterface001', () => { + 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_TEXTBOX_DISABLE_PASTE_0010 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0010 + * @tc.desc textInput test disable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_text_001')) + let textInput: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_001')) + let textInput_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(500) + await textInput_disablePaste.longClick() + await Utils.sleep(500) + let paste_disablePaste: Component = await driver.findComponent(ON.text('粘贴')) + await paste_disablePaste?.click() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0020 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0020 + * @tc.desc textArea test disable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0020 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_text_001')) + let areaInput: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_001')) + let areaInput_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await areaInput.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(500) + await areaInput_disablePaste.longClick() + await Utils.sleep(500) + let paste_disablePaste: Component = await driver.findComponent(ON.text('粘贴')) + await paste_disablePaste?.click() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0030 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0030 + * @tc.desc search test disable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0020 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_text_001')) + let search: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_001')) + let search_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await search.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(500) + await search_disablePaste.longClick() + await Utils.sleep(500) + let paste_disablePaste: Component = await driver.findComponent(ON.text('粘贴')) + await paste_disablePaste?.click() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0030 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0040 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0040 + * @tc.desc richEditor test disable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0040 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_text_001')) + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_001')) + let richEditor_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await richEditor.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + await richEditor_disablePaste.longClick() + await Utils.sleep(500) + let paste_disablePaste: Component = await driver.findComponent(ON.text('粘贴')) + await paste_disablePaste?.click() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0050 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0050 + * @tc.desc textInput test disable Paste & cntrl + v + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0050 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_text_001')) + let textInput: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_001')) + let textInput_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await textInput_disablePaste.click() + await Utils.sleep(500) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0060 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0060 + * @tc.desc textArea test disable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0060 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_text_001')) + let areaInput: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_001')) + let areaInput_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + let point = await areaInput.getBoundsCenter(); + await driver.mouseClick({ + x: 0, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(1000) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await areaInput_disablePaste.click() + await Utils.sleep(500) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0030 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0030 + * @tc.desc search test disable Paste & cntrl + v + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0070 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_text_001')) + let search: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_001')) + let search_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await search.click() + await Utils.sleep(500) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await search_disablePaste.click() + await Utils.sleep(500) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0070 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0080 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0080 + * @tc.desc richEditor test disable Paste & cntrl + v + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0080 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_text_001')) + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_001')) + let richEditor_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await richEditor.click() + await Utils.sleep(500) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await richEditor_disablePaste.click() + await Utils.sleep(500) + //cntrl + v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0090 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0090 + * @tc.desc textInput test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0090 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_text_001')) + let textInput: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_001')) + let textInput_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_002')) + await Utils.sleep(500) + await textInput.inputText("这是测试文本这是测试文本这是测试文本这是测试文本") + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + + await textInput.dragTo(textInput_disablePaste) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0100 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0100 + * @tc.desc textArea test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0100 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textArea: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_001')) + let textArea_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_002')) + await Utils.sleep(500) + await textArea.inputText("这是测试文本这是测试文本") + await Utils.sleep(500) + await textArea.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + + await textArea.dragTo(textArea_disablePaste) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0110 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0110 + * @tc.desc Search test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0110 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let search: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_001')) + let search_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_002')) + await Utils.sleep(500) + await search.inputText("这是测试文本这是测试文本这是测试文本这是测试文本") + await Utils.sleep(500) + await search.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + + await search.dragTo(search_disablePaste) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0110 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0120 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0120 + * @tc.desc RichEditor test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0120 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_001')) + let richEditor_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_002')) + await Utils.sleep(500) + await richEditor.inputText("这是测试文本这是测试文本这是测试文本这是测试文本") + await Utils.sleep(500) + await richEditor.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + + await richEditor.dragTo(richEditor_disablePaste) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0130 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0130 + * @tc.desc textInput test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0130 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_text_001')) + let textInput: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_001')) + let textInput_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface001_textInput_002')) + await Utils.sleep(500) + // await textInput_disablePaste.click() + // await Utils.sleep(500) + await textInput_disablePaste.inputText("This is test text.This is test text.") + await Utils.sleep(1000) + await textInput_disablePaste.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + + await textInput_disablePaste.dragTo(textInput) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0140 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0140 + * @tc.desc textArea test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0140 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textArea: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_001')) + let textArea_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface002_textArea_002')) + await Utils.sleep(500) + await textArea_disablePaste.inputText("This is test text.This is test text.") + await Utils.sleep(1000) + await textArea_disablePaste.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + + await textArea_disablePaste.dragTo(textArea) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0150 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0150 + * @tc.desc Search test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0150 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let search: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_001')) + let search_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface003_search_002')) + await Utils.sleep(500) + await search_disablePaste.inputText("This is test text.This is test text.") + await Utils.sleep(1000) + await search_disablePaste.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + + await search_disablePaste.dragTo(search) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0150 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0160 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0160 + * @tc.desc RichEditor test disable Paste & drag + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0160 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let richEditor_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_002')) + let richEditor: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_001')) + await Utils.sleep(500) + await richEditor_disablePaste.inputText("This is test text.This is test text.This is test text.") + await Utils.sleep(500) + await richEditor_disablePaste.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + + await richEditor_disablePaste.dragTo(richEditor) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0170 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0170 + * @tc.desc richEditor test disable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0170 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_text_001')) + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_001')) + let richEditor_disablePaste: Component = + await driver.findComponent(ON.id('UITextBoxDisablePasteInterface004_richEditor_002')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await richEditor.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + await richEditor_disablePaste.longClick() + await Utils.sleep(500) + let paste_disablePaste: Component = await driver.findComponent(ON.text('粘贴')) + await paste_disablePaste?.click() + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_1 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_1 + * @tc.desc richEditor test enable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_1 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface005_richEditor_001')) + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface005_text_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await richEditor.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_1 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_2 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_2 + * @tc.desc richEditor test disable Paste + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_2 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface006_richEditor_001')) + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface006_text_001')) + await Utils.sleep(500) + await text.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(500) + await richEditor.longClick() + await Utils.sleep(500) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + await Utils.sleep(1000) + await Utils.sleep(500) + windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0180_2 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_1 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_1 + * @tc.desc richEditor test enable Paste & right key + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_1 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface007") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface007_richEditor_001')) + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface007_textInput_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(500) + await driver.triggerCombineKeys(2072, 2019) + await Utils.sleep(500) + await richEditor.click() + await Utils.sleep(500) + let point = await richEditor.getBoundsCenter(); + await driver.mouseClick({ + x: 0, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT) + await Utils.sleep(1000) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + windowSnap.snapShot() + await Utils.sleep(1000) + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_1 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_2 + * @tc.name SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_2 + * @tc.desc richEditor test disable Paste & right key + */ + it('SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_1 start.`); + Settings.createWindow("testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface007") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let richEditor: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface007_richEditor_002')) + let text: Component = await driver.findComponent(ON.id('UITextBoxDisablePasteInterface007_textInput_001')) + await Utils.sleep(500) + await text.click() + await Utils.sleep(500) + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(500) + await driver.triggerCombineKeys(2072, 2019) + await Utils.sleep(500) + await richEditor.click() + await Utils.sleep(500) + let point = await richEditor.getBoundsCenter(); + await driver.mouseClick({ + x: 0, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT) + await Utils.sleep(1000) + let paste: Component = await driver.findComponent(ON.text('粘贴')) + await paste?.click() + windowSnap.snapShot() + await Utils.sleep(1000) + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_TEXTBOX_DISABLE_PASTE_0190_1 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextInputInterfaceTest/UITextInputInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextInputInterfaceTest/UITextInputInterface001.test.ets new file mode 100755 index 00000000..8dd11937 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITextInputInterfaceTest/UITextInputInterface001.test.ets @@ -0,0 +1,2609 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' +import uiAppearance from '@ohos.uiAppearance' + +/* + * SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0010:选择文本内容 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UITextInputInterface001() { + + describe('UITextInputInterface001', () => { + 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_TEXT_SELECTION_OPTIMIZATION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0010 + * @tc.desc text scroll and select + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0010 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface001") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface001_001')) + await Utils.sleep(500) + await driver.drag(0, 100, 100, 100, 1000) + await textInput.click() + let selectButton: Component = await driver.findComponent(ON.id('UITextInputInterface001_button_001')) + await Utils.sleep(500) + for (let i = 0; i < 4; i++) { + await selectButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('select+' + i) + } + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0020 + * @tc.desc textInput test drag position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0020 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0057") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0057_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await driver.triggerKey(2082) + // await Utils.sleep(500) + // await textInput.longClick() + await Utils.sleep(500) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y, 1000) + await Utils.sleep(500) + + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0040 + * @tc.desc textInput/Search/textArea placeholder not copy + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0040 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface002") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface002_textInput_001')) + let textArea: Component = await driver.findComponent(ON.id('UITextInputInterface002_textArea_001')) + let search: Component = await driver.findComponent(ON.id('UITextInputInterface002_search_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let copy: Component = await driver.findComponent(ON.text('复制')) + if (copy == null) { + await textInput.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + } + await textArea.longClick() + await Utils.sleep(500) + let textAreaCopy: Component = await driver.findComponent(ON.text('复制')) + if (textAreaCopy == null) { + await textArea.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + } + await search.longClick() + + await Utils.sleep(500) + let searchCopy: Component = await driver.findComponent(ON.text('复制')) + if (searchCopy == null) { + await search.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + } + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0130 + * @tc.desc textInput/Search/textArea setTextSelection and change SelectionOptions + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0130 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface003") + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface003_textInput_001')) + let textArea: Component = await driver.findComponent(ON.id('UITextInputInterface003_textArea_001')) + let search: Component = await driver.findComponent(ON.id('UITextInputInterface003_search_001')) + let hideButton: Component = await driver.findComponent(ON.id('UITextInputInterface003_button_001')) + let showButton: Component = await driver.findComponent(ON.id('UITextInputInterface003_button_002')) + let defaultButton: Component = await driver.findComponent(ON.id('UITextInputInterface003_button_003')) + await Utils.sleep(200) + await textInput.click() + await Utils.sleep(200) + await hideButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('textInput_hide') + await Utils.sleep(200) + + await showButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('textInput_show') + await Utils.sleep(200) + await defaultButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('textInput_default') + await Utils.sleep(200) + + await textArea.click() + await Utils.sleep(200) + await hideButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('textArea_hide') + await Utils.sleep(200) + await showButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('textArea_show') + await Utils.sleep(200) + await defaultButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('textArea_default') + await Utils.sleep(500) + + await search.click() + await Utils.sleep(200) + await hideButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('search_hide') + await Utils.sleep(200) + await showButton.click() + await Utils.sleep(200) + await windowSnap.snapShot('search_show') + await Utils.sleep(200) + await defaultButton.click() + await Utils.sleep(200) + await windowSnap.snapShot() + await Utils.sleep(200) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0140 + * @tc.desc textInput/Search/textArea scroll + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0140 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface004") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface004_textInput_001')) + let textArea: Component = await driver.findComponent(ON.id('UITextInputInterface004_textArea_001')) + let search: Component = await driver.findComponent(ON.id('UITextInputInterface004_search_001')) + let scrollButton: Component = await driver.findComponent(ON.id('UITextInputInterface004_button_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + await scrollButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('textInput') + await Utils.sleep(500) + + await textArea.longClick() + await Utils.sleep(500) + await scrollButton.click() + await Utils.sleep(500) + await windowSnap.snapShot('textArea') + await Utils.sleep(500) + + await search.longClick() + await Utils.sleep(500) + await scrollButton.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0150 + * @tc.desc textInput/Search/textArea add Horizontal and vertical screen switching + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0150 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface005") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface005_textInput_001')) + let textArea: Component = await driver.findComponent(ON.id('UITextInputInterface005_textArea_001')) + let search: Component = await driver.findComponent(ON.id('UITextInputInterface005_search_001')) + await Utils.sleep(500) + await Settings.changeOrientation(); + await Utils.sleep(1000) + + await textInput.longClick() + await Utils.sleep(500) + await windowSnap.snapShot('textInput') + await Utils.sleep(500) + + await textArea.longClick() + await Utils.sleep(500) + await windowSnap.snapShot('textArea') + await Utils.sleep(500) + + await search.longClick() + await Utils.sleep(500) + await windowSnap.snapShot('search') + await Utils.sleep(1000) + await Settings.changeOrientation(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SELECTION_OPTIMIZATION_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0020 + * @tc.desc textInput drag one string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0020 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0052") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0052_textInput_001')) + await Utils.sleep(500) + await Settings.changeOrientation() + await textInput.longClick() + await Utils.sleep(1000); + await textInput.scrollToTop(500) + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(2000) + await Settings.changeOrientation() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0030 + * @tc.desc textInput drag one string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0020 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0053") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0053_textInput_001')) + let textInputTwo: Component = await driver.findComponent(ON.id('UITextInputInterface0053_textInput_002')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + await driver.click(50, 100) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(1000) + await textInput.dragTo(textInputTwo) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0030 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0040 + * @tc.desc textInput drag one string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0040 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0049") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0049_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0049_button_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0050 + * @tc.desc textInput/Search/textArea add Horizontal and vertical screen switching + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0050 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface006_textInput_001')) + let textInputDown: Component = await driver.findComponent(ON.id('UITextInputInterface006_textInput_002')) + await Utils.sleep(500) + await Settings.changeOrientation(); + await Utils.sleep(1000) + + await textInput.dragTo(textInputDown) + await Utils.sleep(1000) + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000); + await textInput.dragTo(textInputDown) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(2000) + await Settings.changeOrientation(); + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0060 + * @tc.desc textInput scroll + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0060 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0054") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0054_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0054_button_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(1000); + await button.click() + await Utils.sleep(1000); + await button.click() + await Utils.sleep(1000); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0060 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0070 + * @tc.desc textInput/Search/textArea add type is password + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0070 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface008") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface008_textInput_001')) + await Utils.sleep(500) + await textInput.inputText('this is password') + await Utils.sleep(1000) + await textInput.longClick() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0080 + * @tc.desc textInput/Search/textArea add type is password + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0080 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface008") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface008_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0090 + * @tc.desc textInput/Search/textArea test change fontSize&cursor + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0090 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0010_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0010_button_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0110 + * @tc.desc textInput/Search/textArea test onLongClick + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0110 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0010") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0010_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0120 + * @tc.desc textInput/Search/textArea test Focus change + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0120 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0011") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0011_textInput_001')) + let textInputTwo: Component = await driver.findComponent(ON.id('UITextInputInterface0011_textInput_002')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + await textInputTwo.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0130 + * @tc.desc textInput/Search/textArea test Focus change + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0130 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0012") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0012_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(1000) + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + await textInput.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0150 + * @tc.desc textInput/Search/textArea test Focus on "" + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0150 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0012") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0012_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0160 + * @tc.desc textInput/Search/textArea test Focus change + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0160 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0013") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0013_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(1000) + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(1000) + await textInput.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0220 + * @tc.desc textInput/Search/textArea test drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0220 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0049") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0049_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.click(point.x, point.y) + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0220 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0230 + * @tc.desc textInput/Search/textArea test drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0230 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0049") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0049_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.click(point.x, point.y) + await Utils.sleep(1000) + await driver.click(point.x, point.y) + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0250 + * @tc.desc textInput test type = password & ctrl + x + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0250 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0048") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0048_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + // let selectAll = await driver.findComponent(ON.text('全选')) + // await selectAll.click() + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(1000) + await driver.triggerCombineKeys(2072, 2040) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0250 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0270 + * @tc.desc textInput/Search/textArea test Focus change + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0270 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0014_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + let pointCenterOne = await textInput.getBoundsCenter(); + await driver.inputText({ + x: 0, y: pointCenterOne.y + }, '测试输入第一组文字,text') + await Utils.sleep(500) + let pointCenterTwo = await textInput.getBoundsCenter(); + await driver.inputText({ + x: pointCenterTwo.x, y: pointCenterTwo.y + }, '测试输入第二组文字,text') + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0270 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0320 + * @tc.desc textInput/Search/textArea test Focus change + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0320 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0014") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0014_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + let pointCenterOne = await textInput.getBoundsCenter(); + await driver.inputText({ + x: pointCenterOne.x, y: pointCenterOne.y + }, '测试输入第一组文字,text') + await Utils.sleep(500) + await driver.mouseClick({ + x: pointCenterOne.x, y: pointCenterOne.y + }, MouseButton.MOUSE_BUTTON_RIGHT) + await Utils.sleep(500) + let selectAll = await driver.findComponent(ON.text('全选')) + let pointCenterSelectAll = await selectAll?.getBoundsCenter(); + await Utils.sleep(500) + await driver.mouseClick({ + x: pointCenterSelectAll.x, y: pointCenterSelectAll.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await windowSnap.snapShot() + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0320 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0400 + * @tc.desc textInput/Search/textArea test select Handle + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0400 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0015_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let selectAll = await driver.findComponent(ON.text('全选')) + await Utils.sleep(500) + await selectAll?.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0410 + * @tc.desc textInput/Search/textArea test onTouch callBack + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0410 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0015") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0015_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0410 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0420 + * @tc.desc textInput/Search/textArea test password error + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0410 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0055") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0055_textInput_001')) + await Utils.sleep(500) + await textInput.inputText('error test') + await Utils.sleep(1000) + await driver.triggerKey(2054) + // await textInput.click() + await Utils.sleep(1000) + await textInput.inputText('error test') + await Utils.sleep(1000) + await driver.triggerKey(2054) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0420 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0460 + * @tc.desc textInput/Search/textArea test inputFilter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0460 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0056") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0056_textInput_001')) + await Utils.sleep(500) + await textInput.inputText('输入数字:12545,输入字母:sfdfA') + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0460 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0470 + * @tc.desc textInput test type=password & $() + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0470 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0050") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0050_textInput_001')) + await Utils.sleep(500) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0470 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0510 + * @tc.desc textInput/Search/textArea test change + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0510 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0016") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0016_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await textInput.inputText("测试文本") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0510 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0540 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0540 + * @tc.desc textInput/Search/textArea test doubleClick + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0540 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface006") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface006_textInput_001')) + let textInputTwo: Component = await driver.findComponent(ON.id('UITextInputInterface006_textInput_002')) + await Utils.sleep(500) + await textInput.doubleClick() + await Utils.sleep(500) + await textInputTwo.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0540 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0040 + * @tc.desc textInput/Search/textArea test EVASIVEINPUTMETHOD top + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0040 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0017_textInput_001')) + let pointCenterOne = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.mouseClick({ + x: pointCenterOne.x, y: pointCenterOne.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(500) + Settings.changeOrientation() + await Utils.sleep(1000) + await driver.mouseClick({ + x: pointCenterOne.x, y: pointCenterOne.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0050 + * @tc.desc textInput/Search/textArea test EVASIVEINPUTMETHOD center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0050 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0017_textInput_002')) + let pointCenterOne = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.mouseClick({ + x: pointCenterOne.x, y: pointCenterOne.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(500) + Settings.changeOrientation() + await Utils.sleep(1000) + await driver.mouseClick({ + x: pointCenterOne.x, y: pointCenterOne.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0060 + * @tc.desc textInput/Search/textArea test EVASIVEINPUTMETHOD bottom + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0050 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0017") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0017_textInput_003')) + let pointCenterOne = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.mouseClick({ + x: pointCenterOne.x, y: pointCenterOne.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(500) + Settings.changeOrientation() + await Utils.sleep(1000) + await driver.mouseClick({ + x: pointCenterOne.x, y: pointCenterOne.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_EVASIVEINPUTMETHOD_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0010 + * @tc.desc textInput/Search/textArea test INTERACTION Ctrl+X/C + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0010 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0018_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是测试文本") + await Utils.sleep(500) + //Ctrl+A + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(500) + //Ctrl+C + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + //Ctrl+V + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0020 + * @tc.desc textInput/Search/textArea test INTERACTION Ctrl+z/y + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0020 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0018_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + await driver.inputText({ + x: 0, y: 50 + }, "这是测试文本,this is test text 测试文本") + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let selectAll: Component = await driver.findComponent(ON.text('剪切')) + await Utils.sleep(500) + await selectAll?.click() + await Utils.sleep(500) + //Ctrl+Z + await driver.triggerCombineKeys(2072, 2042) + await Utils.sleep(500) + //Ctrl+Y + // await driver.triggerCombineKeys(2072, 2041) + // await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0030 + * @tc.desc textInput/Search/textArea test Click on the cursor position + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0020 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0018_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是测试文本") + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0040 + * @tc.desc textInput test drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0040 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0018_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是测试文本这是测试文本这是测试文本这是测试文本这是测试文本这是测试文本测试文本这是测试文本") + // await Utils.sleep(500) + // await driver.triggerKey(2081) + await Utils.sleep(1000) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0040 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0050 + * @tc.desc textInput test Drag selected text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0050 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0018_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是测试文本这是测试文本这是测试文本这是测试文本") + await Utils.sleep(500) + let point = await textInput.getBoundsCenter() + await Utils.sleep(500) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0060 + * @tc.desc textInput/Search/textArea test deleted-key + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0060 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0018_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是个测试文本") + await Utils.sleep(1000) + await textInput.click() + await Utils.sleep(1000) + await driver.triggerKey(2055) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0070 + * @tc.desc textInput/Search/textArea test Ctrl+A + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0070 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0018") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0018_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是个测试文本") + await Utils.sleep(500) + //Ctrl+A + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0090 + * @tc.desc textInput/Search/textArea test doubleClick + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0090 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + let pointCenter = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.click(pointCenter.x, pointCenter.y) + await Utils.sleep(100) + await driver.click(pointCenter.x, pointCenter.y) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0090 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0110 + * @tc.desc textInput/Search/textArea test Input box focused + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0110 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0140 + * @tc.desc textInput/Search/textArea test View + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0140 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0150 + * @tc.desc textInput/Search/textArea test triggerKey enter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0150 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + let pointCenter = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.inputText({ + x: pointCenter.x / 2, y: pointCenter.y + }, '测试输入') + await Utils.sleep(500) + await driver.triggerKey(2054) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0160 + * @tc.desc textInput/Search/textArea test text home/end + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0160 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + let pointCenter = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.inputText({ + x: pointCenter.x / 2, y: pointCenter.y + }, '测试输入') + await Utils.sleep(500) + await driver.triggerKey(2081) + await Utils.sleep(500) + await driver.triggerKey(2082) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0170 + * @tc.desc textInput/Search/textArea test text Ctrl+→ + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0160 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await driver.triggerKey(2631) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0180 + * @tc.desc textInput/Search/textArea test text longClick + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0180 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + await driver.longClick(600, 100) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0180 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0190 + * @tc.desc textInput/Search/textArea test mouseMoveTo center + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0190 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0019") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0019_textInput_001')) + await Utils.sleep(500) + let pointCenter = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.mouseMoveTo({ + x: pointCenter.x / 2, y: pointCenter.y + }) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0210 + * @tc.desc textInput/Search/textArea test Display of password box in dark mode + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0210 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0020") + await Utils.sleep(500) + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, (error) => { + if (error) { + console.error('Set dark-mode failed, ' + error.message); + } else { + console.info('Set dark-mode successfully.'); + } + let isDark = uiAppearance.getDarkMode() + console.info('Set dark-mode successfully. and is : ' + isDark); + }) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0020_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT) + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERACTION_0210 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0010 + * @tc.desc textInput/Search/textArea test inputFilter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0021") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0021_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是测试AAssGonk") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0230 + * @tc.desc textInput/Search/textArea test maxLength + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0230 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0022_textInput_001')) + await Utils.sleep(500) + for (let i = 0; i < 4; i++) { + await textInput.inputText("这是个很长的测试文本可无限循环输入") + await Utils.sleep(500) + } + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0230 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0240 + * @tc.desc textInput/Search/textArea test cursor size + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0240 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0022") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0022_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("默认风格,光标宽1.5vp,光标高度与文本选中底板高度和字体大小相关") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0250 + * @tc.desc textInput/Search/textArea test inputFilter = [A-Z] + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0250 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0051") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0051_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("这是输入Tish is A Bh") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0260 + * @tc.desc textInput/Search/textArea test maxLength 15-30 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0260 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0023") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0023_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0023_button_001')) + await Utils.sleep(500) + await textInput.inputText("测试字符,输入15个字符,test this") + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + let pointCenter = await textInput.getBoundsCenter(); + await driver.inputText({ + x: pointCenter.x, y: pointCenter.y + }, "测试字符,输入15个字符,test this") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0270 + * @tc.desc textInput/Search/textArea test maxLength 30-15 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0270 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0024") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0024_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0024_button_001')) + await Utils.sleep(500) + await textInput.inputText("测试字符,输入30个字符,test this测试字符,输入30个字符,test this") + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + let pointCenter = await textInput.getBoundsCenter(); + await driver.inputText({ + x: pointCenter.x, y: pointCenter.y + }, "测试字符,输入15个字符,test this") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0270 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0270 + * @tc.desc textInput/Search/textArea test maxLength 9 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0290 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0025") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0025_textInput_001')) + await Utils.sleep(500) + await textInput.inputText("测试字符,输入9个字符,test this") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0290 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0300 + * @tc.desc textInput/Search/textArea test caretPosition =-1 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0300 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0026") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0026_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0026_button_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0300 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0310 + * @tc.desc textInput/Search/textArea test caretPosition =0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0310 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0027") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0027_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0027_button_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0310 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0320 + * @tc.desc textInput/Search/textArea test caretPosition =8 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0320 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0028") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0028_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0028_button_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(500) + await button.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0320 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0360 + * @tc.desc textInput/Search/textArea test caretColor + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0360 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0029") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0029_textInput_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0360 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0370 + * @tc.desc textInput/Search/textArea test not set CopyOptions + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0370 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0030") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0030_textInput_001')) + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0370 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0380 + * @tc.desc textInput/Search/textArea test not set CopyOptions.InApp + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0380 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0031") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0031_textInput_001')) + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let copy = await driver.findComponent(ON.text('复制')) + await copy?.click() + await Utils.sleep(1000) + await inputText.click() + await Utils.sleep(500) + //ctrl+v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0400 + * @tc.desc textInput/Search/textArea test not set CopyOptions.None + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0400 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0033") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0033_textInput_001')) + await Utils.sleep(500) + await inputText.longClick() + await Utils.sleep(500) + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0420 + * @tc.desc textInput/Search/textArea test enterType next + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0420 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0034") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0034_textInput_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0420 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0430 + * @tc.desc textInput/Search/textArea test enterType GO + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0430 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0035") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0035_textInput_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0430 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0440 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0440 + * @tc.desc textInput/Search/textArea test enterType Send + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0440 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0036") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0036_textInput_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0440 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0450 + * @tc.desc textInput/Search/textArea test enterType Search + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0450 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0037") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0037_textInput_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0450 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0460 + * @tc.desc textInput/Search/textArea test enterType Done + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0460 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0038") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0038_textInput_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0460 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0470 + * @tc.desc textInput/Search/textArea test not set enterType + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0460 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0033") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let inputText: Component = await driver.findComponent(ON.id('UITextInputInterface0033_textInput_001')) + await Utils.sleep(500) + await inputText.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0470 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0500 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0500 + * @tc.desc textInput/Search/textArea test onChange callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0500 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0039") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0039_textInput_001')) + await Utils.sleep(500) + let pointCenter = await textInput.getBoundsCenter(); + await Utils.sleep(500) + await driver.inputText({ + x: pointCenter.x / 2, y: pointCenter.y + }, "测试插入文本") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0500 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0510 + * @tc.desc textInput/Search/textArea test onCopy callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0510 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0040") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0040_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await driver.inputText({ + x: 0, y: 0 + }, "插入文本") + await Utils.sleep(500) + //Ctrl+A + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(1000) + //Ctrl+C + await driver.triggerCombineKeys(2072, 2019) + await Utils.sleep(1000) + await textInput.click() + await Utils.sleep(500) + //Ctrl+v + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0510 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0520 + * @tc.desc textInput/Search/textArea test onCut callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0520 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0041") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0041_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let cut: Component = await driver.findComponent(ON.text('剪切')) + await Utils.sleep(500) + await cut?.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0520 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0530 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0530 + * @tc.desc textInput/Search/textArea test onEditChange callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0530 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0042") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0042_textInput_001')) + let textInputTwo: Component = await driver.findComponent(ON.id('UITextInputInterface0042_textInput_002')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + + await textInputTwo.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0530 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0540 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0540 + * @tc.desc textInput/Search/textArea test onPaste callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0540 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0040") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0040_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + await driver.inputText({ + x: 0, y: 0 + }, "插入测试文本") + await Utils.sleep(500) + //Ctrl+A + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(1000) + //Ctrl+C + await driver.triggerCombineKeys(2072, 2017) + await Utils.sleep(1000) + //Ctrl+V + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0540 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0550 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0550 + * @tc.desc textInput/Search/textArea test onSubmit callback + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0550 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0043") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0043_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(1000) + + await driver.triggerKey(2054) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0550 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0650 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0650 + * @tc.desc textInput/Search/textArea add minWidth + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0650 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0065") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0650 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0660 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0660 + * @tc.desc textInput/Search/textArea add maxLength = 20 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0660 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0044") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0044_textInput_001')) + await Utils.sleep(500) + await textInput.longClick() + await Utils.sleep(500) + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click() + await Utils.sleep(500) + let onCopy = await driver.findComponent(ON.text('复制')) + await onCopy?.click() + await Utils.sleep(500); + await driver.triggerCombineKeys(2072, 2038) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0660 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0670 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0670 + * @tc.desc textInput/Search/textArea onTextSelectionChange + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0670 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0045") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0045_textInput_001')) + await Utils.sleep(500) + await textInput.click() + await Utils.sleep(500) + // await textInput.inputText('输入测试文本') + await driver.inputText({ + x: 0, y: 0 + }, "输入测试文本") + let point = await textInput.getBoundsCenter() + await Utils.sleep(1000) + await driver.drag(point.x, point.y, 0, point.y) + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_INTERFACE_0670 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0010 + * @tc.desc textInput/Search/textArea not set width and height + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0010 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0046") + await Utils.sleep(500) + let driver: Driver = Driver.create() + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0020 + * @tc.desc textInput/Search/textArea not set width and height + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0020 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0046") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0046_textInput_001')) + await Utils.sleep(500) + await textInput.click(); + await Utils.sleep(500) + await driver.inputText({ + x: 0, y: 0 + }, "这是测试输入单行文本不支持换行这是测试输入单行文本不支持换行") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_UXCONSISTENCY_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_UXCONSISTENCY_0090 + * @tc.desc textInput/Search/textArea set style is inline && selection + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_UXCONSISTENCY_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_LAYOUT_0020 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0047") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0047_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0047_button_001')) + await Utils.sleep(500) + await textInput.click(); + await Utils.sleep(500) + for (let i = 0; i < 4; i++) { + await button.click() + await Utils.sleep(500) + } + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_UXCONSISTENCY_0090 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_01 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_01 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_01: Component = await driver.findComponent(ON.id('UITextInputInterface0061_01')) + await Utils.sleep(1000) + await button_01.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_01 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_02 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_02 + _02 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_02: Component = await driver.findComponent(ON.id('UITextInputInterface0061_02')) + await Utils.sleep(1000) + await button_02.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_03 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_03 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_03: Component = await driver.findComponent(ON.id('UITextInputInterface0061_03')) + await Utils.sleep(1000) + await button_03.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0010_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_01 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_01 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_01: Component = await driver.findComponent(ON.id('UITextInputInterface0061_01')) + await Utils.sleep(1000) + await button_01.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_01 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_02 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_02 + _02 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_02: Component = await driver.findComponent(ON.id('UITextInputInterface0061_02')) + await Utils.sleep(1000) + await button_02.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_03 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_03 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_03: Component = await driver.findComponent(ON.id('UITextInputInterface0061_03')) + await Utils.sleep(1000) + await button_03.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0020_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_01 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_01 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_01: Component = await driver.findComponent(ON.id('UITextInputInterface0061_01')) + await button_01.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_01 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_02 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_02 + _02 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_02: Component = await driver.findComponent(ON.id('UITextInputInterface0061_02')) + await Utils.sleep(1000) + await button_02.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_03 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_03 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0061_pc") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0061_textInput_001')) + let button_03: Component = await driver.findComponent(ON.id('UITextInputInterface0061_03')) + await Utils.sleep(1000) + await button_03.click(); + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0030_03 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_01 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_01 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0058") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0058_textInput_001')) + let button_01: Component = await driver.findComponent(ON.id('UITextInputInterface0058_01')) + await Utils.sleep(500) + await button_01.click(); + await Utils.sleep(500) + await + textInput.inputText("123456") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_01 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_02 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_02 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0058") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0058_textInput_001')) + let button_02: Component = await driver.findComponent(ON.id('UITextInputInterface0058_02')) + await Utils.sleep(500) + await button_02.click(); + await Utils.sleep(500) + await textInput.inputText("123456") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_03 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_03 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0058") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0058_textInput_001')) + let button_03: Component = await driver.findComponent(ON.id('UITextInputInterface0058_03')) + await Utils.sleep(500) + await button_03.click(); + await Utils.sleep(500) + await textInput.inputText("123456") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0070_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_01 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_01 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_01 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0058") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0058_textInput_001')) + let button_01: Component = await driver.findComponent(ON.id('UITextInputInterface0058_01')) + await Utils.sleep(500) + await button_01.click(); + await Utils.sleep(500) + await textInput.inputText("123456") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_01 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_02 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_02 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_02 + _02 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0058") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0058_textInput_001')) + let button_02: Component = await driver.findComponent(ON.id('UITextInputInterface0058_02')) + await Utils.sleep(500) + await button_02.click(); + await Utils.sleep(500) + await textInput.inputText("123456") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_02 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_03 + * @tc.name SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_03 + * @tc.desc change password Type + */ + it('SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_03 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0058") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0058_textInput_001')) + let button_03: Component = await driver.findComponent(ON.id('UITextInputInterface0058_03')) + await Utils.sleep(500) + await button_03.click(); + await Utils.sleep(500) + textInput.inputText("123456") + await Utils.sleep(500) + await windowSnap.snapShot() + await Utils.sleep(500) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PASSWORD_PC_0080_03 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0480 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0480 + * @tc.desc callback getTextContentRect + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0480 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0059") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0059_textInput_001')) + let button: Component = await driver.findComponent(ON.id('UITextInputInterface0059_01')) + await Utils.sleep(1000) + await textInput.inputText("123456") + await Utils.sleep(500) + await button.click(); + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0480 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0490 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0490 + * @tc.desc callback onChange + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0490 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0060") + await Utils.sleep(500) + let driver: Driver = Driver.create() + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface0060_textInput_001')) + let button_01: Component = await driver.findComponent(ON.id('UITextInputInterface0060_01')) + let button_02: Component = await driver.findComponent(ON.id('UITextInputInterface0060_02')) + await Utils.sleep(500) + await button_01.click(); + await Utils.sleep(500) + await button_02.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0490 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0100 + * @tc.desc drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0100 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0100"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let search: Component = await driver.findComponent(ON.id('UITextInputInterface001_002')) + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface001_001')) + await Utils.sleep(500); + let point1 = await search.getBoundsCenter(); + let point2 = await textInput.getBoundsCenter(); + await driver.mouseClick(point1, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await driver.mouseMoveTo(point2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_1 + * @tc.desc drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_1 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0100"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface001_001')); + let textInput2: Component = await driver.findComponent(ON.id('UITextInputInterface001_002')); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await driver.triggerKey(2082); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_1 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_2 + * @tc.desc drag + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_2 start.`); + Settings.createWindow("testability/pages/UITextInputInterface/UITextInputInterface0100"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UITextInputInterface001_001')); + let textInput2: Component = await driver.findComponent(ON.id('UITextInputInterface001_002')); + await Utils.sleep(500); + await textInput.click(); + await Utils.sleep(500); + await driver.triggerKey(2082); + await Utils.sleep(1000); + await textInput.longClick(); + await Utils.sleep(1000); + await textInput.dragTo(textInput2); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTINPUT_ACTION_0170_2 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets index c74ae272..07d1bbd8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets @@ -36,14 +36,14 @@ async function sleep(time: number): Promise { } class Settings { - isPhone: boolean = true; + isPhone: boolean = false; windowClass: window.Window | undefined = undefined windowCreateType: string = "changeWindow"; private static DEFAULT_WIDTH: number = 720; - private static DEFAULT_HEIGHT: number = 1280; + private static DEFAULT_HEIGHT: number = 1412; private static DEFAULT_DPI: number = 240; - private static DEFAULT_OFFSET_X: number = 0; - private static DEFAULT_OFFSET_Y: number = 60; + private static DEFAULT_OFFSET_X: number = 100; + private static DEFAULT_OFFSET_Y: number = 132; private portrait: boolean = true changeWindowPosition(windowClass: window.Window, X: number | undefined, Y: number | undefined) { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets index 7f06aa4d..232239fb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -13,33 +13,86 @@ * limitations under the License. */ -import {Driver , ON} from '@ohos.UiTest' +import { Driver, ON } from '@ohos.UiTest' +import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit'; +import { BusinessError, pasteboard } from '@kit.BasicServicesKit'; +import bundleManager from '@ohos.bundle.bundleManager'; export default class Utils { + static permission_state: boolean = true; - static async sleep(time : number) :Promise { - const result:string = await new Promise((resolve:Function)=>{ - setTimeout(()=> { + static async sleep(time: number): Promise { + const result: string = await new Promise((resolve: Function) => { + setTimeout(() => { resolve('sleep ok') - },time) + }, time) }); console.info(result); } - static async waitAsync (ms:number):Promise{ - return new Promise((resolve)=>{ - setTimeout(resolve,ms) - }) + + static async waitAsync(ms: number): Promise { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) } - static async clickComponentByKey (componentKey :string){ - let driver = Driver.create(); - let component = await driver.findComponent(ON.id(componentKey)) - await component.click(); + static async clickComponentByKey(componentKey: string) { + let driver = Driver.create(); + let component = await driver.findComponent(ON.id(componentKey)) + await component.click(); } + static async checkPermission(callback: (isGranted: boolean) => void) { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + let grantStatus: abilityAccessCtrl.GrantStatus = await Utils.checkAccessToken(permissions[0]); + if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { + callback(true) + } else { + callback(false) + } + } + static async checkAccessToken(permission: Permissions): Promise { + let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); + let grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED; + // 获取应用程序的accessTokenID + let tokenId: number = 0; + try { + let bundleInfo: bundleManager.BundleInfo = + await bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); + let appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo; + tokenId = appInfo.accessTokenId; + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`Failed to get bundle info for self. Code is ${err.code}, message is ${err.message}`); + } + // 校验应用是否被授予权限 + try { + grantStatus = await atManager.checkAccessToken(tokenId, permission); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`Failed to check access token. Code is ${err.code}, message is ${err.message}`); + } + return grantStatus; + } + + static async reqPermissionsFromUser(permissions: Array, context: common.UIAbilityContext, + callback: (isGrant: boolean) => void) { + let atManager = abilityAccessCtrl.createAtManager(); + // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 + atManager.requestPermissionsFromUser(context, permissions).then((data) => { + let grantStatus: Array = data.authResults; + if (grantStatus[0] === 0) { + callback(true) + } else { + // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限 + callback(false) + } + }).catch((err: String) => { + }) + } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets index 5b2992dc..640bb1d1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -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. @@ -59,13 +59,27 @@ export default class TestAbility extends UIAbility { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); GlobalThis.getInstance().setContext("context", this.context) - windowStage.loadContent('testability/pages/Index', (err) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; + // + let atManager = abilityAccessCtrl.createAtManager(); + let appFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION; + let permissionFlags = 0; + bundleManager.getBundleInfoForSelf(appFlags, (err, data) => { + if (err) { + Logger.error(TAG, 'getAllApplicationInfo failed: %{public}s', err.message); + console.error("") } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); - }); + let tokenID = data.appInfo.accessTokenId; //系统应用可以通过bundleManager.getApplicationInfo获取,普通应用可以通过bundleManager.getBundleInfoForSelf获取 + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.READ_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.WRITE_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + }) } onWindowStageDestroy() { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventWillClickReplacement/ActionEventWillClickReplacement0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventWillClickReplacement/ActionEventWillClickReplacement0170.ets new file mode 100755 index 00000000..8cf8fa86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventWillClickReplacement/ActionEventWillClickReplacement0170.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 observer from '@ohos.arkui.observer'; + +class NavDestinationIdHelper { + private ids: Array = []; + private static instance: NavDestinationIdHelper = new NavDestinationIdHelper() + + static getInstance() { + return NavDestinationIdHelper.instance + } + + addId(id: string): number { + this.ids.push(id) + return this.ids.length + } + + removeId(id: string): boolean { + let index: number = this.ids.findIndex(element => element === id) + if (index === -1) { + return false + } + this.ids.splice(index, 1) + return true + } + + getIdArray(): Array { + return this.ids + } +} + +@Component +export struct MyButton { + text: string = "" + onClickFunction: (event: ClickEvent) => void = () => { + } + backGdColor = '#ccc' + + build() { + Button() { + Text(this.text) + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ top: 6 }) + .onClick(this.onClickFunction) + .backgroundColor(this.backGdColor) + } +} + +@Entry({ routeName: "newInstanceTest" }) +@Component +struct ActionEventWillClickReplacement0170 { + @Provide('stack') stack: NavPathStack = new NavPathStack() + @State message: string = 'aboutToAppear回调结果:\n' + + aboutToAppear(): void { + this.getUIContext().getUIObserver().on('routerPageUpdate', (info) => { + console.log('[router] routerPageUpdate: ' + JSON.stringify(info)) + }) + this.getUIContext().getUIObserver().on('willClick', (info) => { + console.log('[router] willClick: ' + JSON.stringify(info)) + this.message += 'willClick callback>>\n'; + }) + this.getUIContext().getUIObserver().on('didClick', (info) => { + console.log('[router] didClick: ' + JSON.stringify(info)) + this.message += 'didClick callback>>\n'; + }) + } + + @Builder + pageMap(name: string) { + if (name.substring(0, 7) == "pageOne") { + PageOne() + } else if (name.substring(0, 7) == "pageTwo") { + PageTwo() + } + } + + @State mode: NavigationMode = NavigationMode.Auto + + build() { + Column() { + Navigation(this.stack) { + Text("空白过渡页面") + + }.navDestination(this.pageMap) + .mode(NavigationMode.Auto).height('70%') + .onAppear(() => { + this.stack.pushDestination({ name: "pageTwo" }) + }) + + Text(this.message) + .fontSize(20) + .fontColor(Color.Brown) + .borderWidth(3) + .width('80%') + .height(200) + } + } +} + +@Component +export struct PageOne { + @Consume('stack') stack: NavPathStack + @State stackSize: number = -1 + @State stackArray: Array = [] + @State curId: string = "NA" + @State idArray: Array = NavDestinationIdHelper.getInstance().getIdArray(); + name: string = "PAGE_ONE" + + build() { + NavDestination() { + Column({space:10}) { + MyButton({ + text: "push pageOne", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageOne" }) + } + }) + + MyButton({ + text: "push pageTwo", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageTwo" }) + } + }) + } + } + .title('Page One') + .id("2") + .onReady((ctx) => { + // get from query + let id = this.queryNavDestinationInfo()?.navDestinationId + // get from onReady + this.stack = ctx.pathStack + this.curId = ctx.navDestinationId ? ctx.navDestinationId : "__invalid__" + NavDestinationIdHelper.getInstance().addId(this.curId) + }).height('60%') + } +} + +@Component +export struct PageTwo { + @Consume('stack') stack: NavPathStack + // stack: NavPathStack = new NavPathStack() + @State stackSize: number = -1 + @State stackArray: Array = [] + // color: Color = (Tool.count) % 2 == 0 ? Color.Pink : Color.Gray + @State name: string = "PAGE_TWO" + @State mode: NavigationMode = NavigationMode.Auto + private scroller: Scroller = new Scroller() + @State disableAnimation: boolean = false + @State curId: string = "NA" + @State idArray: Array = NavDestinationIdHelper.getInstance().getIdArray(); + @State count: number = 0; + + navDesUpdateCallback(info: NavDestinationInfo) { + console.log(`testTag navDesUpdateCallback,info:${JSON.stringify(info)}`); + } + + observerOn() { + observer.on('navDestinationUpdate', this.navDesUpdateCallback); + } + + observerOff() { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + aboutToDisappear(): void { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + build() { + NavDestination() { + Scroll(this.scroller) { + Column({space:10}) { + MyButton({ + text: "push pageOne", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageOne" }) + } + }) + + MyButton({ + text: "push pageTwo", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageTwo" }) + } + }) + } + }.height('100%') + .scrollBar(BarState.On) + .scrollable(ScrollDirection.Vertical) + }.height('60%') + .title(this.name) //.backgroundColor(this.color) + .onReady((ctx: NavDestinationContext) => { + this.stack = ctx.pathStack + this.name = ctx.pathInfo.name + let allName = this.stack.getAllPathName() + this.stackArray = [] + for (let i = 0; i < allName.length; i++) { + this.stackArray.push(i + ":" + allName[i]) + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040.ets new file mode 100755 index 00000000..853e8964 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040.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 UIAttributeBackgroundSeriableReplacement0040 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State dataArray: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State isShow: boolean = false + + build() { + Column({ space: 10 }) { + if (this.isShow) { + List({ space: 12, initialIndex: 0 }) { + ForEach(this.dataArray, (item: number) => { + ListItem() { + Text('Text:' + item) + .width('90%') + .height(42) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center).borderWidth(1) + } + }, (item: number) => item.toString()) + } + .height('90%') + .width('100%') + .margin({ top: 12, left: '10%' }) + } + Row({ space: 10 }) { + Button('deleteCount=-5').id('SeriableReplacement0040_1').stateEffect(true).onClick(() => { + this.dataArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + this.dataArray.splice(3, -5); + this.isShow = true; + }) + Button('deleteCount=-10').id('SeriableReplacement0040_2').stateEffect(true).onClick(() => { + this.dataArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + this.dataArray.splice(3, -10); + this.isShow = true; + }) + Button('deleteCount=-20').id('SeriableReplacement0040_3').stateEffect(true).onClick(() => { + this.dataArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + this.dataArray.splice(3, -20); + this.isShow = true; + }) + }.borderWidth(3).borderColor(Color.Blue) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001.ets new file mode 100755 index 00000000..9b6f1257 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIAttributeFontInterface001 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + .key('UIAttributeFontInterface001_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface001.ets new file mode 100755 index 00000000..f2390a76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface001.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentContainerSpanInterface001 { + build() { + Column() { + Text('ContainerSpan无width和height属性').fontColor(getContext().resourceManager.getColorSync($r("app.color.yellow"))) + Button('ContainerSpan无width和height属性').backgroundColor(getContext().resourceManager.getColorSync($r("app.color.yellow"))) + Text() { + ContainerSpan() { + ImageSpan($r('app.media.app_icon')) + .width('40vp') + .height('40vp') + .verticalAlign(ImageSpanAlignment.CENTER) + Span(' Hello World ! ').fontSize('16fp').fontColor(Color.White) + }.textBackgroundStyle({ color: "#7F007DFF", radius: "12vp" }) + }.margin({ top: 15 }) + }.width('100%').alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002.ets new file mode 100755 index 00000000..a2a13be1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentContainerSpanInterface002 { + build() { + Column() { + Text('ContainerSpan无width和height,和onClick属性,代码报错') + .fontColor(Color.Red) + Image('testability/resources/containerspan_width_error.png') + .width('100%') + Image('testability/resources/containerspan_height_error.png') + .width('100%') + Image('testability/resources/containerspan_click_error.png') + .width('100%') + } + .width('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0010.ets new file mode 100755 index 00000000..dadf512d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0010.ets @@ -0,0 +1,257 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, typeNode } from '@ohos.arkui.node'; +import Utils from '../../../test/model/Utils'; +import windowSnap from '../../../test/model/snapShot' + +let para: Record = { 'onStart': '' }; +let storage: LocalStorage = new LocalStorage(para); +let para2: Record = { 'onBounce': '' }; +let storage2: LocalStorage = new LocalStorage(para2); +let para3: Record = { 'onFinish': '' }; +let storage3: LocalStorage = new LocalStorage(para3); + +class MyNodeController4 extends NodeController { + text = "The text area content内容"; + placeholder = 'The text area can hold an unlimited amount of text. input your word...' + placeholdercolor = [Color.Red, 'rgba(11, 234, 33, 0.98)', 'rgb(243, 11, 11, 1)', 0xffff0000, '#ffffff'] + placeholdercolorindex = 0 + placeholdercolorstr = ['Color.Red', 'rgba(11, 234, 33, 0.98)', 'rgb(243, 11, 11, 1)', '0xffff0000', '#ffffff'] + controller1 = new TextAreaController() + fontsize = 16 + width = 200 + height = 50 + start: boolean = true + marqueeText: string = 'Running Marquee' + private fromStart: boolean = true + private step: number = 30 + private loop: number = 1 + marqueeUpdatestrategy = [MarqueeUpdateStrategy.PRESERVE_POSITION, MarqueeUpdateStrategy.DEFAULT] + marqueeUpdatestrategyindex = 0 + marqueeUpdatestrategystr = ['PRESERVE_POSITION', 'DEFAULT'] + scaleOptions: ScaleOptions | undefined = undefined + allowScaleVal: boolean | undefined = undefined + + async marqueeUpdateStrategy(): Promise { + this.marqueeUpdatestrategyindex++ + if (this.marqueeUpdatestrategyindex > this.marqueeUpdatestrategy.length - 1) { + this.marqueeUpdatestrategyindex = 0 + } + }; + + async updateContent(): Promise { + this.marqueeText = '改变后的内容111'; + this.allowScaleVal = undefined; + this.scaleOptions = { + x: 0.5, + y: 0.5 + } + } + + async allowScale(): Promise { + this.marqueeText = '改变后的内容222'; + this.allowScaleVal = true; + this.scaleOptions = { + x: 0.5, + y: 0.5 + } + } + + async notAllowScale(): Promise { + this.marqueeText = '改变后的内容333'; + this.allowScaleVal = false; + this.scaleOptions = { + x: 0.5, + y: 0.5 + } + } + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width('100%') + .height('100%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + + let col1 = typeNode.createNode(uiContext, 'Column'); + col1.initialize({ space: 5 }) + .width('100%') + .height('50%') + .alignItems(HorizontalAlign.Center) + .margin({ top: 5 }); + node.appendChild(col1); + + let marquee = typeNode.createNode(uiContext, "Marquee"); + marquee.initialize({ + start: this.start, + step: this.step, + loop: this.loop, + fromStart: this.fromStart, + src: this.marqueeText + }) + .allowScale(false) + .scale(this.scaleOptions) + .width(300) + .height(80) + .fontColor('#FFFFFF') + .fontSize(48) + .fontWeight(700) + .backgroundColor('#182431') + .margin({ bottom: 40 }) + .onStart(() => { + storage.set('onStart', 'onStart success'); + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + storage2.set('onBounce', 'onBounce success'); + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + storage3.set('onFinish', 'onFinish success'); + console.info('Marquee animation complete onFinish') + }) + col1.appendChild(marquee); + let button1 = typeNode.createNode(uiContext, 'Button') + button1.initialize("设置allowScale为undefined") + .id('button1') + .onClick(() => { + this.updateContent() + marquee.initialize({ + start: this.start, + step: 50, + loop: this.loop, + fromStart: this.fromStart, + src: this.marqueeText + }) + .allowScale(this.allowScaleVal) + .scale(this.scaleOptions) + .width(300) + .height(80) + .fontColor('#FFFFFF') + .fontSize(48) + .fontWeight(700) + .backgroundColor('#182431') + .margin({ bottom: 40 }) + }) + let button2 = typeNode.createNode(uiContext, 'Button') + button2.initialize("设置allowScale为true").id('button2') + .onClick(() => { + this.allowScale(); + marquee.initialize({ + start: this.start, + step: this.step, + loop: this.loop, + fromStart: this.fromStart, + src: this.marqueeText + }) + .allowScale(this.allowScaleVal) + .scale(this.scaleOptions) + .width(300) + .height(80) + .fontColor('#FFFFFF') + .fontSize(48) + .fontWeight(700) + .backgroundColor('#182431') + .margin({ bottom: 40 }) + .onFinish(async () => { + // await Utils.sleep(1000); + // await windowSnap.snapShot(); + // await Utils.sleep(1000); + }) + }) + let button3 = typeNode.createNode(uiContext, 'Button') + button3.initialize("设置allowScale为false").id('button3') + .onClick(() => { + this.notAllowScale(); + marquee.initialize({ + start: this.start, + step: this.step, + loop: this.loop, + fromStart: this.fromStart, + src: this.marqueeText + }) + .allowScale(this.allowScaleVal) + .scale(this.scaleOptions) + .width(300) + .height(80) + .fontColor('#FFFFFF') + .fontSize(48) + .fontWeight(700) + .backgroundColor('#182431') + .margin({ bottom: 40 }) + .onFinish(async () => { + // await Utils.sleep(1000); + // await windowSnap.snapShot(); + // await Utils.sleep(1000); + }) + }) + + col1.appendChild(button1) + col1.appendChild(button2) + col1.appendChild(button3) + + return node; + } +} + +@Entry +@Component +struct UIComponentFrameNodeTextReplacement0010 { + private myNodeController: MyNodeController4 = new MyNodeController4(); + @State changeAppear: string = '点我' + @State text1: string = 'Callback 结果:\n'; + + build() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('case0590') + .onClick(() => { + this.text1 = storage.get('onStart') as string + }) + .id('button4') + Button('case0600') + .onClick(() => { + this.text1 = storage2.get('onBounce') as string + }) + .id('button5') + Button('case0610') + .onClick(() => { + this.text1 = storage3.get('onFinish') as string + }) + .id('button6') + } + + Row() { + Text(this.text1) + .fontColor(Color.Red) + .fontSize(20) + .margin(10) + .width('92%') + .height(100) + .borderWidth(2) + } + + NodeContainer(this.myNodeController); + } + .width('100%') + .height('100%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + .margin({ top: 5 }); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100.ets new file mode 100755 index 00000000..757f8eb9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100.ets @@ -0,0 +1,396 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, typeNode } from '@ohos.arkui.node'; + +let para: Record = { 'onWillInsert': '' }; +let storage: LocalStorage = new LocalStorage(para); + +class MyNodeController4 extends NodeController { + text = "The text area can hold" + placeholder = 'The text area can hold an unlimited amount of text. input your word...' + placeholdercolor = [Color.Red, 'rgba(11, 234, 33, 0.98)', 'rgb(243, 11, 11, 1)', 0xffff0000, '#ffffff'] + placeholdercolorindex = 0 + placeholdercolorstr = ['Color.Red', 'rgba(11, 234, 33, 0.98)', 'rgb(243, 11, 11, 1)', '0xffff0000', '#ffffff'] + controller1 = new TextAreaController() + fontsize = 25 + width = 200 + height = 100 + caretColor: number | string | Resource | undefined = undefined + enableKeyboardOnFocus: boolean | undefined = undefined + resMsg: string = 'callback 结果:\n'; + cutMsg: string = ''; + selectChangeMsg: string = ''; + willDelMsg: string = ''; + didDelMsg: string = ''; + deleteValue: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width('100%') + .height('100%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + + let col1 = typeNode.createNode(uiContext, 'Column'); + col1.initialize({ space: 5 }) + .width('100%') + .height('95%') + .alignItems(HorizontalAlign.Center) + .margin(5); + node.appendChild(col1); + let row1 = typeNode.createNode(uiContext, 'Row'); + row1.initialize({ space: 5 }) + .width('100%') + .alignItems(VerticalAlign.Center) + .margin(5); + let row2 = typeNode.createNode(uiContext, 'Row'); + row2.initialize({ space: 5 }) + .width('100%') + .alignItems(VerticalAlign.Center) + .margin(5); + let row3 = typeNode.createNode(uiContext, 'Row'); + row3.initialize({ space: 5 }) + .width('100%') + .alignItems(VerticalAlign.Center) + .margin(5); + let row4 = typeNode.createNode(uiContext, 'Row'); + row4.initialize({ space: 5 }) + .width('100%') + .alignItems(VerticalAlign.Center) + .margin(5); + let row5 = typeNode.createNode(uiContext, 'Row'); + row5.initialize({ space: 5 }) + .width('100%') + .alignItems(VerticalAlign.Center) + .margin(5); + let row6 = typeNode.createNode(uiContext, 'Row'); + row6.initialize({ space: 5 }) + .width('100%') + .alignItems(VerticalAlign.Center) + .margin(5); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize(this.resMsg) + .fontColor(Color.Red) + .fontSize(20) + .margin(10) + .width('92%') + let textarea = typeNode.createNode(uiContext, 'TextArea'); + textarea.initialize({ + text: 'This is ss01 on : 0123456789', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea')// .fontColor(Color.Blue) + .placeholderColor(undefined) + .selectionMenuHidden(undefined) + .fontSize(this.fontsize) + .fontFeature("\"ss01\" on") + .selectedBackgroundColor(Color.Yellow) + .enablePreviewText(false) + .height(this.height) + .caretColor(undefined) + .onWillDelete((info: DeleteValue) => { + console.log("onWillDelete " + info.deleteValue + 'offset ' + info.deleteOffset + ' ' + info.direction) + this.deleteValue = info.deleteValue + this.willDelMsg = 'onWillDelete: {' + info.deleteValue + '}'; + return true + }) + .onDidDelete((info: DeleteValue) => { + console.log("onDidDelete " + info.deleteValue + 'offset ' + info.deleteOffset + ' ' + info.direction) + this.didDelMsg = 'onDidDelete: { value=' + info.deleteValue + ' ,offset=' + info.deleteOffset + '}'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange,文本起始位置为:' + selectionStart + ',结束位置为:' + selectionEnd) + this.selectChangeMsg = + 'onTextSelectionChange: {文本起始位置为:' + selectionStart + ',结束位置为:' + selectionEnd + '}'; + }) + .onCut((value: string) => { + console.log('onCut: ' + value); + this.cutMsg = 'onCut: ' + value; + }) + + let button1 = typeNode.createNode(uiContext, 'Button') + button1.initialize("case0100_1") + .id('button1') + .onClick(() => { + textarea.initialize({ + text: 'Text:caretColor为Green', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').caretColor(Color.Green) + }) + let button2 = typeNode.createNode(uiContext, 'Button') + button2.initialize("case0100_2").id('button2') + .onClick(() => { + textarea.initialize({ + text: 'Text:caretColor为0xff0000', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').caretColor(0xff0000) + }) + let button3 = typeNode.createNode(uiContext, 'Button') + button3.initialize("case0100_3").id('button3') + .onClick(() => { + textarea.initialize({ + text: 'Text:caretColor为colorBlack', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').caretColor($r('app.color.colorBlack')) + }) + let button4 = typeNode.createNode(uiContext, 'Button') + button4.initialize("case0160").id('button4') + .onClick(() => { + textarea.initialize({ + text: 'Text:enableKeyboardOnFocus为true', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').enableKeyboardOnFocus(true) + }) + let button5 = typeNode.createNode(uiContext, 'Button') + button5.initialize("case0170").id('button5') + .onClick(() => { + textarea.initialize({ + text: 'Text:enableKeyboardOnFocus为false', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').enableKeyboardOnFocus(false) + }) + let button6 = typeNode.createNode(uiContext, 'Button') + button6.initialize("case0180").id('button6') + .onClick(() => { + textarea.initialize({ + text: 'Text:enableKeyboardOnFocus为undefined', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').enableKeyboardOnFocus(undefined) + }) + let button7 = typeNode.createNode(uiContext, 'Button') + button7.initialize("case0210").id('button7') + .onClick(() => { + textarea.initialize({ + text: 'Text:selectionMenuHidden为false', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').selectionMenuHidden(undefined) + }) + let button8 = typeNode.createNode(uiContext, 'Button') + button8.initialize("case0250").id('button8') + .onClick(() => { + textarea.initialize({ + text: 'Text:enableAutoFill为true', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').contentType(ContentType.EMAIL_ADDRESS).enableAutoFill(true) + }) + let button9 = typeNode.createNode(uiContext, 'Button') + button9.initialize("case0260").id('button9') + .onClick(() => { + textarea.initialize({ + text: 'Text:enableAutoFill为false', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').contentType(ContentType.FULL_STREET_ADDRESS).enableAutoFill(false) + }) + let button10 = typeNode.createNode(uiContext, 'Button') + button10.initialize("case0270").id('button10') + .onClick(() => { + textarea.initialize({ + text: 'Text:enableAutoFill为undefined', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').contentType(ContentType.FULL_STREET_ADDRESS).enableAutoFill(undefined) + }) + let button11 = typeNode.createNode(uiContext, 'Button') + button11.initialize("case0280").id('button11') + .onClick(() => { + textarea.initialize({ + text: 'Text:ContentType.EMAIL_ADDRESS', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').contentType(ContentType.EMAIL_ADDRESS) + /*.contentType(ContentType.USER_NAME、PASSWORD、NEW_PASSWORD、FULL_STREET_ADDRESS、HOUSE_NUMBER、DISTRICT_ADDRESS、CITY_ADDRESS、PROVINCE_ADDRESS、COUNTRY_ADDRESS、PERSON_FULL_NAME、PERSON_LAST_NAME、PERSON_FIRST_NAME、PHONE_NUMBER、PHONE_COUNTRY_CODE、FULL_PHONE_NUMBER、EMAIL_ADDRESS、BANK_CARD_NUMBER、ID_CARD_NUMBER、NICKNAME、DETAIL_INFO_WITHOUT_STREET、FORMAT_ADDRESS)*/ + }) + let button12_1 = typeNode.createNode(uiContext, 'Button') + button12_1.initialize("case0360_1").id('button12_1') + .onClick(() => { + textarea.initialize({ + text: 'Text:caretStyle为{ width: 20, color: Color.Green}', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').caretStyle({ width: 20, color: Color.Green }) + }) + let button12_2 = typeNode.createNode(uiContext, 'Button') + button12_2.initialize("case0360_2").id('button12_2') + .onClick(() => { + textarea.initialize({ + text: 'Text:caretStyle为{ width: 20, color: 0xff0000}', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').caretStyle({ width: 20, color: 0xff0000 }) + }) + let button12_3 = typeNode.createNode(uiContext, 'Button') + button12_3.initialize("case0360_3").id('button12_3') + .onClick(() => { + textarea.initialize({ + text: 'Text:caretStyle为{ width: 20, color: colorBlack}', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea').caretStyle({ width: 20, color: $r('app.color.colorBlack') }) + }) + let button13 = typeNode.createNode(uiContext, 'Button') + button13.initialize("case0480").id('button13') + .onClick(() => { + this.resMsg += this.cutMsg; + text.initialize(this.resMsg) + .fontColor(Color.Red) + .fontSize(20) + .margin(10) + .borderWidth(2) + }) + let button14 = typeNode.createNode(uiContext, 'Button') + button14.initialize("case0500").id('button14') + .onClick(() => { + this.resMsg += this.selectChangeMsg; + text.initialize(this.resMsg) + .fontColor(Color.Red) + .fontSize(20) + .margin(10) + .borderWidth(2) + }) + let button15 = typeNode.createNode(uiContext, 'Button') + button15.initialize("case0550").id('button15') + .onClick(() => { + this.resMsg += this.willDelMsg; + text.initialize(this.resMsg) + .fontColor(Color.Red) + .fontSize(20) + .margin(10) + .borderWidth(2) + }) + let button16 = typeNode.createNode(uiContext, 'Button') + button16.initialize("case0560").id('button16') + .onClick(() => { + this.resMsg += this.didDelMsg; + text.initialize(this.resMsg) + .fontColor(Color.Red) + .fontSize(20) + .margin(10) + .borderWidth(2) + }) + let button17 = typeNode.createNode(uiContext, 'Button') + button17.initialize("case0570").id('button17') + .onClick(() => { + textarea + .initialize({ + text: 'Text:通用属性', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea') + .width(336) + .height(56) + .margin(20) + .padding(10) + .enabled(true) + }) + let button18 = typeNode.createNode(uiContext, 'Button') + button18.initialize("case0580").id('button18') + .onClick(() => { + textarea + .initialize({ + text: 'Text:onDidDelete callback', + placeholder: this.placeholder, + controller: this.controller1 + }) + .id('textArea') + .onDidDelete((info: DeleteValue) => { + console.log("testTag onDidDelete " + info.deleteValue + 'offset ' + info.deleteOffset + ' ' + + info.direction) + this.resMsg += 'onDidDelete: { value=' + info.deleteValue + ' ,offset=' + info.deleteOffset + '}'; + text.initialize(this.resMsg) + .fontColor(Color.Red) + .fontSize(20) + .margin(10) + .borderWidth(2) + }) + }) + + col1.appendChild(row2); + col1.appendChild(row5); + col1.appendChild(text); + col1.appendChild(textarea); + row1.appendChild(button1); + row1.appendChild(button2); + row1.appendChild(button3); + col1.appendChild(row1); + row2.appendChild(button4); + row2.appendChild(button5); + row2.appendChild(button6); + row2.appendChild(button7); + row3.appendChild(button8); + row3.appendChild(button9); + row3.appendChild(button10); + row3.appendChild(button11); + col1.appendChild(row3); + row4.appendChild(button12_1); + row4.appendChild(button12_2); + row4.appendChild(button12_3); + col1.appendChild(row4); + row5.appendChild(button13); + row5.appendChild(button14); + row5.appendChild(button15); + row5.appendChild(button16); + row6.appendChild(button17); + // row6.appendChild(button18); + col1.appendChild(row6); + return node; + } +} + +@Entry +@Component +struct UIComponentFrameNodeTextReplacement0100 { + private myNodeController: MyNodeController4 = new MyNodeController4(); + @State changeAppear: string = '点我' + @State text1: string = ''; + + build() { + Column() { + NodeContainer(this.myNodeController); + } + .width('100%') + .height('100%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + .margin({ top: 5 }); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidModeReplacement/UIComponentInputKeyboardAvoidMode0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidModeReplacement/UIComponentInputKeyboardAvoidMode0160.ets new file mode 100755 index 00000000..fe09da72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidModeReplacement/UIComponentInputKeyboardAvoidMode0160.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0160 { + build() { + Column({ space: 20 }) { + TextArea({ text: '这是TextArea' }) + .id('KeyboardAvoidMode0160_3') + .width('90%') + .fontSize(15) + .maxLines(1) + Search({ value: '这是Search' }) + .id('KeyboardAvoidMode0160_5') + .width('90%') + .borderWidth(3) + TextInput({ text: '这是TextInput' }) + .id('KeyboardAvoidMode0160_4') + .width('90%') + .fontSize(15) + .maxLines(1) + Button('OFFSET_WITH_CARET') + .id('KeyboardAvoidMode0160_1') + .onClick(() => { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET); + }) + Button('RESIZE_WITH_CARET') + .id('KeyboardAvoidMode0160_2') + .onClick(() => { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE_WITH_CARET); + }).margin({ + bottom: 200 + }) + } + .alignItems(HorizontalAlign.Center) + .width('100%') + .height('100%') + .justifyContent(FlexAlign.End) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020.ets new file mode 100755 index 00000000..9f82a61a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020.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 { KeyCode } from '@kit.InputKit' + +@Entry +@Component +struct UIComponentOnSubmitReplacement0020 { + @State text: string = 'TextInput:test keepEditableState' + @State enterKey: string = 'Go' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State nextKey: number = EnterKeyType.Go + @State nextKeyStr: string = 'Go' + @State curKeyStr: string = 'Go' + @State curKey: number = EnterKeyType.Go + @State testRes: string = '' + @State subText: string | undefined = '' + @State taEvent: SubmitEvent | undefined = undefined; + @State taType: TextAreaType | undefined = undefined; + @State taStyle: TextContentStyle | undefined = undefined; + @State isKeep: boolean = false; + @State seType: SearchType | undefined = undefined; + @State seVisible: Visibility | undefined = undefined; + @State taVisible: Visibility | undefined = undefined; + @State searchButtonVal: string | undefined = undefined; + + build() { + Column({ space: 10 }) { + TextArea({ text: this.text }) + .id('OnSubmitReplacement0020') + .width('90%') + .visibility(this.taVisible) + .enterKeyType(this.nextKey) + .type(this.taType) + .style(this.taStyle) + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && ((KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode) || (KeyCode.KEYCODE_ENTER == event.keyCode))) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((enterKeyType: EnterKeyType, event?: SubmitEvent) => { + if (this.isKeep) { + event?.keepEditableState(); + } + this.taEvent = event; + this.subText = event?.text; + this.enterKeyType = enterKeyType.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKeyType == this.enterKeyTypeNum[index]) { + this.testRes += '\n{' + this.enterKeyTypeStr[index] + ',callback from onSubmit' + ',submit text=' + + this.subText + '}'; + } + } + }) + Search({ value: this.text }) + .searchButton(this.searchButtonVal) + .id('OnSubmitReplacement0020_2') + .width('90%') + .visibility(this.seVisible) + .enterKeyType(this.nextKey) + .type(this.seType) + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && ((KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode) || (KeyCode.KEYCODE_ENTER == event.keyCode))) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((searchContent: string, event?: SubmitEvent) => { + if (this.isKeep) { + event?.keepEditableState(); + } + this.taEvent = event; + this.subText = event?.text; + this.testRes += '\n{' + this.curKeyStr + ',callback from onSubmit' + ',submit text=' + + this.subText + '}'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Divider().color(Color.Red).height(2).width('96%').margin(20); + + Row({ space: 10 }) { + Button('case0010').stateEffect(true).onClick(() => { + this.seVisible = Visibility.None; + this.text = 'TextArea:test switch enterKeyType and keepEditableState'; + this.isKeep = true; + }) + Button('case0020').stateEffect(true).onClick(() => { + this.seVisible = Visibility.None; + this.text = 'TextArea:test switch enterKeyType and keepEditableState'; + this.isKeep = false; + }) + Button('case0030').onClick(() => { + //切换输入框类型 + this.seVisible = Visibility.None; + this.taType = TextAreaType.NUMBER; + // this.text = 'TextArea:test switch TextAreaType and keepEditableState'; + this.text = '4545shda4twe8908fgiuwejfoi6349790w7097902u9079084390'; + this.isKeep = true; + }) + Button('case0040').onClick(() => { + this.seVisible = Visibility.None; + this.taStyle = TextContentStyle.INLINE; + this.text = 'TextArea:test TextContentStyle.INLINE and keepEditableState'; + this.isKeep = true; + }) + }.borderWidth(3).borderColor(Color.Blue).visibility(this.taVisible) + + Row({ space: 10 }) { + Button('case0050').stateEffect(true).onClick(() => { + this.taVisible = Visibility.None; + this.text = 'Search:test switch enterKeyType and keepEditableState'; + this.isKeep = true; + }) + Button('case0060').onClick(() => { + this.taVisible = Visibility.None; + this.searchButtonVal = 'SEARCH'; + this.text = 'Search:test enterKeyType and keepEditableState and searchButton'; + this.isKeep = true; + }) + Button('case0070').onClick(() => { + this.taVisible = Visibility.None; + this.searchButtonVal = 'SEARCH'; + this.text = 'Search:test enterKeyType and no keepEditableState and searchButton'; + this.isKeep = false; + }) + }.borderWidth(3).borderColor(Color.Blue).visibility(this.seVisible) + + Row({ space: 10 }) { + Button('case0080').onClick(() => { + this.taVisible = Visibility.None; + this.searchButtonVal = 'SEARCH'; + this.text = 'Search:test set searchButton and no keepEditableState'; + this.isKeep = false; + }) + Button('case0090').onClick(() => { + this.taVisible = Visibility.None; + this.searchButtonVal = 'SEARCH'; + this.seType = SearchType.NUMBER; + // this.text = 'Search:test switch SearchType and keepEditableState'; + this.text = '4545shda4twe8908fgiuwejfoi6349790w7097902u9079084390'; + this.isKeep = true; + }) + Button('case0100').onClick(() => { + this.taVisible = Visibility.Visible; + this.seVisible = Visibility.Visible; + this.text = 'TextArea/Search:test keepEditableState'; + this.isKeep = true; + }) + }.borderWidth(3).borderColor(Color.Blue).visibility(this.seVisible) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0090.ets new file mode 100755 index 00000000..bdd1d051 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0090.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. + */ +import { KeyCode } from '@kit.InputKit' + +@Entry +@Component +struct UIComponentOnSubmitReplacement0090 { + @State text: string = 'TextInput:test keepEditableState' + @State enterKey: string = 'Go' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State nextKey: number = EnterKeyType.Go + @State nextKeyStr: string = 'Go' + @State curKeyStr: string = 'Go' + @State curKey: number = EnterKeyType.Go + @State testRes: string = '' + @State subText: string | undefined = '' + @State taEvent: SubmitEvent | undefined = undefined; + @State taType: TextAreaType | undefined = undefined; + @State taStyle: TextContentStyle | undefined = undefined; + @State isKeep: boolean = false; + @State seType: SearchType | undefined = undefined; + @State seVisible: Visibility | undefined = undefined; + @State taVisible: Visibility | undefined = undefined; + @State searchButtonVal: string | undefined = undefined; + + build() { + Column({ space: 10 }) { + Button('case0090').onClick(() => { + this.searchButtonVal = 'SEARCH'; + this.seType = SearchType.NUMBER; + // this.text = 'Search:test switch SearchType and keepEditableState'; + this.text = '4545shda4twe8908fgiuwejfoi6349790w7097902u9079084390'; + }) + Search({ value: this.text }) + .searchButton('SEARCH') + .id('OnSubmitReplacement0020_2') + .width('90%') + .visibility(this.seVisible) + .enterKeyType(this.nextKey) + .type(this.seType) + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && ((KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode) || (KeyCode.KEYCODE_ENTER == event.keyCode))) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((searchContent: string, event?: SubmitEvent) => { + event?.keepEditableState(); + this.taEvent = event; + this.subText = event?.text; + this.testRes += '\n{' + this.curKeyStr + ',callback from onSubmit' + ',submit text=' + + this.subText + '}'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Divider().color(Color.Red).height(2).width('96%').margin(20); + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0010.ets new file mode 100755 index 00000000..2bacca22 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0010.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GlobalThis } from '../../../test/model/globalThis'; + +@Entry +@Component +struct UIComponentSetFontSizeScaleReplacement0010 { + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text('hello word hello word hello word ') + .width(500) + .height(100) + .id("text") + .onClick(()=>{ + let context= GlobalThis.getInstance().getContext("context") + let applicationContext = context?.getApplicationContext(); + applicationContext?.setFontSizeScale(0.5); + }) + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0150.ets new file mode 100755 index 00000000..cf8b8fc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0150.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GlobalThis } from '../../../test/model/globalThis'; + +@Entry +@Component +struct UIComponentSetFontSizeScaleReplacement0150 { + build() { + Column({ space: 5 }) { + Divider() + Text('hello word hello word hello word ') + .width(500) + .height(100) + .id("text") + .onClick(() => { + let context = GlobalThis.getInstance().getContext("context") + let applicationContext = context?.getApplicationContext(); + applicationContext?.setFontSizeScale(2.5); + }) + } + .border({ width: 1, radius: 5 }) + .width('100%') + .height('100%') + .id('column') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0160.ets new file mode 100755 index 00000000..e6bd49fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0160.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GlobalThis } from '../../../test/model/globalThis'; + +@Entry +@Component +struct UIComponentSetFontSizeScaleReplacement0160 { + build() { + Column({ space: 5 }) { + Divider() + Text('hello word hello word hello word ') + .width(500) + .height(100) + .id("text") + .onClick(() => { + let context = GlobalThis.getInstance().getContext("context") + let applicationContext = context?.getApplicationContext(); + applicationContext?.setFontSizeScale(2.5); + }) + } + .border({ width: 1, radius: 5 }) + .width('100%') + .height('100%') + .id('column') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001.ets new file mode 100755 index 00000000..c5749006 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import UDC from '@ohos.data.unifiedDataChannel'; +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentSpanInterface001 { + @State spanText: string = '这是Span组件内容' + @State spanToastMsg: string = 'span onclick' + + build() { + Column({ space: 8 }) { + Text() { + Span(this.spanText) + .id('UIComponentSpanInterface001_span_001') + .onClick(() => { + promptAction.showToast({ duration: 100, message: this.spanToastMsg }); + }) + } + .onDragStart((event) => { + }) + .onDragEnd((event) => { + if (event.getResult() === DragResult.DRAG_SUCCESSFUL) { + promptAction.showToast({ duration: 100, message: 'Drag Success' }); + } else if (event.getResult() === DragResult.DRAG_FAILED) { + promptAction.showToast({ duration: 100, message: 'Drag failed' }); + } + }) + .fontSize(30) + .draggable(true) + .copyOption(CopyOptions.InApp) + .key('UIComponentSpanInterface001_text_001') + + TextArea({placeholder:'这是提示文本'}).key('UIComponentSpanInterface001_textArea_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface002.ets new file mode 100755 index 00000000..f08cfaf0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface002.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. + */ + +@Entry +@Component +struct UIComponentSpanInterface002 { + + build() { + Column() { + Text('Span无参代码/编译报错') + .fontColor(Color.Red) + Image('testability/resources/span_null_param_error.png') + .width('100%') + } + .width('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface003.ets new file mode 100755 index 00000000..590879a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface003.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { inspector } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentSpanInterface003 { + @State isShow:number = Visibility.Hidden + build() { + Column() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) { + Row({ space: 5 }) { + Text('inspector 预览文本') + .height(56) + .visibility(this.isShow) + .border({ width: 1 }) + .id('UIComponentSpanInterface003_text_001') + } + } + }.height(320).width(360).padding({ right: 10, top: 10 }) + } + + listener:inspector.ComponentObserver = inspector.createComponentObserver('UIComponentSpanInterface003_text_001') + + aboutToAppear() { + let onLayoutComplete:()=>void=():void=>{ + this.isShow = Visibility.Visible + } + this.listener.on('layout', onLayoutComplete) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface004.ets new file mode 100755 index 00000000..e2c1205f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSpanInterface004.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. + */ + +import { drawing } from '@kit.ArkGraphics2D' +import { text } from "@kit.ArkGraphics2D" +import { image } from '@kit.ImageKit'; + +function textFunc() { + let myParagraphStyle: text.ParagraphStyle = { + align: text.TextAlign.END, + }; + let fontCollection = new text.FontCollection(); + let ParagraphGraphBuilder = new text.ParagraphBuilder(myParagraphStyle, fontCollection); + let paragraph = ParagraphGraphBuilder.build(); + + const color: ArrayBuffer = new ArrayBuffer(160000); + let opts: image.InitializationOptions = { editable: true, pixelFormat: 3, size: { height: 200, width: 200 } } + let pixelMap: image.PixelMap = image.createPixelMapSync(color, opts); + let canvas = new drawing.Canvas(pixelMap); + + paragraph.paint(canvas, 0, 0); +} + +@Entry +@Component +struct UIComponentSpanInterface004 { + @State text: string = 'Text:Test for Paragraph Paint' + @State res: string = 'After Copy:' + controller:TextInputController=new TextInputController() + + build() { + Column() { + Column() { + Column() { + Button('click').key('UIComponentSpanInterface004_button_001').onClick(()=>{ + textFunc() + }) + } + .width('100%') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0010.ets new file mode 100755 index 00000000..7578a5e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0010.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0010 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new HierarchicalSymbolEffect(),this.isActive) + + Button('播放 无参') + .onClick(() => { + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0010_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0011.ets new file mode 100755 index 00000000..eb971153 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0011.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 UIComponentSymbolGlyphInterface0011 { + @State isActive: boolean = false + @State effectFillStyle: number = EffectFillStyle.CUMULATIVE + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new HierarchicalSymbolEffect(this.effectFillStyle),this.isActive) + + Button('播放 CUMULATIVE') + .onClick(() => { + this.effectFillStyle = EffectFillStyle.CUMULATIVE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0011_button_001') + + Button('播放 ITERATIVE') + .onClick(() => { + this.effectFillStyle = EffectFillStyle.ITERATIVE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0011_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0012.ets new file mode 100755 index 00000000..aaa8fabb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0012.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0012 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new AppearSymbolEffect(),this.isActive) + + Button('播放 AppearSymbolEffect无参') + .onClick(() => { + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0012_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0013.ets new file mode 100755 index 00000000..e77ef19e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0013.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 UIComponentSymbolGlyphInterface0013 { + @State isActive: boolean = false + @State effectScope: number = EffectScope.LAYER + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new AppearSymbolEffect(this.effectScope),this.isActive) + + Button('播放 AppearSymbolEffect:LAYER') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0013_button_001') + + Button('播放 AppearSymbolEffect:WHOLE') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0013_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0014.ets new file mode 100755 index 00000000..6de06098 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0014.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0014 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new DisappearSymbolEffect(),this.isActive) + + Button('播放 DisappearSymbolEffect:无参') + .onClick(() => { + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0014_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0015.ets new file mode 100755 index 00000000..f003b1b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0015.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 UIComponentSymbolGlyphInterface0015 { + @State isActive: boolean = false + @State effectScope: number = EffectScope.LAYER + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new DisappearSymbolEffect(this.effectScope),this.isActive) + + Button('播放 DisappearSymbolEffect:LAYER') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0015_button_001') + + Button('播放 DisappearSymbolEffect:WHOLE') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0015_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0016.ets new file mode 100755 index 00000000..87e853ca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0016.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0016 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new BounceSymbolEffect(),this.isActive) + + Button('播放 BounceSymbolEffect:无参') + .onClick(() => { + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0016_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017.ets new file mode 100755 index 00000000..adb1bbc4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0017 { + @State isActive: boolean = false + @State effectScope: number = EffectScope.LAYER + @State effectDirection: number = EffectDirection.DOWN + + build() { + Column() { + SymbolGlyph($r('sys.symbol.camera_mode_underwater')) + .fontSize(96) + .symbolEffect(new BounceSymbolEffect(this.effectScope,this.effectDirection),this.isActive) + Button('LAYER播放 DOWN') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.effectDirection = EffectDirection.DOWN + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0017_button_001') + + Button('LAYER播放 UP') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.effectDirection = EffectDirection.UP + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0017_button_002') + + Button('WHOLE播放 DOWN') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.effectDirection = EffectDirection.DOWN + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0017_button_003') + + Button('WHOLE播放 UP') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.effectDirection = EffectDirection.UP + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0017_button_004') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0018.ets new file mode 100755 index 00000000..ad5e3696 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0018.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0018 { + @State isActive: boolean = false + replaceFlag: boolean = true; + build() { + Column() { + SymbolGlyph(this.replaceFlag ? $r('sys.symbol.checkmark_circle') : $r('sys.symbol.repeat_1')) + .fontSize(96) + .symbolEffect(new ReplaceSymbolEffect(),this.isActive) + + Button('播放 ReplaceSymbolEffect:无参') + .onClick(() => { + this.replaceFlag = !this.replaceFlag; + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0018_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0019.ets new file mode 100755 index 00000000..74a1d03e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0019.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. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0019 { + @State isActive: boolean = false + @State effectScope: number = EffectScope.LAYER + replaceFlag: boolean = true; + + build() { + Column() { + SymbolGlyph(this.replaceFlag ? $r('sys.symbol.checkmark_circle') : $r('sys.symbol.checkmark_square_on_square')) + .fontSize(96) + .symbolEffect(new ReplaceSymbolEffect(this.effectScope),this.isActive) + + Button('播放 ReplaceSymbolEffect:LAYER') + .onClick(() => { + this.replaceFlag = !this.replaceFlag; + this.effectScope = EffectScope.WHOLE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0019_button_001') + + Button('播放 ReplaceSymbolEffect:WHOLE') + .onClick(() => { + this.replaceFlag = !this.replaceFlag; + this.effectScope = EffectScope.WHOLE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0019_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0020.ets new file mode 100755 index 00000000..d23f1820 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0020.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0020 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.wifi')) + .fontSize(96) + .symbolEffect(new PulseSymbolEffect(),this.isActive) + + Button('播放 PulseSymbolEffect:无参') + .onClick(() => { + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0020_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0021.ets new file mode 100755 index 00000000..a8a8e3df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0021.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' +@Entry +@Component +struct UIComponentSymbolGlyphInterface0021 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.wifi')) + .fontSize(96) + .symbolEffect(new ScaleSymbolEffect()) + + Button('播放 active=null无动效') + .onClick(() => { + promptAction.showToast({ + message: 'active=null无动效', + duration: 2000, + }) + }) + .width('100%') + + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0021_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0022.ets new file mode 100755 index 00000000..ad3cfe57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0022.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' +@Entry +@Component +struct UIComponentSymbolGlyphInterface0022 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.camera_panorama')) + .fontSize(96) + .symbolEffect(new ScaleSymbolEffect()) + + Button('播放 triggerValue不设置无动效') + .onClick(() => { + promptAction.showToast({ + message: '无动效', + duration: 2000, + }) + }) + .width('100%') + + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0022_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023.ets new file mode 100755 index 00000000..c65f8a7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023.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 UIComponentSymbolGlyphInterface0023 { + + @State effectScope: number = EffectScope.LAYER + @State effectDirection: number = EffectDirection.DOWN + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new ScaleSymbolEffect(this.effectScope,this.effectDirection),this.triggerValueReplace) + Button('LAYER播放 DOWN trigger测试') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.effectDirection = EffectDirection.DOWN + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0023_button_001') + + Button('LAYER播放 UP trigger测试') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.effectDirection = EffectDirection.UP + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0023_button_002') + + Button('WHOLE播放 DOWN trigger测试') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.effectDirection = EffectDirection.DOWN + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0023_button_003') + + Button('WHOLE播放 UP trigger测试') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.effectDirection = EffectDirection.UP + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0023_button_004') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0024.ets new file mode 100755 index 00000000..fd51d539 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0024.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0024 { + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new ScaleSymbolEffect(),this.triggerValueReplace) + Button('播放 trigger测试 ScaleSymbolEffect无参') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0024_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0025.ets new file mode 100755 index 00000000..c56cb567 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0025.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0025 { + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new HierarchicalSymbolEffect(),this.triggerValueReplace) + Button('播放 trigger测试 HierarchicalSymbolEffect无参') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0025_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0026.ets new file mode 100755 index 00000000..baa1e6ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0026.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0026 { + @State triggerValueReplace: number = 0; + @State effectFillStyle: number = EffectFillStyle.CUMULATIVE + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new HierarchicalSymbolEffect(this.effectFillStyle),this.triggerValueReplace) + Button('CUMULATIVE播放 trigger测试') + .onClick(() => { + this.effectFillStyle = EffectFillStyle.CUMULATIVE + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0026_button_001') + + Button('ITERATIVE播放 trigger测试') + .onClick(() => { + this.effectFillStyle = EffectFillStyle.ITERATIVE + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0026_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0027.ets new file mode 100755 index 00000000..afeb991d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0027.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0027 { + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new AppearSymbolEffect(),this.triggerValueReplace) + Button('播放 trigger测试 AppearSymbolEffect无参') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0027_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0028.ets new file mode 100755 index 00000000..cf69c39b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0028.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0028 { + @State triggerValueReplace: number = 0; + @State effectCope: number = EffectScope.LAYER + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new AppearSymbolEffect(this.effectCope),this.triggerValueReplace) + Button('LAYER播放 trigger测试') + .onClick(() => { + this.effectCope = EffectScope.LAYER + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0028_button_001') + + Button('WHOLE播放 trigger测试') + .onClick(() => { + this.effectCope = EffectScope.WHOLE + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0028_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0029.ets new file mode 100755 index 00000000..fbbe2ce9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0029.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0029 { + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new DisappearSymbolEffect(),this.triggerValueReplace) + Button('播放 trigger测试 DisappearSymbolEffect无参') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0029_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0030.ets new file mode 100755 index 00000000..a84faae2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0030.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0030 { + @State triggerValueReplace: number = 0; + @State effectCope: number = EffectScope.LAYER + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new DisappearSymbolEffect(this.effectCope),this.triggerValueReplace) + Button('LAYER播放 trigger测试') + .onClick(() => { + this.effectCope = EffectScope.LAYER + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0030_button_001') + + Button('WHOLE播放 trigger测试') + .onClick(() => { + this.effectCope = EffectScope.WHOLE + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0030_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031.ets new file mode 100755 index 00000000..97e47c12 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031.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 UIComponentSymbolGlyphInterface0031 { + + @State effectScope: number = EffectScope.LAYER + @State effectDirection: number = EffectDirection.DOWN + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new BounceSymbolEffect(this.effectScope,this.effectDirection),this.triggerValueReplace) + Button('LAYER播放 DOWN trigger测试') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.effectDirection = EffectDirection.DOWN + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0031_button_001') + + Button('LAYER播放 UP trigger测试') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.effectDirection = EffectDirection.UP + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0031_button_002') + + Button('WHOLE播放 DOWN trigger测试') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.effectDirection = EffectDirection.DOWN + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0031_button_003') + + Button('WHOLE播放 UP trigger测试') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.effectDirection = EffectDirection.UP + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0031_button_004') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0032.ets new file mode 100755 index 00000000..9e86fed2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0032.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0032 { + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new BounceSymbolEffect(),this.triggerValueReplace) + Button('播放 trigger测试 BounceSymbolEffect无参') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0032_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0033.ets new file mode 100755 index 00000000..e26b33de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0033.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0033 { + @State triggerValueReplace: number = 0; + replaceFlag: boolean = true + + build() { + Column() { + SymbolGlyph(this.replaceFlag ? $r('sys.symbol.checkmark_square') : $r('sys.symbol.checkmark_square_fill')) + .fontSize(96) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValueReplace) + Button('播放 trigger测试 ReplaceSymbolEffect无参') + .onClick(() => { + this.replaceFlag = !this.replaceFlag + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0033_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0034.ets new file mode 100755 index 00000000..c733c003 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0034.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0034 { + @State triggerValueReplace: number = 0; + @State effectCope: number = EffectScope.LAYER + replaceFlag: boolean = true + + build() { + Column() { + SymbolGlyph(this.replaceFlag ? $r('sys.symbol.checkmark_square') : $r('sys.symbol.checkmark_square_fill')) + .fontSize(96) + .symbolEffect(new ReplaceSymbolEffect(this.effectCope), this.triggerValueReplace) + Button('LAYER播放 trigger测试') + .onClick(() => { + this.replaceFlag = !this.replaceFlag + this.effectCope = EffectScope.LAYER + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0034_button_001') + + Button('WHOLE播放 trigger测试') + .onClick(() => { + this.replaceFlag = !this.replaceFlag + this.effectCope = EffectScope.WHOLE + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0034_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0035.ets new file mode 100755 index 00000000..00e86a49 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0035.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0035 { + @State triggerValueReplace: number = 0; + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new PulseSymbolEffect(),this.triggerValueReplace) + Button('播放 trigger测试 PulseSymbolEffect无参') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0035_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0036.ets new file mode 100755 index 00000000..0ef6afa9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0036.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0036 { + @State triggerValue: number = 0 + @State replaceFlags: boolean = true + + build() { + Column() { + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.trash')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.trash') : $r('sys.symbol.trash_circle')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.trash')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.trash')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.trash_circle')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.trash_circle') : $r('sys.symbol.trash')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.trash_circle')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.trash_circle')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.picture')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.picture') : $r('sys.symbol.picture_on_square')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.picture')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.picture')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.folder_badge_plus')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.folder_badge_plus') : $r('sys.symbol.ohos_folder_badge_plus')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.folder_badge_plus')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.folder_badge_plus')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.ohos_lungs')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.ohos_lungs') : $r('sys.symbol.lung')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.ohos_lungs')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.ohos_lungs')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + Row() { + Column() { + Button('trigger:播放') + .onClick(() => { + this.replaceFlags = !this.replaceFlags + this.triggerValue = this.triggerValue + 1 + }).key('UIComponentSymbolGlyphInterface0036_button_001') + } + }.margin({top:20}) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0037.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0037.ets new file mode 100755 index 00000000..35baa7b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0037.ets @@ -0,0 +1,245 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0037 { + @State triggerValue: number = 0 + @State replaceFlags: boolean = true + + build() { + Column() { + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.arrow_up')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.arrow_up') : $r('sys.symbol.arrow_down')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.arrow_up')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.arrow_up')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.mic')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.mic') : $r('sys.symbol.mic_sound')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.mic')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.mic')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.circle')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.circle') : $r('sys.symbol.sq_circle_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.circle')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.circle')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.lock')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.lock') : $r('sys.symbol.lock_open')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.lock')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.lock')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.star')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.star') : $r('sys.symbol.star_shield')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.star')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.star')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.repeat_1')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.repeat_1') : $r('sys.symbol.repeat_play')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.repeat_1')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.repeat_1')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.speaker_slash')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.speaker_slash') : $r('sys.symbol.speaker_slash_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.speaker_slash')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.speaker_slash')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Button('trigger:播放') + .onClick(() => { + this.replaceFlags = !this.replaceFlags + this.triggerValue = this.triggerValue + 1 + }).key('UIComponentSymbolGlyphInterface0037_button_001') + } + }.margin({ top: 20 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0038.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0038.ets new file mode 100755 index 00000000..7fc4b62b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0038.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. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0038 { + @State triggerValue: number = 0 + @State replaceFlags: boolean = true + + build() { + Column() { + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.checkmark_circle')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.checkmark_circle') : $r('sys.symbol.checkmark_circle_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.checkmark_circle')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.checkmark_circle')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.play_circle_fill')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.play_circle_fill') : $r('sys.symbol.play_circle')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.play_circle_fill')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.play_circle_fill')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.speaker_plus')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.speaker_plus') : $r('sys.symbol.speaker_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.speaker_plus')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.speaker_plus')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.heart_slash')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.heart_slash') : $r('sys.symbol.heart')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.heart_slash')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.heart_slash')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.speaker_wave_3')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.speaker_wave_3') : $r('sys.symbol.speaker_wave_3_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.speaker_wave_3')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.speaker_wave_3')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Button('trigger:播放') + .onClick(() => { + this.replaceFlags = !this.replaceFlags + this.triggerValue = this.triggerValue + 1 + }).key('UIComponentSymbolGlyphInterface0038_button_001') + } + }.margin({ top: 20 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0039.ets new file mode 100755 index 00000000..f7b89c86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0039.ets @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSymbolGlyphInterface0039 { + @State triggerValue: number = 0 + @State replaceFlags: boolean = true + + build() { + Column() { + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.play_circle')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.play_circle') : $r('sys.symbol.play_circle_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.play_circle')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.play_circle')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.pause_circle')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.pause_circle') : $r('sys.symbol.pause_circle_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.pause_circle')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.pause_circle')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.play_fill')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.play_fill') : $r('sys.symbol.play')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.play_fill')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.play_fill')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Text("Disappear") + SymbolGlyph($r('sys.symbol.pause')) + .symbolEffect(new DisappearSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Replace") + SymbolGlyph(this.replaceFlags ? $r('sys.symbol.pause') : $r('sys.symbol.pause_fill')) + .symbolEffect(new ReplaceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Bounce") + SymbolGlyph($r('sys.symbol.pause')) + .symbolEffect(new BounceSymbolEffect(), this.triggerValue) + .fontSize(75) + } + + Column() { + Text("Scale") + SymbolGlyph($r('sys.symbol.pause')) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValue) + .fontSize(75) + } + } + + Row() { + Column() { + Button('trigger:播放') + .onClick(() => { + this.replaceFlags = !this.replaceFlags + this.triggerValue = this.triggerValue + 1 + }).key('UIComponentSymbolGlyphInterface0039_button_001') + } + }.margin({ top: 20 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0040.ets new file mode 100755 index 00000000..7e3115eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0040.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0040 { + @State triggerValueReplace: number = 0; + + build() { + Row() { + Column() { + Text('多次调用symbolEffect无动画效果') + SymbolGlyph($r('sys.symbol.trash')) + .fontSize(65) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValueReplace) + .symbolEffect(new HierarchicalSymbolEffect(), this.triggerValueReplace) + Button('trigger缩放') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0040_button_001') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0041.ets new file mode 100755 index 00000000..283a4456 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0041.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface0041 { + @State triggerValueReplace: number = 0; + + build() { + Column() { + Row() { + Column() { + Text('缩放') + SymbolGlyph($r('sys.symbol.ohos_folder_badge_plus')) + .fontSize(96) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR) + .fontColor([Color.Orange, Color.Green, Color.Red]) + .symbolEffect(new ScaleSymbolEffect(), this.triggerValueReplace) + } + + Column() { + Text('弹跳') + SymbolGlyph($r('sys.symbol.ohos_folder_badge_plus')) + .fontSize(96) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR) + .fontColor([Color.Orange, Color.Green, Color.Red]) + .symbolEffect(new BounceSymbolEffect(), this.triggerValueReplace) + } + } + + Row() { + Button('播放 trigger') + .onClick(() => { + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0041_button_001') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042.ets new file mode 100755 index 00000000..746c3022 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042.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 { inspector } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentSymbolGlyphInterface0042 { + @State triggerValueReplace: number = 0; + @State effectStrategy: number = SymbolEffectStrategy.NONE; + @State buttonColor001: number = Color.Gray; + @State buttonColor002: number = Color.Gray; + @State buttonColor003: number = Color.Gray; + + build() { + Column() { + Text('弹跳 SymbolEffectStrategy.NONE') + SymbolGlyph($r('sys.symbol.ohos_folder_badge_plus')) + .fontSize(96) + .effectStrategy(this.effectStrategy) + .symbolEffect(new BounceSymbolEffect(), this.triggerValueReplace) + Button('播放 trigger effectStrategy = NONE') + .onClick(() => { + this.buttonColor001 = Color.Orange; + this.buttonColor002 = Color.Gray + this.buttonColor003 = Color.Gray; + this.effectStrategy = SymbolEffectStrategy.NONE + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .backgroundColor(this.buttonColor001) + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0042_button_001') + + Button('播放 trigger effectStrategy = SCALE') + .onClick(() => { + this.buttonColor001 = Color.Gray; + this.buttonColor002 = Color.Orange + this.buttonColor003 = Color.Gray; + this.effectStrategy = SymbolEffectStrategy.SCALE + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .backgroundColor(this.buttonColor002) + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0042_button_002') + + Button('播放 trigger effectStrategy = HIERARCHICAL') + .onClick(() => { + this.buttonColor001 = Color.Gray; + this.buttonColor002 = Color.Gray + this.buttonColor003 = Color.Orange; + this.effectStrategy = SymbolEffectStrategy.HIERARCHICAL + this.triggerValueReplace = this.triggerValueReplace + 1 + }) + .backgroundColor(this.buttonColor003) + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface0042_button_003') + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface007.ets new file mode 100755 index 00000000..fb5e06ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface007.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' +@Entry +@Component +struct UIComponentSymbolGlyphInterface007 { + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(null) + Button('播放') + .onClick(() => { + promptAction.showToast({ + message: '未设置动效', + duration: 2000, + }) + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface007_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008.ets new file mode 100755 index 00000000..be66936e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008.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 UIComponentSymbolGlyphInterface008 { + @State isActive: boolean = false + @State effectScope: number = EffectScope.LAYER + @State effectDirection: number = EffectDirection.DOWN + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new ScaleSymbolEffect(this.effectScope,this.effectDirection),this.isActive) + Button('LAYER播放 DOWN') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface008_button_001') + + Button('LAYER播放 UP') + .onClick(() => { + this.effectScope = EffectScope.LAYER + this.effectDirection = EffectDirection.UP + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface008_button_002') + + Button('WHOLE播放 DOWN') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface008_button_003') + + Button('WHOLE播放 UP') + .onClick(() => { + this.effectScope = EffectScope.WHOLE + this.effectDirection = EffectDirection.UP + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface008_button_004') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface009.ets new file mode 100755 index 00000000..5485e025 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface009.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentSymbolGlyphInterface009 { + @State isActive: boolean = false + + build() { + Column() { + SymbolGlyph($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .symbolEffect(new ScaleSymbolEffect(),this.isActive) + Button('LAYER播放 无参') + .onClick(() => { + this.isActive = !this.isActive + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolGlyphInterface009_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface003.ets new file mode 100755 index 00000000..d5e3ea47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface003.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. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UIComponentSymbolSpanInterface003 { + @State message: string = 'SymbolSpan无copy属性,不支持通用属性' + + build() { + Column() { + Column() { + Text(this.message) + Text('设置Text的copyOption参数为CopyOptions.None') + Text() { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(96) + }.copyOption(CopyOptions.None) + .key('UIComponentSymbolSpanInterface003_text_001') + + Text("设置Text的copyOption参数为CopyOptions.LocalDevice") + Text() { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Normal) + .fontSize(96) + } + .copyOption(CopyOptions.LocalDevice) + .onCopy((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .key('UIComponentSymbolSpanInterface003_text_002') + + Text("设置Text的copyOption参数为CopyOptions.CROSS_DEVICE") + Text() { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Normal) + .fontSize(96) + } + .copyOption(CopyOptions.CROSS_DEVICE) + .onCopy((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .key('UIComponentSymbolSpanInterface003_text_003') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface004.ets new file mode 100755 index 00000000..c3178089 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface004.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 UIComponentSymbolSpanInterface004 { + @State message: string = 'SymbolSpan无copy属性,不支持通用属性' + private scrollerForScroll: Scroller = new Scroller() + @State isScrollNext: boolean = true + + build() { + Column() { + Column() { + Scroll(this.scrollerForScroll) { + Text() { + Span(this.message) + Span(this.message) + Span(this.message) + Span(this.message) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(120) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(296) + ImageSpan($r('app.media.app_icon')) + .height(300) + .width(100) + ImageSpan($r('app.media.app_icon')) + .height(100) + .width(300) + }.textAlign(TextAlign.Center) + .key('UIComponentSymbolSpanInterface004_text_001') + }.height(400) + .onScrollEdge((side: Edge) => { + if(side == Edge.Top){ + this.isScrollNext = true + } + }) + + Button('Scroll Text') + .onClick(() => { + if (this.scrollerForScroll.isAtEnd()) { + this.isScrollNext = false + } + this.scrollerForScroll.scrollPage({ next: this.isScrollNext }) + }) + .height(60) + .width(200) + .fontSize(20) + .margin(20) + .key('UIComponentSymbolSpanInterface004_button_001') + } + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface005.ets new file mode 100755 index 00000000..998cf940 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface005.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 UIComponentSymbolSpanInterface005 { + @State strategyValue: number = SymbolEffectStrategy.SCALE; + + build() { + Column() { + Text() { + SymbolSpan($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .fontColor([Color.Gray]) + .effectStrategy(this.strategyValue) + } + + Button('设置动效为SCALE') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.SCALE + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolSpanInterface005_button_001') + Button('设置动效为HIERARCHICAL') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.HIERARCHICAL + }) + .width('100%') + .fontSize(15) + .margin(20) + .key('UIComponentSymbolSpanInterface005_button_002') + Button('设置动效为NONE') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.NONE + }) + .width('100%') + .fontSize(15) + .key('UIComponentSymbolSpanInterface005_button_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface006.ets new file mode 100755 index 00000000..7c98a2ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface006.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 UIComponentSymbolSpanInterface006 { + @State strategyValue: number = SymbolEffectStrategy.SCALE; + + build() { + Column() { + Text() { + SymbolSpan($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .fontColor([Color.Gray]) + .effectStrategy(this.strategyValue) + Span('这是Span组件内容001') + .fontSize(16) + SymbolSpan($r('sys.symbol.wifi_router')) + .fontSize(96) + .fontColor([Color.Gray]) + .effectStrategy(this.strategyValue) + Span('这是Span组件内容002') + .fontSize(16) + } + + Button('设置动效为SCALE') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.SCALE + }) + .width('100%') + .fontSize(15) + .margin({ top: 20 }) + .key('UIComponentSymbolSpanInterface006_button_001') + Button('设置动效为HIERARCHICAL') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.HIERARCHICAL + }) + .width('100%') + .fontSize(15) + .margin(20) + .key('UIComponentSymbolSpanInterface006_button_002') + Button('设置动效为NONE') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.NONE + }) + .width('100%') + .fontSize(15) + .key('UIComponentSymbolSpanInterface006_button_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007.ets new file mode 100755 index 00000000..5e93dd05 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007.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 UIComponentSymbolSpanInterface007 { + @State strategyValue: number = SymbolEffectStrategy.SCALE; + @State visible: number = Visibility.None + + build() { + Column() { + Text() { + SymbolSpan($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .fontColor([Color.Gray]) + .effectStrategy(this.strategyValue) + Span('这是Span组件内容001') + .fontSize(16) + SymbolSpan($r('sys.symbol.wifi_router')) + .fontSize(96) + .fontColor([Color.Gray]) + .effectStrategy(this.strategyValue) + Span('这是Span组件内容002') + .fontSize(16) + } + Text() { + SymbolSpan($r('sys.symbol.card_badge_shield')) + .fontSize(96) + .fontColor([Color.Gray]) + .effectStrategy(this.strategyValue) + Span('这是Span组件内容003333') + .fontSize(16) + }.visibility(this.visible) + + Button('设置动效为SCALE') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.SCALE; + this.visible = Visibility.Visible; + }) + .width('100%') + .fontSize(15) + .margin({ top: 40 }) + .key('UIComponentSymbolSpanInterface007_button_001') + Button('设置动效为HIERARCHICAL') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.HIERARCHICAL; + this.visible = Visibility.Visible; + }) + .width('100%') + .fontSize(15) + .margin(40) + .key('UIComponentSymbolSpanInterface007_button_002') + Button('设置动效为NONE') + .onClick(() => { + this.strategyValue = SymbolEffectStrategy.NONE; + this.visible = Visibility.Visible; + }) + .width('100%') + .fontSize(15) + .margin(40) + .key('UIComponentSymbolSpanInterface006_button_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement.ets new file mode 100755 index 00000000..0d71ec28 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentTextCommonClickReplacement { + @State letterSpacing: number | undefined = undefined + @State longMsg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台\n" + + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台\n" + + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台\n" + @State msg: string = 'ready to test Three blows'; + @State copyOptions: CopyOptions | undefined = undefined; + @State textIndent: Dimension | undefined = undefined; + @State textAlign: TextAlign | undefined = undefined; + @State editMsg: string = 'onEditChange测试结果:\n'; + @State isEditTest: boolean = false; + + build() { + Column({ space: 20 }) { + if (this.isEditTest) { + Text(this.editMsg).width('90%') + .fontSize(20).fontColor(Color.Brown) + } + TextArea({ text: this.msg }) + .id('ClickReplacement_1') + .width('90%') + .fontSize(15) + .maxLines(15) + .letterSpacing(this.letterSpacing) + .borderWidth(2) + .borderColor(Color.Blue) + .textIndent(this.textIndent) + .textAlign(this.textAlign) + .copyOption(this.copyOptions) + .onFocus(() => { + this.editMsg += 'HasFocus Test:\n' + }) + .onEditChange((isEditing: boolean) => { + this.editMsg += (isEditing) ? 'onEditChange callback!\n' : ''; + }) + Search({ value: this.msg }) + .id('ClickReplacement_2') + .width('90%') + .borderWidth(3) + TextInput({ text: this.msg }) + .id('ClickReplacement_3') + .width('90%') + .fontSize(15) + .borderWidth(2) + .borderColor(Color.Green) + + Row({ space: 10 }) { + Button('设置letterSpacing') + .id('ClickReplacement_4').stateEffect(true).onClick(() => { + this.letterSpacing = 3; + }) + Button('设置长文本') + .id('ClickReplacement_5').stateEffect(true).onClick(() => { + this.msg = this.longMsg; + }) + }.width('100%') + + Row({ space: 10 }) { + Button('设置InApp') + .id('ClickReplacement_6').stateEffect(true).onClick(() => { + this.copyOptions = CopyOptions.InApp; + }) + Button('设置None') + .id('ClickReplacement_7').stateEffect(true).onClick(() => { + this.copyOptions = CopyOptions.None; + }) + Button('设置LocalDevice') + .id('ClickReplacement_8').stateEffect(true).onClick(() => { + this.copyOptions = CopyOptions.LocalDevice; + }) + }.width('100%') + + Row({ space: 10 }) { + Button('设置textIndent') + .id('ClickReplacement_9').stateEffect(true).onClick(() => { + this.textIndent = 50; + }) + Button('设置TextAlign') + .id('ClickReplacement_10').stateEffect(true).onClick(() => { + this.textAlign = TextAlign.Center; + }) + Button('onEditChange测试') + .id('ClickReplacement_11').stateEffect(true).onClick(() => { + this.isEditTest = true; + }) + }.width('100%') + + } + + .alignItems + (HorizontalAlign + .Center + ).width + ('100%' + ).height + ('95%' + ) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010.ets new file mode 100755 index 00000000..f69550f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextCommonClickReplacement0010 { + @State text: string = 'This-is-test-text.This-is-te.'; + @State callback: string = 'onTextSelectionChange log :'; + + build() { + Column() { + TextArea({ text: this.text }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.callback = + 'log :' + 'selectionStart: ' + selectionStart + ' selectionEnd: ' + selectionEnd; + }).width(300).id('UIComponentTextCommonClickReplacement0010_001') + TextInput({ text: this.text }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.callback = + 'log :' + 'selectionStart: ' + selectionStart + ' selectionEnd: ' + selectionEnd; + }).width(300) + .margin(30) + .id('UIComponentTextCommonClickReplacement0010_002') + Search({ value: this.text }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.callback = + 'log :' + 'selectionStart: ' + selectionStart + ' selectionEnd: ' + selectionEnd; + }).id('UIComponentTextCommonClickReplacement0010_003') + + Text(this.callback).margin(10) + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0020.ets new file mode 100755 index 00000000..9e172e74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0020.ets @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextCommonClickReplacement0020 { + @State text: string = + 'This-is-test-text.\nThis-is-te.\nThis-is-test-text.This-is-test-text.This-is-test-text.\nThis-is-test-text.'; + + build() { + Column() { + TextArea({ text: this.text }).width(300).id('UIComponentTextCommonClickReplacement0020_001') + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0080.ets new file mode 100755 index 00000000..300e9dd1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0080.ets @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextCommonClickReplacement0080 { + @State text: string = 'This-is-test-text.This-is-test-text.This-is-test-text.'; + + build() { + Column() { + TextArea({ text: this.text }).width(300).height(30).id('UIComponentTextCommonClickReplacement0080_001') + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090.ets new file mode 100755 index 00000000..acd11f5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090.ets @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextCommonClickReplacement0090 { + @State text: string = + 'This-is-test-text.\nThis-is-te.\nThis-is-test-text.This-is-test-text.This-is-test-text.\nThis-is-test-text.'; + + build() { + Column() { + TextArea({ text: this.text }).width(300).id('UIComponentTextCommonClickReplacement0090_001') + TextInput({ text: this.text }) + .width(300).id('UIComponentTextCommonClickReplacement0090_002') + .margin(20) + Search({ value: this.text }).width(300).id('UIComponentTextCommonClickReplacement0090_003') + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0100.ets new file mode 100755 index 00000000..4081043f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0100.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. + */ + +@Entry +@Component +struct UIComponentTextCommonClickReplacement0100 { + @State text: string = ''; + + build() { + Column() { + TextArea({ text: this.text }).width(300).id('UIComponentTextCommonClickReplacement0100_001') + TextInput({ text: this.text }) + .width(300).id('UIComponentTextCommonClickReplacement0100_002') + .margin(20) + Search({ value: this.text }).width(300).id('UIComponentTextCommonClickReplacement0100_003') + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0110.ets new file mode 100755 index 00000000..1ae73d6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0110.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. + */ + +@Entry +@Component +struct UIComponentTextCommonClickReplacement0110 { + @State text: string = 'This-is-test-text.\nThis-is-test-text.This-is-test-text.This-is-test-text.'; + + build() { + Column() { + TextArea({ text: this.text }).width(300).id('UIComponentTextCommonClickReplacement0110_001') + TextInput({ text: this.text }) + .width(300).id('UIComponentTextCommonClickReplacement0110_002') + .margin(10) + Search({ value: this.text }).width(300).id('UIComponentTextCommonClickReplacement0110_003') + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130.ets new file mode 100755 index 00000000..30260f20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130.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 UIComponentTextCommonClickReplacement0130 { + @State text: string = 'This-is-test-text1235561.\nThis-is-test-text.This-is-test-text.This-is-test-text.'; + @State typeArea: number = TextAreaType.NORMAL; + @State typeInput: number = InputType.Normal; + @State typeSearch: number = SearchType.NORMAL; + + build() { + Column() { + Button('area Type').onClick(()=>{ + this.typeArea = TextAreaType.NUMBER; + }).id('UIComponentTextCommonClickReplacement0130_button_001') + TextArea({ text: this.text }) + .width(300) + .type(this.typeArea) + .id('UIComponentTextCommonClickReplacement0130_001') + Button('input Type').onClick(()=>{ + this.typeInput = InputType.Number; + }).id('UIComponentTextCommonClickReplacement0130_button_002') + TextInput({ text: this.text }) + .width(300) + .type(this.typeInput) + .id('UIComponentTextCommonClickReplacement0130_002') + .margin(10) + Button('serch Type').onClick(()=>{ + this.typeSearch = SearchType.NUMBER; + }).id('UIComponentTextCommonClickReplacement0130_button_003') + Search({ value: this.text }) + .width(300) + .type(this.typeSearch) + .id('UIComponentTextCommonClickReplacement0130_003') + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0140.ets new file mode 100755 index 00000000..dd7c9131 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0140.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextCommonClickReplacement0140 { + @State text: string = 'This-is-test-text1235561.\nThis-is-test-text.This-is-test-text.This-is-test-text.'; + + build() { + Column() { + TextArea({ text: this.text }) + .width(300) + .style(TextContentStyle.INLINE) + .id('UIComponentTextCommonClickReplacement0140_001') + TextInput({ text: this.text }) + .width(300) + .style(TextInputStyle.Inline) + .id('UIComponentTextCommonClickReplacement0140_002') + .margin(40) + }.height('100%').width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.ets new file mode 100755 index 00000000..c633bfc7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextCommonEmojiReplacement { + + build() { + Row() { + Column() { + TextInput({ text: '\uD83D\uDE00' + '\uD83D\uDE00' +'\uD83D\uDE00' +'\uD83D\uDE00' +'\uD83D\uDE00'}) + .id('textinput') + TextArea({ text: '\uD83D\uDE00' + '\uD83D\uDE00' +'\uD83D\uDE00' +'\uD83D\uDE00' +'\uD83D\uDE00'}) + .id('textarea') + Search({ value: '\uD83D\uDE00' + '\uD83D\uDE00' +'\uD83D\uDE00' +'\uD83D\uDE00' +'\uD83D\uDE00' }) + .id('search') + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0010.ets new file mode 100755 index 00000000..324087e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0010.ets @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0010 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + console.info("test--" + JSON.stringify(value)) + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text("带回家的好类扣手机端开发了健康的水立方") + .copyOption(CopyOptions.LocalDevice) + .fontSize('16fp') + .fontColor(Color.Black) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 0, + offsetY: 0 + }) + .fontStyle(FontStyle.Normal) + .fontWeight(FontWeight.Normal) + .fontFamily("HarmonyOS Sans") + .fontFeature("\"ss01\" on") + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0020.ets new file mode 100755 index 00000000..276e2ac0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0020.ets @@ -0,0 +1,221 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0020 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text("带回家的好类扣手机端开发了健康的水立方") + .copyOption(CopyOptions.LocalDevice) + .fontSize('16fp') + .fontColor(Color.Black) + .fontStyle(FontStyle.Normal) + .fontWeight(FontWeight.Normal) + .fontFamily("HarmonyOS Sans") + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0030.ets new file mode 100755 index 00000000..abd840d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0030.ets @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0030 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text("带回家的好类扣手机端开发了健康的水立方") + .copyOption(CopyOptions.LocalDevice) + .decoration({ + type: TextDecorationType.None, + color: Color.Black, + style: TextDecorationStyle.SOLID + }) + .textCase(TextCase.Normal) + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0040.ets new file mode 100755 index 00000000..48afff15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0040.ets @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0040 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text("带回家的好类扣手机端开发了健康的水立方") + .copyOption(CopyOptions.LocalDevice) + .minFontSize(10) + .maxFontSize(30) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0050.ets new file mode 100755 index 00000000..ddd03f93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0050.ets @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0050 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text("带回家的好类扣手机端开发了健康的水立方") + .copyOption(CopyOptions.LocalDevice) + .minFontSize(10) + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0390.ets new file mode 100755 index 00000000..44724ce8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0390.ets @@ -0,0 +1,261 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0390 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + } + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + async aboutToAppear() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.app_icon')) + // 添加图片 + this.mutableStr = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 50, height: 50 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BASELINE, + objectFit: ImageFit.Contain + })) + this.controller.setStyledString(this.mutableStr) + // 图片之前 + this.mutableStr.insertStyledString(0, this.mutableStyledString1) + + + this.controller.setStyledString(this.mutableStr) + // 图片之后 + let str = new StyledString('123456789') + this.mutableStr.appendStyledString(str) + this.controller.setStyledString(this.mutableStr) + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text(){ + Span("带回家的好类扣手机端开发了健康的水立方") + .draggable(true) + .fontSize(30) + .baselineOffset(LengthMetrics.px(30)) + .fontColor(Color.Brown) + + ImageSpan(this.imagePixelMap) + .width(50) + .height(50) + .borderRadius("15vp") + .verticalAlign(ImageSpanAlignment.BASELINE) + .objectFit(ImageFit.Contain) + } + .copyOption(CopyOptions.LocalDevice) + .minFontSize(10) + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + // this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0400.ets new file mode 100755 index 00000000..cd3ab792 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0400.ets @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0400 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + + if (value instanceof ImageAttachment) { + this.msgList.push('剪贴板内容_value.ImageAttachment.value?.toString() ' + value.value?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.size?.toString() ' + value.size?.toString()); + } + } + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + async aboutToAppear() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.app_icon')) + // 添加图片 + this.mutableStr = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 50, height: 50 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BASELINE, + objectFit: ImageFit.Contain + })) + this.controller.setStyledString(this.mutableStr) + // 图片之前 + this.mutableStr.insertStyledString(0, this.mutableStyledString1) + + + this.controller.setStyledString(this.mutableStr) + // 图片之后 + let str = new StyledString('123456789') + this.mutableStr.appendStyledString(str) + this.controller.setStyledString(this.mutableStr) + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text(){ + Span("带回家的好类扣手机端开发了健康的水立方") + .draggable(true) + .fontSize(30) + .baselineOffset(LengthMetrics.px(30)) + .fontColor(Color.Brown) + + ImageSpan($r('app.media.icon')) + .width('200px') + .height('200px') + .objectFit(ImageFit.Contain) + } + .copyOption(CopyOptions.LocalDevice) + .minFontSize(10) + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0410.ets new file mode 100755 index 00000000..1b3ccc78 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0410.ets @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; +import { LengthUnit } from '@kit.ArkUI'; +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0410 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text() { + Span("带回家的好类扣手机端开发了健康的水立方") + .fontSize(20) + .fontStyle(FontStyle.Italic) + .fontWeight(FontWeight.Bolder) + .fontColor(Color.Red) + .baselineOffset(LengthMetrics.px(10)) + .decoration({ type: TextDecorationType.LineThrough, color: Color.Red }) + .letterSpacing(10) + .textShadow([{ + radius: 0, + color: Color.Blue, + offsetX: 10, + offsetY: 10, + fill: true + }, { + radius: 15, + color: Color.Green, + offsetX: 0, + offsetY: 0, + fill: true + }]) + + } + .copyOption(CopyOptions.LocalDevice) + .fontSize(10) + .fontStyle(FontStyle.Italic) + .fontWeight(FontWeight.Lighter) + .fontColor(Color.Green) + .baselineOffset(-10) + .decoration({ type: TextDecorationType.Underline, color: Color.Pink }) + .letterSpacing(10) + .textShadow({ + radius: 5, + color: Color.Black, + offsetX: -10, + offsetY: -10 + }) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0420.ets new file mode 100755 index 00000000..84a503b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0420.ets @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; +import { LengthUnit } from '@kit.ArkUI'; +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0420 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text() { + Span("带回家的好类扣手机端开发了健康的水立方") + .fontSize(20) + .fontStyle(FontStyle.Italic) + .fontWeight(FontWeight.Bolder) + .fontColor(Color.Red) + .baselineOffset(LengthMetrics.px(10)) + .decoration({ type: TextDecorationType.LineThrough, color: Color.Red }) + .letterSpacing(10) + .textShadow([{ + radius: 0, + color: Color.Blue, + offsetX: 10, + offsetY: 10, + fill: true + }, { + radius: 15, + color: Color.Green, + offsetX: 0, + offsetY: 0, + fill: true + }]) + } + .copyOption(CopyOptions.LocalDevice) + .fontSize(10) + .fontStyle(FontStyle.Italic) + .fontWeight(FontWeight.Lighter) + .fontColor(Color.Green) + .baselineOffset(-10) + .decoration({ type: TextDecorationType.Underline, color: Color.Pink }) + .letterSpacing(10) + .textShadow({ + radius: 5, + color: Color.Black, + offsetX: -10, + offsetY: -10, + fill: true + }) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0430.ets new file mode 100755 index 00000000..a30e5f6a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0430.ets @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0430 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text("带回家的好类扣手机端开发了健康的水立方") + .copyOption(CopyOptions.LocalDevice) + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0440.ets new file mode 100755 index 00000000..b0c7fa20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0440.ets @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0440 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text组件设置baselineoffset") + Text("带回家的好类扣手机端开发了健康的水立方") + .copyOption(CopyOptions.LocalDevice) + .fontSize(-1000) + .width(300) + .height(100) + .id("text") + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0450.ets new file mode 100755 index 00000000..011cb3e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0450.ets @@ -0,0 +1,270 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0450 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + if (value instanceof BaselineOffsetStyle) { + this.msgList.push('剪贴板内容_value.BaselineOffsetStyle.baselineOffset?.toString() ' + + value.baselineOffset?.toString()); + } + if (value instanceof LetterSpacingStyle) { + this.msgList.push('剪贴板内容_value.LetterSpacingStyle.letterSpacing?.toString() ' + + value.letterSpacing?.toString()); + } + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + if (value instanceof ImageAttachment) { + this.msgList.push('剪贴板内容_value.ImageAttachment.value?.toString() ' + value.value?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.size?.toString() ' + value.size?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.verticalAlign?.toString() ' + + value.verticalAlign?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.objectFit?.toString() ' + value.objectFit?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.margin?.toString() ' + + value.layoutStyle?.margin?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.padding?.toString() ' + + value.layoutStyle?.padding?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.borderRadius?.toString() ' + + value.layoutStyle?.borderRadius?.toString()); + } + if (value instanceof ParagraphStyle) { + this.msgList.push('剪贴板内容_value.ParagraphStyle.textAlign?.toString() ' + value.textAlign?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.textIndent?.toString() ' + value.textIndent?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.maxLines?.toString() ' + value.maxLines?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.overflow?.toString() ' + value.overflow?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.leadingMargin?.toString() ' + + value.leadingMargin?.toString()); + } + if (value instanceof LineHeightStyle) { + this.msgList.push('剪贴板内容_value.LineHeightStyle.lineHeight?.toString() ' + value.lineHeight?.toString()); + } + if (value instanceof UrlStyle) { + this.msgList.push('剪贴板内容_value.UrlStyle.url?.toString() ' + value.url?.toString()); + } + if (value instanceof BackgroundColorStyle) { + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.color?.toString() ' + + value.textBackgroundStyle.color?.toString()); + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.radius?.toString() ' + + value.textBackgroundStyle.radius?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text控件存在子控件Span/ImageSpan") + Text() { + Span("123456789") + .draggable(true).fontSize(30).fontColor(Color.Brown) + + Span("abcderfsa") + .draggable(true).fontSize(40).fontColor(Color.Brown) + } + .copyOption(CopyOptions.LocalDevice) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0460.ets new file mode 100755 index 00000000..cee88c03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0460.ets @@ -0,0 +1,269 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0460 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + if (value instanceof BaselineOffsetStyle) { + this.msgList.push('剪贴板内容_value.BaselineOffsetStyle.baselineOffset?.toString() ' + + value.baselineOffset?.toString()); + } + if (value instanceof LetterSpacingStyle) { + this.msgList.push('剪贴板内容_value.LetterSpacingStyle.letterSpacing?.toString() ' + + value.letterSpacing?.toString()); + } + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + if (value instanceof ImageAttachment) { + this.msgList.push('剪贴板内容_value.ImageAttachment.value?.toString() ' + value.value?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.size?.toString() ' + value.size?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.verticalAlign?.toString() ' + + value.verticalAlign?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.objectFit?.toString() ' + value.objectFit?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.margin?.toString() ' + + value.layoutStyle?.margin?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.padding?.toString() ' + + value.layoutStyle?.padding?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.borderRadius?.toString() ' + + value.layoutStyle?.borderRadius?.toString()); + } + if (value instanceof ParagraphStyle) { + this.msgList.push('剪贴板内容_value.ParagraphStyle.textAlign?.toString() ' + value.textAlign?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.textIndent?.toString() ' + value.textIndent?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.maxLines?.toString() ' + value.maxLines?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.overflow?.toString() ' + value.overflow?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.leadingMargin?.toString() ' + + value.leadingMargin?.toString()); + } + if (value instanceof LineHeightStyle) { + this.msgList.push('剪贴板内容_value.LineHeightStyle.lineHeight?.toString() ' + value.lineHeight?.toString()); + } + if (value instanceof UrlStyle) { + this.msgList.push('剪贴板内容_value.UrlStyle.url?.toString() ' + value.url?.toString()); + } + if (value instanceof BackgroundColorStyle) { + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.color?.toString() ' + + value.textBackgroundStyle.color?.toString()); + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.radius?.toString() ' + + value.textBackgroundStyle.radius?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text控件存在子控件Span/ImageSpan") + Text() { + Span("123456789") + .draggable(true).fontSize(30).fontColor(Color.Brown) + + Span("abcderfsa") + .draggable(true).fontSize(40).fontColor(Color.Brown) + } + .copyOption(CopyOptions.LocalDevice) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0470.ets new file mode 100755 index 00000000..dfbf5618 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0470.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 { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0470 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + if (value instanceof BaselineOffsetStyle) { + this.msgList.push('剪贴板内容_value.BaselineOffsetStyle.baselineOffset?.toString() ' + + value.baselineOffset?.toString()); + } + if (value instanceof LetterSpacingStyle) { + this.msgList.push('剪贴板内容_value.LetterSpacingStyle.letterSpacing?.toString() ' + + value.letterSpacing?.toString()); + } + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + if (value instanceof ImageAttachment) { + this.msgList.push('剪贴板内容_value.ImageAttachment.value?.toString() ' + value.value?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.size?.toString() ' + value.size?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.verticalAlign?.toString() ' + + value.verticalAlign?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.objectFit?.toString() ' + value.objectFit?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.margin?.toString() ' + + value.layoutStyle?.margin?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.padding?.toString() ' + + value.layoutStyle?.padding?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.borderRadius?.toString() ' + + value.layoutStyle?.borderRadius?.toString()); + } + if (value instanceof ParagraphStyle) { + this.msgList.push('剪贴板内容_value.ParagraphStyle.textAlign?.toString() ' + value.textAlign?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.textIndent?.toString() ' + value.textIndent?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.maxLines?.toString() ' + value.maxLines?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.overflow?.toString() ' + value.overflow?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.leadingMargin?.toString() ' + + value.leadingMargin?.toString()); + } + if (value instanceof LineHeightStyle) { + this.msgList.push('剪贴板内容_value.LineHeightStyle.lineHeight?.toString() ' + value.lineHeight?.toString()); + } + if (value instanceof UrlStyle) { + this.msgList.push('剪贴板内容_value.UrlStyle.url?.toString() ' + value.url?.toString()); + } + if (value instanceof BackgroundColorStyle) { + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.color?.toString() ' + + value.textBackgroundStyle.color?.toString()); + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.radius?.toString() ' + + value.textBackgroundStyle.radius?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text控件存在子控件Span/ImageSpan") + Text("123456789\uD83D\uDC80 abcderfsaabcderfsa") + .copyOption(CopyOptions.LocalDevice) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0480.ets new file mode 100755 index 00000000..52af5191 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0480.ets @@ -0,0 +1,267 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0480 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + if (value instanceof BaselineOffsetStyle) { + this.msgList.push('剪贴板内容_value.BaselineOffsetStyle.baselineOffset?.toString() ' + + value.baselineOffset?.toString()); + } + if (value instanceof LetterSpacingStyle) { + this.msgList.push('剪贴板内容_value.LetterSpacingStyle.letterSpacing?.toString() ' + + value.letterSpacing?.toString()); + } + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + if (value instanceof ImageAttachment) { + this.msgList.push('剪贴板内容_value.ImageAttachment.value?.toString() ' + value.value?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.size?.toString() ' + value.size?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.verticalAlign?.toString() ' + + value.verticalAlign?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.objectFit?.toString() ' + value.objectFit?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.margin?.toString() ' + + value.layoutStyle?.margin?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.padding?.toString() ' + + value.layoutStyle?.padding?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.borderRadius?.toString() ' + + value.layoutStyle?.borderRadius?.toString()); + } + if (value instanceof ParagraphStyle) { + this.msgList.push('剪贴板内容_value.ParagraphStyle.textAlign?.toString() ' + value.textAlign?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.textIndent?.toString() ' + value.textIndent?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.maxLines?.toString() ' + value.maxLines?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.overflow?.toString() ' + value.overflow?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.leadingMargin?.toString() ' + + value.leadingMargin?.toString()); + } + if (value instanceof LineHeightStyle) { + this.msgList.push('剪贴板内容_value.LineHeightStyle.lineHeight?.toString() ' + value.lineHeight?.toString()); + } + if (value instanceof UrlStyle) { + this.msgList.push('剪贴板内容_value.UrlStyle.url?.toString() ' + value.url?.toString()); + } + if (value instanceof BackgroundColorStyle) { + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.color?.toString() ' + + value.textBackgroundStyle.color?.toString()); + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.radius?.toString() ' + + value.textBackgroundStyle.radius?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text控件存在子控件Span/ImageSpan") + Text("123456789剪切板 こんにちは、世界helloword") + .copyOption(CopyOptions.LocalDevice) + .fontSize(10) + .fontColor(Color.Green) + .fontWeight(FontWeight.Lighter) + .baselineOffset(-10) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0490.ets new file mode 100755 index 00000000..ac93b5be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0490.ets @@ -0,0 +1,265 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0490 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + if (value instanceof BaselineOffsetStyle) { + this.msgList.push('剪贴板内容_value.BaselineOffsetStyle.baselineOffset?.toString() ' + + value.baselineOffset?.toString()); + } + if (value instanceof LetterSpacingStyle) { + this.msgList.push('剪贴板内容_value.LetterSpacingStyle.letterSpacing?.toString() ' + + value.letterSpacing?.toString()); + } + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + if (value instanceof ImageAttachment) { + this.msgList.push('剪贴板内容_value.ImageAttachment.value?.toString() ' + value.value?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.size?.toString() ' + value.size?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.verticalAlign?.toString() ' + + value.verticalAlign?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.objectFit?.toString() ' + value.objectFit?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.margin?.toString() ' + + value.layoutStyle?.margin?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.padding?.toString() ' + + value.layoutStyle?.padding?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.borderRadius?.toString() ' + + value.layoutStyle?.borderRadius?.toString()); + } + if (value instanceof ParagraphStyle) { + this.msgList.push('剪贴板内容_value.ParagraphStyle.textAlign?.toString() ' + value.textAlign?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.textIndent?.toString() ' + value.textIndent?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.maxLines?.toString() ' + value.maxLines?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.overflow?.toString() ' + value.overflow?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.leadingMargin?.toString() ' + + value.leadingMargin?.toString()); + } + if (value instanceof LineHeightStyle) { + this.msgList.push('剪贴板内容_value.LineHeightStyle.lineHeight?.toString() ' + value.lineHeight?.toString()); + } + if (value instanceof UrlStyle) { + this.msgList.push('剪贴板内容_value.UrlStyle.url?.toString() ' + value.url?.toString()); + } + if (value instanceof BackgroundColorStyle) { + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.color?.toString() ' + + value.textBackgroundStyle.color?.toString()); + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.radius?.toString() ' + + value.textBackgroundStyle.radius?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text控件存在子控件Span/ImageSpan") + Text("123456789剪切板 こんにちは、世界helloword") { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter).fontSize(96) + } + .copyOption(CopyOptions.LocalDevice) + .fontSize(10) + .fontColor(Color.Green) + .fontWeight(FontWeight.Lighter) + .baselineOffset(-10) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0500.ets new file mode 100755 index 00000000..17e88e04 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0500.ets @@ -0,0 +1,279 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { image } from '@kit.ImageKit'; +import hilog from '@ohos.hilog'; +import { BusinessError } from '@ohos.base'; +import { Permissions } from '@ohos.abilityAccessCtrl'; +import common from '@ohos.app.ability.common'; +import pasteboard from '@ohos.pasteboard'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextCopyAttributeReplacement0500 { + @State imagePixelMap: image.PixelMap | undefined = undefined + @State msgList: Array = []; + @State permission_state: boolean = true; + mutableStr: MutableStyledString = new MutableStyledString(''); + controller: TextController = new TextController(); + controllerShow: TextController = new TextController(); + richController: RichEditorController = new RichEditorController(); + mutableStyledString1: MutableStyledString = new MutableStyledString("hello world", [{ + start: 0, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Pink }) + }, { + start: 4, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }, + { + start: 6, + length: 3, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + ]); + + readPasteboardData() { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + + for (let i = 0; i < pasteData.getRecordCount(); i++) { + this.readRecord(pasteData.getRecord(i)); + } + }) + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + } + + readRecord(record: pasteboard.PasteDataRecord) { + if (record.getData("openharmony.styled-string") == undefined) { + return; + } + record.getData("openharmony.styled-string").then((value) => { + if (value instanceof ArrayBuffer) { + this.readData(value); + } + }); + } + + async readData(data: ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(data); + this.readStyledStringObject(styledStringObject); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + + readStyledStringObject(styledStringObject: StyledString) { + this.msgList.push('剪贴板内容_styledStringObject.length' + styledStringObject.length); + this.msgList.push('剪贴板内容_styledStringObject.getString' + styledStringObject.getString()); + for (let i = 0; i < 1000; i++) { + this.readStyledSpan(styledStringObject.getStyles(0, styledStringObject.length, i)); + } + } + + readStyledSpan(spanStyleArray: Array) { + if (spanStyleArray == undefined) { + return; + } + for (let k = 0; k < spanStyleArray.length; k++) { + let spanStyle = spanStyleArray[k]; + let value = spanStyle.styledValue; + if (value instanceof TextStyle) { + this.msgList.push('剪贴板内容_value.TextStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontColor?.toString() ' + value.fontColor?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontFamily?.toString() ' + value.fontFamily?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontSize?.toString() ' + value.fontSize?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontWeight?.toString() ' + value.fontWeight?.toString()); + this.msgList.push('剪贴板内容_value.TextStyle.fontStyle?.toString() ' + value.fontStyle?.toString()); + } + if (value instanceof DecorationStyle) { + this.msgList.push('剪贴板内容_value.DecorationStyle.type?.toString() ' + value.type?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.color?.toString() ' + value.color?.toString()); + this.msgList.push('剪贴板内容_value.DecorationStyle.style?.toString() ' + value.style?.toString()); + } + if (value instanceof BaselineOffsetStyle) { + this.msgList.push('剪贴板内容_value.BaselineOffsetStyle.baselineOffset?.toString() ' + + value.baselineOffset?.toString()); + } + if (value instanceof LetterSpacingStyle) { + this.msgList.push('剪贴板内容_value.LetterSpacingStyle.letterSpacing?.toString() ' + + value.letterSpacing?.toString()); + } + if (value instanceof TextShadowStyle) { + this.msgList.push('剪贴板内容_value.TextShadowStyle.textShadow?.toString() ' + value.textShadow?.toString()); + } + if (value instanceof ImageAttachment) { + this.msgList.push('剪贴板内容_value.ImageAttachment.value?.toString() ' + value.value?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.size?.toString() ' + value.size?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.verticalAlign?.toString() ' + + value.verticalAlign?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.objectFit?.toString() ' + value.objectFit?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.margin?.toString() ' + + value.layoutStyle?.margin?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.padding?.toString() ' + + value.layoutStyle?.padding?.toString()); + this.msgList.push('剪贴板内容_value.ImageAttachment.borderRadius?.toString() ' + + value.layoutStyle?.borderRadius?.toString()); + } + if (value instanceof ParagraphStyle) { + this.msgList.push('剪贴板内容_value.ParagraphStyle.textAlign?.toString() ' + value.textAlign?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.textIndent?.toString() ' + value.textIndent?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.maxLines?.toString() ' + value.maxLines?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.overflow?.toString() ' + value.overflow?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.wordBreak?.toString() ' + value.wordBreak?.toString()); + this.msgList.push('剪贴板内容_value.ParagraphStyle.leadingMargin?.toString() ' + + value.leadingMargin?.toString()); + } + if (value instanceof LineHeightStyle) { + this.msgList.push('剪贴板内容_value.LineHeightStyle.lineHeight?.toString() ' + value.lineHeight?.toString()); + } + if (value instanceof UrlStyle) { + this.msgList.push('剪贴板内容_value.UrlStyle.url?.toString() ' + value.url?.toString()); + } + if (value instanceof BackgroundColorStyle) { + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.color?.toString() ' + + value.textBackgroundStyle.color?.toString()); + this.msgList.push('剪贴板内容_value.BackgroundColorStyle.radius?.toString() ' + + value.textBackgroundStyle.radius?.toString()); + } + } + } + + async onPageShow() { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + Utils.checkPermission((isGranted: boolean) => { + if (isGranted) { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + let text: string = pasteData.getPrimaryText(); + if (text != "") { + this.msgList.push('权限校验,可以读取剪贴板内容'); + } + }); + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `get oaid by promise catch error: ${err.code} ${err.message}`); + } + } else { + if (this.permission_state) { + Utils.reqPermissionsFromUser(permissions, getContext(this) as common.UIAbilityContext, (isGrant) => { + if (isGrant) { + this.permission_state = true; + this.msgList.push('申请权限成功'); + } else { + this.permission_state = false; + this.msgList.push('申请权限失败'); + } + }) + } + } + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Divider() + Text("Text控件存在子控件Span/ImageSpan") + Text() { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(96) + + ContainerSpan() { + ImageSpan($r('app.media.app_icon')) + .width('40vp') + .height('40vp') + .verticalAlign(ImageSpanAlignment.CENTER) + Span('Hello World !').fontSize('16fp').fontColor(Color.White) + }.textBackgroundStyle({ color: "#7F007DFF", radius: "12vp" }) + } + .copyOption(CopyOptions.LocalDevice) + .fontSize(10) + .fontColor(Color.Green) + .fontWeight(FontWeight.Lighter) + .baselineOffset(-10) + .width(300) + .height(100) + .id("text") + + Divider() + + Row() { + Button("读取剪贴板内容") + .onClick(() => { + try { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error('Failed to get PasteData. Cause: ' + err.message); + return; + } + this.msgList.push('剪贴板内容_PrimaryText:' + pasteData.getPrimaryText()); + this.msgList.push('剪贴板内容_RecordCount:' + pasteData.getRecordCount()); + for (let i = 0; i < pasteData.getRecordCount(); i++) { + let record = pasteData.getRecord(i); + if (record.getData("openharmony.styled-string") == undefined) { + continue; + } + record.getData("openharmony.styled-string").then(async (value) => { + if (value instanceof ArrayBuffer) { + let styledStringObject = await StyledString.unmarshalling(value); + // this.msgList.push('剪贴板内容_转换:' + StyledString.toHtml(styledStringObject)); + let mutableShow = new MutableStyledString(''); + mutableShow.appendStyledString(styledStringObject) + this.controllerShow.setStyledString(mutableShow) + } + }); + } + }) + this.readPasteboardData() + } catch (err) { + hilog.error(0x0000, 'testTag', '%{public}s', `catch error: ${err.code} ${err.message}`); + } + }) + .id("getData") + } + + Divider() + Text(undefined, { controller: this.controllerShow }).copyOption(CopyOptions.LocalDevice) + .margin({ top: 40 }) + Divider() + } + .border({ width: 1, radius: 5 }) + .width('100%') + } + .height("90%") + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHalfleadingReplacement/UIComponentTextHalfleadingReplacement0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHalfleadingReplacement/UIComponentTextHalfleadingReplacement0100.ets new file mode 100755 index 00000000..d70a979a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHalfleadingReplacement/UIComponentTextHalfleadingReplacement0100.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextHalfleadingReplacement0100 { + @State halfLeadingVal: boolean | undefined = undefined + @State txt: string = 'This is the text without the halfLeading set.'; + + build() { + + Column({ space: 10 }) { + // 设置文本是否居中对齐 + Text('halfLeading Test').fontSize(9).fontColor(0xCCCCCC) + Text(this.txt) + .lineHeight(60) + .halfLeading(this.halfLeadingVal) + .textAlign(TextAlign.Start).borderWidth(3) + + Row({space:10}) { + Button("设置halfLeading true").id('TextHalfleading_1').onClick(() => { + this.halfLeadingVal = true; + this.txt = 'This is the text with the halfLeading set.'; + }) + Button("设置halfLeading false").id('TextHalfleading_2').onClick(() => { + this.halfLeadingVal = false; + this.txt = 'This is the text without the halfLeading set.' + }).visibility(Visibility.Hidden) + }.margin(10) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface001.ets new file mode 100755 index 00000000..43dc8d2d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface001.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface001 { + @State isShow: boolean = true; + @State log: string = 'log:'; + @State index: number = 0; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .key('key_TextInput_UnderlineColor_001') + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.isShow) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: value= ' + value + ' onSecurityStateChange num :' + this.index++; + }) + + Button('test++').onClick(() => { + this.isShow = true; + }).key('UIComponentTextInputPasswordInterface001_button_001') + Button('test--').onClick(() => { + this.isShow = false; + }).key('UIComponentTextInputPasswordInterface001_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface002.ets new file mode 100755 index 00000000..3727e4cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface002.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface002 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.index == 0 ? true : ((this.index == 1 || this.index == 2) ? undefined : false)) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: value= ' + value + ' onSecurityStateChange num :' + this.index++; + }) + + Button('test++').onClick(() => { + this.index++; + }).key('UIComponentTextInputPasswordInterface002_button_001') + Button('test--').onClick(() => { + this.index--; + }).key('UIComponentTextInputPasswordInterface002_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface003.ets new file mode 100755 index 00000000..e82a78ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface003.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface003 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.index == 0 ? undefined : (this.index == 1 ? true : false)) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: value= ' + value + ' onSecurityStateChange num :' + this.index++; + }) + + Button('test++').onClick(() => { + this.index++; + }).key('UIComponentTextInputPasswordInterface003_button_001') + Button('test--').onClick(() => { + this.index--; + }).key('UIComponentTextInputPasswordInterface003_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface004.ets new file mode 100755 index 00000000..2e1fad2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface004.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface004 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.index == 0 ? undefined : undefined) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: value= ' + value + ' onSecurityStateChange num :' + this.index++; + }) + + Button('test++').onClick(() => { + this.index++; + }).key('UIComponentTextInputPasswordInterface004_button_001') + Button('test--').onClick(() => { + this.index--; + }).key('UIComponentTextInputPasswordInterface004_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0070.ets new file mode 100755 index 00000000..ba4ec395 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0070.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface0070 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.index == 0 ? false : true) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: onSecurityStateChange回调 value= ' + value; + }) + + Button('test++').onClick(() => { + this.index++; + }).key('UIComponentTextInputPasswordInterface0070_button_001') + Button('test--').onClick(() => { + this.index--; + }).key('UIComponentTextInputPasswordInterface0070_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0080.ets new file mode 100755 index 00000000..899a1a02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0080.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface0080 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.index == 0 ? false : false) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: onSecurityStateChange回调 value= ' + value; + }) + + Button('test++').onClick(() => { + this.index++; + }).key('UIComponentTextInputPasswordInterface0080_button_001') + Button('test--').onClick(() => { + this.index--; + }).key('UIComponentTextInputPasswordInterface0080_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0090.ets new file mode 100755 index 00000000..21e6dd95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0090.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface0090 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.index == 0 ? false : undefined) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: onSecurityStateChange回调 value= ' + value; + }) + + Button('test++').onClick(() => { + this.index++; + }).key('UIComponentTextInputPasswordInterface0090_button_001') + Button('test--').onClick(() => { + this.index--; + }).key('UIComponentTextInputPasswordInterface0090_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0100.ets new file mode 100755 index 00000000..f4042f3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0100.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface0100 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ placeholder: 'input your word' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(this.index == 0 ? undefined : true) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: onSecurityStateChange回调 value= ' + value; + }) + + Button('test++').onClick(() => { + this.index++; + }).key('UIComponentTextInputPasswordInterface0100_button_001') + Button('test--').onClick(() => { + this.index--; + }).key('UIComponentTextInputPasswordInterface0100_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0200.ets new file mode 100755 index 00000000..47947d27 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0200.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface0200 { + @State index: number = 0; + @State log: string = 'log:'; + + build() { + Column() { + Text(this.log) + TextInput({ text: '123456' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .showPassword(true) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: onSecurityStateChange回调 value= ' + value; + }).id('UIComponentTextInputPasswordInterface0200_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0220.ets new file mode 100755 index 00000000..400e2c56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0220.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 { TextInputModifier } from '@ohos.arkui.modifier'; + + +@Entry +@Component +struct UIComponentTextInputPasswordInterface0220 { + @State index: number = 0; + @State log: string = 'log:'; + @State modifier: MyTextInputModifierPwd0220 = new MyTextInputModifierPwd0220(); + + build() { + Column() { + Text(this.log) + TextInput({ text: '123456' }) + .minFontSize('20px') + .maxFontSize('20fp') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .type(InputType.Password) + .attributeModifier(this.modifier) + .onSecurityStateChange((value: boolean) => { + this.log = 'log: onSecurityStateChange回调 value= ' + value; + }) + .margin({ bottom: 10 }) + .id('UIComponentTextInputPasswordInterface0220_textInput_001') + Button('change showPassword = true').onClick(() => { + this.modifier.isShowPassword = true; + }).id('UIComponentTextInputPasswordInterface0220_button_001') + } + } +} + +class MyTextInputModifierPwd0220 implements AttributeModifier { + isShowPassword: boolean = false; + + applyNormalAttribute(instance: TextInputAttribute): void { + instance.showPassword(this.isShowPassword) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001.ets new file mode 100755 index 00000000..2307c42f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001.ets @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPhoneNumberInterface001 { + @State submitValue: string = '' + @State text: string = '' + public readonly NUM_TEXT_MAXSIZE_LENGTH = 13 + @State teleNumberNoSpace: string = "" + @State nextCaret: number = -1 // 用于记录下次光标设置的位置 + @State actualCh: number = -1 // 用于记录光标在第i个数字后插入或者第i个数字前删除 + @State lastCaretPosition: number = 0 + @State lastCaretPositionEnd: number = 0 + controller: TextInputController = new TextInputController() + + isEmpty(str?: string): boolean { + return str == 'undefined' || !str || !new RegExp("[^\\s]").test(str) + } + + checkNeedNumberSpace(numText: string) { + let isSpace: RegExp = new RegExp('[\\+;,#\\*]', 'g') + let isRule: RegExp = new RegExp('^\\+.*') + + if (isSpace.test(numText)) { + // 如果电话号码里有特殊字符,就不加空格 + if (isRule.test(numText)) { + return true + } else { + return false + } + } + return true; + } + + removeSpace(str: string): string { + if (this.isEmpty(str)) { + return '' + } + return str.replace(new RegExp("[\\s]", "g"), '') + } + + setCaret() { + if (this.nextCaret != -1) { + console.log("to keep caret position right, change caret to", this.nextCaret) + this.controller.caretPosition(this.nextCaret) + this.nextCaret = -1 + } + } + + calcCaretPosition(nextText: string) { + let befNumberNoSpace: string = this.removeSpace(this.text) + this.actualCh = 0 + if (befNumberNoSpace.length < this.teleNumberNoSpace.length) { // 插入场景 + for (let i = 0; i < this.lastCaretPosition; i++) { + if (this.text[i] != ' ') { + this.actualCh += 1 + } + } + this.actualCh += this.teleNumberNoSpace.length - befNumberNoSpace.length + console.log("actualCh: " + this.actualCh) + for (let i = 0; i < nextText.length; i++) { + if (nextText[i] != ' ') { + this.actualCh -= 1 + if (this.actualCh <= 0) { + this.nextCaret = i + 1 + break; + } + } + } + } else if (befNumberNoSpace.length > this.teleNumberNoSpace.length) { // 删除场景 + if (this.lastCaretPosition === this.text.length) { + console.log("Caret at last, no need to change") + } else if (this.lastCaretPosition === this.lastCaretPositionEnd) { + // 按键盘上回退键一个一个删的情况 + for (let i = this.lastCaretPosition; i < this.text.length; i++) { + if (this.text[i] != ' ') { + this.actualCh += 1 + } + } + for (let i = nextText.length - 1; i >= 0; i--) { + if (nextText[i] != ' ') { + this.actualCh -= 1 + if (this.actualCh <= 0) { + this.nextCaret = i + break; + } + } + } + } else { + // 剪切/手柄选择 一次删多个字符 + this.nextCaret = this.lastCaretPosition // 保持光标位置 + } + } + } + + build() { + Column() { + Row() { + Text('这是电话号码:13912345678') + .copyOption(CopyOptions.InApp) + .textAlign(TextAlign.Center) + .key('UIComponentTextInputPhoneNumberInterface001_text_001') + } + + Row() { + TextInput({ text: `${this.text}`, controller: this.controller }) + .type(InputType.PhoneNumber) + .height('48vp') + .onChange((number: string) => { + this.teleNumberNoSpace = this.removeSpace(number); + let nextText: string = "" + if (this.teleNumberNoSpace.length > this.NUM_TEXT_MAXSIZE_LENGTH - 2) { + nextText = this.teleNumberNoSpace + } else if (this.checkNeedNumberSpace(number)) { + if (this.teleNumberNoSpace.length <= 3) { + nextText = this.teleNumberNoSpace + } else { + let split1: string = this.teleNumberNoSpace.substring(0, 3) + let split2: string = this.teleNumberNoSpace.substring(3) + nextText = split1 + ' ' + split2 + if (this.teleNumberNoSpace.length > 7) { + split2 = this.teleNumberNoSpace.substring(3, 7) + let split3: string = this.teleNumberNoSpace.substring(7) + nextText = split1 + ' ' + split2 + ' ' + split3 + } + } + } else { + nextText = number + } + console.log("onChange Triggered:" + this.text + "|" + nextText + "|" + number) + if (this.text === nextText && nextText === number) { + // 此时说明数字已经格式化完成了 在这个时候改变光标位置不会被重置掉 + this.setCaret() + } else { + this.calcCaretPosition(nextText) + } + this.text = nextText + }) + .onTextSelectionChange((selectionStart, selectionEnd) => { + // 记录光标位置 + console.log("selection change: ", selectionStart, selectionEnd) + this.lastCaretPosition = selectionStart + this.lastCaretPositionEnd = selectionEnd + }) + .key('UIComponentTextInputPhoneNumberInterface001_textInput_001') + } + } + .width('100%') + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface002.ets new file mode 100755 index 00000000..94a4527c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface002.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPhoneNumberInterface002 { + @State placeholder: string = '请输入号码'; + + build() { + Row() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontSize(20) + .type(InputType.PhoneNumber) + .margin({ top: 20 }) + .key('UIComponentTextInputPhoneNumberInterface002_textInput_001') + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface003.ets new file mode 100755 index 00000000..f8106010 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface003.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPhoneNumberInterface003 { + @State placeholder: string = '请输入号码'; + + build() { + Row() { + Column() { + Text('这是电话号码:13912345678').textAlign(TextAlign.Center).key('UIComponentTextInputPhoneNumberInterface003_text_001') + TextInput({ placeholder: this.placeholder }) + .fontSize(20) + .type(InputType.PhoneNumber) + .margin({ top: 20 }) + .key('UIComponentTextInputPhoneNumberInterface003_textInput_001') + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface001.ets new file mode 100755 index 00000000..0e0869b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface001.ets @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface001 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + RichText(this.text) + .width(200) + .height(56) + .key('UIComponentTextInputPopupBoxInterface001_richText_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0010.ets new file mode 100755 index 00000000..81cac5ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0010.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0010 { + @State text: string = 'This is the test text.This is the test text.'; + @State textAlign: number = TextAlign.Center; + + build() { + Column() { + Search({ value: this.text }) + .margin(10) + .textAlign(this.textAlign) + .key('UIComponentTextInputPopupBoxInterface0010_search_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0011.ets new file mode 100755 index 00000000..a69d1851 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0011.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0011 { + @State text: string = 'This is the test text.This is the test text.'; + @State textAlign: number = TextAlign.End; + + build() { + Column() { + Search({ value: this.text }) + .margin(10) + .textAlign(this.textAlign) + .key('UIComponentTextInputPopupBoxInterface0011_search_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0012.ets new file mode 100755 index 00000000..231a3612 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0012.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0012 { + @State text: string = 'This is the test text.This is the test text.'; + @State textAlign: number = TextAlign.JUSTIFY; + + build() { + Column() { + Search({ value: this.text }) + .margin(10) + .textAlign(this.textAlign) + .key('UIComponentTextInputPopupBoxInterface0012_search_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0013.ets new file mode 100755 index 00000000..78627275 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0013.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0013 { + @State text: string = 'This is the test text.This is the test text.'; + @State textAlign: number = TextAlign.Start; + + build() { + Column() { + Search({ value: this.text }) + .margin(10) + .textAlign(this.textAlign) + .key('UIComponentTextInputPopupBoxInterface0013_search_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014.ets new file mode 100755 index 00000000..ad1cf007 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0014 { + @State text: string = 'This is the test text.This is the test text.This is the test text.This is the test text.'; + @State copyOption: number = CopyOptions.InApp; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextArea({ text: this.text }) + .copyOption(this.copyOption) + .height(40) + .key('UIComponentTextInputPopupBoxInterface0014_textArea_001') + Button('InApp') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.InApp; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0014_button_001') + Button('LocalDevice') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.LocalDevice; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0014_button_002') + Button('None') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.None; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0014_button_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0015.ets new file mode 100755 index 00000000..a40afe33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0015.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0015 { + @State text: string = 'This is the test text.This is the test text.'; + @State copyOption: number = CopyOptions.InApp; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextArea({ text: this.text }) + .copyOption(this.copyOption) + .key('UIComponentTextInputPopupBoxInterface0015_textArea_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016.ets new file mode 100755 index 00000000..19d91324 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0016 { + @State text: string = 'This is the test text.'; + @State maxLength: number = -1; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextArea({ text: this.text }) + .maxLength(this.maxLength) + .key('UIComponentTextInputPopupBoxInterface0016_textArea_001') + Button('set 0') + .visibility(this.button) + .onClick(() => { + this.maxLength = 0; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0016_button_001') + Button('set 20') + .visibility(this.button) + .onClick(() => { + this.maxLength = 20; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0016_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017.ets new file mode 100755 index 00000000..5d2319e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0017 { + @State text: string = 'This is the test text.This is the test text.'; + @State textAlign: number = TextAlign.Center; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextArea({ text: this.text }) + .textAlign(this.textAlign) + .height(40) + .key('UIComponentTextInputPopupBoxInterface0017_textArea_001') + Button('set end') + .visibility(this.button) + .onClick(() => { + this.textAlign = TextAlign.End; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0017_button_001') + Button('set JUSTIFY') + .visibility(this.button) + .onClick(() => { + this.textAlign = TextAlign.JUSTIFY; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0017_button_002') + Button('set Start') + .visibility(this.button) + .onClick(() => { + this.textAlign = TextAlign.Start; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0017_button_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018.ets new file mode 100755 index 00000000..7a9d34b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface0018 { + @State text: string = 'This is the test text.This is the test text.This is the test text.'; + @State copyOption: number = CopyOptions.None; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .copyOption(this.copyOption) + .key('UIComponentTextInputPopupBoxInterface0018_textInput_001') + Button('set InApp') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.InApp; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0018_button_001') + Button('set LocalDevice') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.LocalDevice; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0018_button_002') + Button('set None') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.None; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0018_button_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0019.ets new file mode 100755 index 00000000..004db187 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0019.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0019 { + @State text: string = 'This is the test text.This is the test text.This is the test text.'; + @State showUnderLine: boolean = false; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .showUnderline(this.showUnderLine) + .key('UIComponentTextInputPopupBoxInterface0019_textInput_001') + Button('set true') + .visibility(this.button) + .onClick(() => { + this.showUnderLine = true; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0019_button_001') + Button('set false') + .visibility(this.button) + .onClick(() => { + this.showUnderLine = false; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0019_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface002.ets new file mode 100755 index 00000000..f2814e34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface002.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface002 { + @State text: string = 'This is the test text. enabled is false'; + + build() { + Column() { + Search({ value: this.text }) + .enabled(false) + .key('UIComponentTextInputPopupBoxInterface002_search_001') + TextInput({ text: this.text }) + .enabled(false) + .key('UIComponentTextInputPopupBoxInterface002_textInput_001') + TextArea({ text: this.text }) + .enabled(false) + .height(200) + .margin({ top: 10 }) + .key('UIComponentTextInputPopupBoxInterface002_textArea_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0020.ets new file mode 100755 index 00000000..f7a4d81e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0020.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0020 { + @State text: string = 'This is the test text.This is the test text.This is the test text.'; + @State button: number = Visibility.Visible; + @State inlineText: number = Visibility.Visible; + @State defaultText: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .style(TextContentStyle.INLINE) + .visibility(this.inlineText) + .key('UIComponentTextInputPopupBoxInterface0020_textInput_001') + TextInput({ text: this.text }) + .visibility(this.defaultText) + .style(TextContentStyle.DEFAULT) + .key('UIComponentTextInputPopupBoxInterface0020_textInput_002') + Button('set inline') + .visibility(this.button) + .onClick(() => { + this.defaultText = Visibility.None; + this.inlineText = Visibility.Visible; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0020_button_001') + Button('set default') + .visibility(this.button) + .onClick(() => { + this.defaultText = Visibility.Visible; + this.inlineText = Visibility.None; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0020_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021.ets new file mode 100755 index 00000000..66c086dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021.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 UIComponentTextInputPopupBoxInterface0021 { + @State text: string = 'This is the test text.This is the test text.'; + @State textAlign: number = TextAlign.Center; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .textAlign(this.textAlign) + .height(40) + .key('UIComponentTextInputPopupBoxInterface0021_textInput_001') + Button('set center') + .visibility(this.button) + .onClick(() => { + this.textAlign = TextAlign.Center; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0021_button_001') + Button('set end') + .visibility(this.button) + .onClick(() => { + this.textAlign = TextAlign.End; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0021_button_002') + Button('set JUSTIFY') + .visibility(this.button) + .onClick(() => { + this.textAlign = TextAlign.JUSTIFY; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0021_button_003') + Button('set Start') + .visibility(this.button) + .onClick(() => { + this.textAlign = TextAlign.Start; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0021_button_004') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022.ets new file mode 100755 index 00000000..50d1acf5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022.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 UIComponentTextInputPopupBoxInterface0022 { + @State text: string = 'This is the test text.This is the test text.'; + @State inputType: number = InputType.Email; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .type(this.inputType) + .height(40) + .key('UIComponentTextInputPopupBoxInterface0022_textInput_001') + Button('set email') + .visibility(this.button) + .onClick(() => { + this.inputType = InputType.Email; + this.text = '邮箱:56565232323@qq.com'; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0022_button_001') + Button('set normal') + .visibility(this.button) + .onClick(() => { + this.inputType = InputType.Normal; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0022_button_002') + Button('set number') + .visibility(this.button) + .onClick(() => { + this.inputType = InputType.Number; + this.text = '数字:5122251411222141444444444444444444444444'; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0022_button_003') + Button('set password') + .visibility(this.button) + .onClick(() => { + this.inputType = InputType.Password; + this.text = '密码:56565232323jjjjjjjjjjjjjjjj'; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0022_button_004') + Button('set phoneNumber') + .visibility(this.button) + .onClick(() => { + this.inputType = InputType.PhoneNumber; + this.text = '电话:15822005554'; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0022_button_005') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023.ets new file mode 100755 index 00000000..6e231893 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0023 { + @State text: string = 'This is the test text.This is the test text.This is the test text.'; + @State copyOption: number = CopyOptions.InApp; + @State button: number = Visibility.Visible; + + build() { + Column() { + Text(this.text) + .copyOption(this.copyOption) + .height(40) + .key('UIComponentTextInputPopupBoxInterface0023_text_001') + Button('None') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.None; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0023_button_001') + Button('InApp') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.InApp; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0023_button_002') + Button('LocalDevice') + .visibility(this.button) + .onClick(() => { + this.copyOption = CopyOptions.LocalDevice; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0023_button_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0024.ets new file mode 100755 index 00000000..3538a429 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0024.ets @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface0024 { + @State text: string = 'This is the test text.This is the test text.'; + + build() { + Column() { + TextInput({text:this.text}) + .copyOption(CopyOptions.InApp) + .fontSize(50) + .key('UIComponentTextInputPopupBoxInterface0024_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0026.ets new file mode 100755 index 00000000..47fa93df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0026.ets @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface0026 { + @State text: string = 'This is the test text.This is the test text.'; + @State placeholder: string = 'this is the placeholder text.'; + + build() { + Column() { + Text(this.text).copyOption(CopyOptions.InApp).key('UIComponentTextInputPopupBoxInterface0026_text_001') + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .fontSize(15) + .key('UIComponentTextInputPopupBoxInterface0026_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0027.ets new file mode 100755 index 00000000..391b1995 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0027.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 router from '@ohos.router' +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0027 { + @State text: string = 'This is the test text.This is the test text.'; + @State scale1: number = 1 + @State opacity1: number = 1 + + build() { + Column() { + TextInput({ text: this.text }).key('UIComponentTextInputPopupBoxInterface0027_textInput_001') + } + .width('100%') + .height('100%') + .scale({ x: this.scale1 }) + .opacity(this.opacity1) + .onClick(() => { + setTimeout(() => { + console.log('delay 1s'); + //router.pushUrl({ url: './UIComponentTextInputPopupBoxInterface0026' }) + }, 1000); + }) + .key('UIComponentTextInputPopupBoxInterface0027_column_001') + } + + pageTransition() { + PageTransitionEnter({ duration: 1200, curve: Curve.Linear }) + .onEnter((type: RouteType, progress: number) => { + if (type == RouteType.Push || type == RouteType.Pop) { + this.scale1 = progress + this.opacity1 = progress + } + }) + PageTransitionExit({ duration: 1200, curve: Curve.Ease }) + .onExit((type: RouteType, progress: number) => { + if (type == RouteType.Push) { + this.scale1 = 1 - progress + this.opacity1 = 1 - progress + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0028.ets new file mode 100755 index 00000000..9c0ab256 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0028.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 UIComponentTextInputPopupBoxInterface0028 { + @State placeholder: string = '请输入密码'; + @State isShowPassword: boolean = true; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .type(InputType.Password) + .showPassword(this.isShowPassword) + .minFontSize(px2vp(20)) + .maxFontSize(fp2px(20)) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0028_textInput_001') + Button('isShowPassword = true') + .visibility(this.button) + .onClick(() => { + this.isShowPassword = true; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0028_button_001') + Button('isShowPassword = false') + .visibility(this.button) + .onClick(() => { + this.isShowPassword = false; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0028_button_002') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0029.ets new file mode 100755 index 00000000..741f9447 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0029.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0029 { + @State placeholder: string = '请输入密码'; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .type(InputType.Password) + .showPassword(undefined) + .minFontSize(px2vp(20)) + .maxFontSize(fp2px(20)) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0029_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface003.ets new file mode 100755 index 00000000..c95ea2de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface003.ets @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface003 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .enabled(true) + .key('UIComponentTextInputPopupBoxInterface003_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0030.ets new file mode 100755 index 00000000..fc754d9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0030.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface0030 { + @State placeholder: string = '请输入密码'; + @State isShowPassword: boolean = true; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .type(InputType.Password) + .showPassword(true) + .minFontSize(px2vp(20)) + .maxFontSize(fp2px(20)) + .padding(10) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0030_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031.ets new file mode 100755 index 00000000..c8893f13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031.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 UIComponentTextInputPopupBoxInterface0031 { + @State placeholder: string = '请输入密码'; + @State passwordType: number = InputType.Normal; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(this.passwordType) + .minFontSize(px2vp(20)) + .maxFontSize(fp2px(20)) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0031_textInput_001') + Button('passwordType = Normal') + .visibility(this.button) + .onClick(() => { + this.passwordType = InputType.Normal; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0031_button_001') + Button('passwordType = NEW_PASSWORD') + .visibility(this.button) + .onClick(() => { + this.passwordType = InputType.NEW_PASSWORD; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0031_button_002') + Button('NUMBER_PASSWORD') + .visibility(this.button) + .onClick(() => { + this.passwordType = InputType.NUMBER_PASSWORD; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0031_button_003') + Button('NUMBER_DECIMAL') + .visibility(this.button) + .onClick(() => { + this.passwordType = InputType.NUMBER_DECIMAL; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0031_button_004') + Button('SCREEN_LOCK_PASSWORD') + .visibility(this.button) + .onClick(() => { + this.passwordType = InputType.SCREEN_LOCK_PASSWORD; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0031_button_005') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0032.ets new file mode 100755 index 00000000..b9d4b3e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0032.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 UIComponentTextInputPopupBoxInterface0032 { + @State placeholder: string = '请输入密码'; + @State minSize: number = -1; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .minFontSize(this.minSize) + .maxFontSize(fp2px(20)) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0032_textInput_001') + + Button('-1') + .visibility(this.button) + .onClick(() => { + this.minSize = -1; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0032_button_001') + Button('0') + .visibility(this.button) + .onClick(() => { + this.minSize = 0; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0032_button_002') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0033.ets new file mode 100755 index 00000000..de6a7da4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0033.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 UIComponentTextInputPopupBoxInterface0033 { + @State placeholder: string = '请输入密码'; + @State minSize: string = '10ABC'; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .minFontSize(this.minSize) + .type(InputType.Password) + .maxFontSize(fp2px(20)) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0033_textInput_001') + + Button('10ABC') + .visibility(this.button) + .onClick(() => { + this.minSize ='10ABC'; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0033_button_001') + Button('【0-9】') + .visibility(this.button) + .onClick(() => { + this.minSize = '【0-9】'; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0033_button_002') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0034.ets new file mode 100755 index 00000000..41e644d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0034.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0034 { + @State placeholder: string = '请输入密码'; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .minFontSize(undefined) + .maxFontSize(fp2px(20)) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0034_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0035.ets new file mode 100755 index 00000000..5436db65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0035.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0035 { + @State placeholder: string = '请输入密码'; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .maxFontSize(fp2px(20)) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0035_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036.ets new file mode 100755 index 00000000..ee7d7cdd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036.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 UIComponentTextInputPopupBoxInterface0036 { + @State placeholder: string = '请输入密码'; + @State maxSize: number = -1; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .maxFontSize(this.maxSize) + .minFontSize(10) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0036_textInput_001') + + Button('-1') + .visibility(this.button) + .onClick(() => { + this.maxSize = -1; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0036_button_001') + Button('0') + .visibility(this.button) + .onClick(() => { + this.maxSize = 0; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0036_button_002') + Button('-50') + .visibility(this.button) + .onClick(() => { + this.maxSize = -50; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0036_button_003') + Button('19') + .visibility(this.button) + .onClick(() => { + this.maxSize = 19; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0036_button_004') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0037.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0037.ets new file mode 100755 index 00000000..7852939e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0037.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0037 { + @State placeholder: string = '请输入密码'; + @State maxSize: string = '10ABC'; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .maxFontSize(this.maxSize) + .minFontSize(10) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0037_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0038.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0038.ets new file mode 100755 index 00000000..04ec1f57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0038.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0038 { + @State placeholder: string = '请输入密码'; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .minFontSize(10) + .type(InputType.Password) + .maxFontSize(undefined) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0038_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0039.ets new file mode 100755 index 00000000..e3c6c95b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0039.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0039 { + @State placeholder: string = '请输入密码'; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .minFontSize(10) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0039_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface004.ets new file mode 100755 index 00000000..416fc166 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface004.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface004 { + @State text: string = 'This is the test text. touchable is false'; + + build() { + Column() { + Search({ value: this.text }) + .touchable(false) + .key('UIComponentTextInputPopupBoxInterface004_search_001') + TextInput({ text: this.text }) + .touchable(false) + .key('UIComponentTextInputPopupBoxInterface004_textInput_001') + TextArea({ text: this.text }) + .touchable(false) + .height(200) + .margin({ top: 10 }) + .key('UIComponentTextInputPopupBoxInterface004_textArea_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0040.ets new file mode 100755 index 00000000..57a17ac8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0040.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 UIComponentTextInputPopupBoxInterface0040 { + @State placeholder: string = '请输入密码'; + @State contentStyle: number = TextInputStyle.Default; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .width('50%') + .height(50) + .type(InputType.Password) + .showPassword(true) + .style(TextInputStyle.Inline) + .borderWidth(1) + .margin(1) + .minFontSize(4) + .maxFontSize(40) + .maxLines(3) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .key('UIComponentTextInputPopupBoxInterface0040_textInput_001') + + Button('DEFAULT') + .visibility(this.button) + .onClick(() => { + this.contentStyle = TextInputStyle.Default + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0040_button_001') + Button('INLINE') + .visibility(this.button) + .onClick(() => { + this.contentStyle = TextInputStyle.Inline + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0040_button_002') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041.ets new file mode 100755 index 00000000..084949ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041.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 UIComponentTextInputPopupBoxInterface0041 { + @State placeholder: string = '请输入密码'; + @State fontFeature: string = "\"sups\" on"; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .maxFontSize(20) + .minFontSize(20) + .fontFeature(this.fontFeature) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .key('UIComponentTextInputPopupBoxInterface0041_textInput_001') + + Button('sups') + .visibility(this.button) + .onClick(() => { + this.fontFeature = "\"sups\" on"; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0041_button_001') + Button('numr') + .visibility(this.button) + .onClick(() => { + this.fontFeature = "\"numr\" on"; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0041_button_002') + Button('dnom') + .visibility(this.button) + .onClick(() => { + this.fontFeature = "\"dnom\" on"; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0041_button_003') + Button('subs') + .visibility(this.button) + .onClick(() => { + this.fontFeature = "\"subs\" off"; + this.button = Visibility.None; + }) + .key('UIComponentTextInputPopupBoxInterface0041_button_004') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0042.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0042.ets new file mode 100755 index 00000000..bd6d01cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0042.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0042 { + @State placeholder: string = '请输入密码'; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .copyOption(CopyOptions.InApp) + .showPassword(true) + .type(InputType.Password) + .maxFontSize(20) + .minFontSize(20) + .key('UIComponentTextInputPopupBoxInterface0042_textInput_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0043.ets new file mode 100755 index 00000000..44a03eb2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0043.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface0043 { + @State placeholder: string = '请输入密码'; + @State button: number = Visibility.Visible; + + build() { + Column() { + Text('测试文字超大行间距,测试文字超大行间距,测试文字超大行间距') + .copyOption(CopyOptions.InApp) + .lineSpacing(LengthMetrics.vp(200)) + .border({ width: 1 }) + .key('UIComponentTextInputPopupBoxInterface0043_text_001') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005.ets new file mode 100755 index 00000000..918f9b26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface005 { + @State text: string = 'This is the test text.This is the test text.'; + @State areaVisible: number = Visibility.Visible; + @State searchVisible: number = Visibility.Visible; + + build() { + Column() { + Search({ value: this.text }) + .margin(10) + .onClick(() => { + this.searchVisible = Visibility.Visible; + this.areaVisible = Visibility.None; + }) + .visibility(this.searchVisible) + .key('UIComponentTextInputPopupBoxInterface005_search_001') + TextArea({ text: this.text }) + .height(200) + .onClick(() => { + this.searchVisible = Visibility.None; + this.areaVisible = Visibility.Visible; + }) + .margin(10) + .visibility(this.areaVisible) + .key('UIComponentTextInputPopupBoxInterface005_textArea_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface006.ets new file mode 100755 index 00000000..1065b148 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface006.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface006 { + @State text: string = 'This is the test TextArea.This is the test TextArea.This is the test TextArea.This is the test TextArea.'; + @State areaVisible: number = Visibility.Visible; + + build() { + Column() { + Row() { + TextArea({ text: this.text }) + .height(200) + .margin(10) + .visibility(this.areaVisible) + .key('UIComponentTextInputPopupBoxInterface006_textArea_001') + Text('ұӦòʾ').height(100) + .margin(10) + } + .borderWidth(3) + .borderColor(Color.Brown) + .height(200) + .margin(10) + + Button('hide textArea') + .onClick(() => { + this.areaVisible = Visibility.Hidden; + }).key('UIComponentTextInputPopupBoxInterface006_text_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface007.ets new file mode 100755 index 00000000..9f96d2f7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface007.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. + */ + +@Entry +@Component +struct UIComponentTextInputPopupBoxInterface007 { + @State text: string = 'This is the test text.This is the test text.'; + @State inputVisible: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .margin(10) + .visibility(this.inputVisible) + .key('UIComponentTextInputPopupBoxInterface007_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface008.ets new file mode 100755 index 00000000..5c53393a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface008.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface008 { + @State text: string = 'This is the test text.This is the test text.This is the test text.'; + // @State areaVisible: number = Visibility.Visible; + @State searchVisible: number = Visibility.Visible; + + build() { + Column() { + Search({ value: this.text }) + .margin(10) + .copyOption(CopyOptions.InApp) + .onClick(() => { + // this.searchVisible = Visibility.Visible; + // this.areaVisible = Visibility.None; + }) + .visibility(this.searchVisible) + .key('UIComponentTextInputPopupBoxInterface008_search_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface009.ets new file mode 100755 index 00000000..68b2142f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface009.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInputPopupBoxInterface009 { + @State text: string = 'This is the test text.This is the test text.This is the test text.'; + // @State areaVisible: number = Visibility.Visible; + @State searchVisible: number = Visibility.Visible; + + build() { + Column() { + Search({ value: this.text }) + .margin(10) + .copyOption(CopyOptions.None) + .onClick(() => { + // this.searchVisible = Visibility.Visible; + // this.areaVisible = Visibility.None; + }) + .visibility(this.searchVisible) + .key('UIComponentTextInputPopupBoxInterface009_search_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500.ets new file mode 100755 index 00000000..269c1114 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500.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 UIComponentTextInputPopupBoxInterface0500 { + @State text: string = 'test popupbox menu'; + @State marginTop: number = 50 + @State hAlign: HorizontalAlign = HorizontalAlign.Center + @State vAlign: VerticalAlign = VerticalAlign.Center + + onCreateMenu(menuItems: Array) { + let item1: TextMenuItem = { + content: 'custom1', + icon: $r('app.media.icon'), + id: TextMenuItemId.of('custom1'), + } + let item2: TextMenuItem = { + content: 'custom2', + id: TextMenuItemId.of('custom2'), + icon: $r('app.media.icon'), + } + menuItems.push(item1) + menuItems.unshift(item2) + return menuItems + } + + build() { + Column() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('左上角').id('PBInterface0500_1').onClick(() => { + this.hAlign = HorizontalAlign.Start; + this.vAlign = VerticalAlign.Top; + }) + Button('右上角').id('PBInterface0500_2').onClick(() => { + this.hAlign = HorizontalAlign.End; + this.vAlign = VerticalAlign.Top; + }) + }.alignItems(VerticalAlign.Center) + + Row({ space: 10 }) { + Button('左下角').id('PBInterface0500_3').onClick(() => { + this.hAlign = HorizontalAlign.Start; + this.vAlign = VerticalAlign.Bottom; + }) + Button('右下角').id('PBInterface0500_4').onClick(() => { + this.hAlign = HorizontalAlign.End; + this.vAlign = VerticalAlign.Bottom; + }) + }.alignItems(VerticalAlign.Center) + }.width("100%").height('16%') + + Column() { + Row() { + TextInput({ text: this.text }) + .width(200) + .height(80) + .id('PBInterface0500_tInput') + .editMenuOptions({ + onCreateMenu: this.onCreateMenu, onMenuItemClick: (menuItem: TextMenuItem, textRange: TextRange) => { + if (menuItem.id.equals(TextMenuItemId.of("custom2"))) { + console.log("拦截 id: custom2 start:" + textRange.start + "; end:" + textRange.end) + return true; + } + if (menuItem.id.equals(TextMenuItemId.COPY)) { + console.log("拦截 COPY start:" + textRange.start + "; end:" + textRange.end) + return true; + } + if (menuItem.id.equals(TextMenuItemId.SELECT_ALL)) { + console.log("不拦截 SELECT_ALL start:" + textRange.start + "; end:" + textRange.end) + return false; + } + return false; + } + }) + }.height('100%').alignItems(this.vAlign) + }.width("100%").height('34%').alignItems(this.hAlign).borderWidth(2) + } + .width("90%").height('90%') + .margin("5%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface001.ets new file mode 100755 index 00000000..823ea20a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface001.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. + */ +import { i18n } from '@kit.LocalizationKit' +import { BusinessError } from '@kit.BasicServicesKit' + + +@Entry +@Component +struct UIComponentTextInterface001 { + @State message: string = 'This is a text, 测试文本?;:' + @State message_ug: string = ' بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Auto + @State clickFlags: number = 0 + + build() { + Row() { + Column() { + Text(this.message) + .direction(this.directionValue) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .onClick(()=>{ + this.message = this.message_ug + }) + .key('UIComponentTextInterface001_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.directionValue = Direction.Rtl + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Ltr + } else if (this.clickFlags == 3) { + this.clickFlags = 0 + this.directionValue = Direction.Auto + } + }).key('UIComponentTextInterface001_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0012.ets new file mode 100755 index 00000000..943cf411 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0012.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextInterface0012 { + @State message: string = 'This is a text, 测试文本?;: بۇ سىناق نۇسخىسى :؟'; + @State directionValue: number = Direction.Auto; + @State clickFlags: number = 0; + + build() { + Row() { + Column() { + Text(this.message) + .direction(this.directionValue) + .fontSize(20) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 10, + offsetY: 10 + }) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .key('UIComponentTextInterface0012_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1; + if (this.clickFlags == 1) { + this.directionValue = Direction.Rtl; + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Ltr; + } else if (this.clickFlags == 3) { + this.clickFlags = 0; + this.directionValue = Direction.Auto; + } + }).key('UIComponentTextInterface0012_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0013.ets new file mode 100755 index 00000000..c319e9b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0013.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInterface0013 { + @State message: string = ' بۇ سىناق نۇسخىسى :؟'; + @State directionValue: number = Direction.Auto; + @State clickFlags: number = 0; + + build() { + Row() { + Column() { + Text(this.message) + .direction(this.directionValue) + .textIndent(10) + .letterSpacing(20) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .key('UIComponentTextInterface0013_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1; + if (this.clickFlags == 1) { + this.directionValue = Direction.Rtl; + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Ltr; + } else if (this.clickFlags == 3) { + this.clickFlags = 0; + this.directionValue = Direction.Auto; + } + }).key('UIComponentTextInterface0013_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0014.ets new file mode 100755 index 00000000..565cd54d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0014.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextInterface0014 { + @State message: string = ' بۇ سىناق نۇسخىسى :؟ 3/4'; + @State directionValue: number = Direction.Auto; + @State clickFlags: number = 0; + + build() { + Row() { + Column() { + Text(this.message) + .direction(this.directionValue) + .fontSize(20) + .fontFeature("\"frac\" on") + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .key('UIComponentTextInterface0014_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1; + if (this.clickFlags == 1) { + this.directionValue = Direction.Rtl; + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Ltr; + } else if (this.clickFlags == 3) { + this.clickFlags = 0; + this.directionValue = Direction.Auto; + } + }).key('UIComponentTextInterface0014_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0015.ets new file mode 100755 index 00000000..72dc8f76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0015.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 UIComponentTextInterface0015 { + + @State spanText: string = '这是测试文本?:!...this is test text?'; + @State directionValue: number = Direction.Auto; + @State clickFlags: number = 0; + + build() { + Row() { + Column() { + Text() { + Span(this.spanText) + ImageSpan($r('app.media.app_icon')) + .width('40vp') + .height('40vp') + .verticalAlign(ImageSpanAlignment.CENTER) + } + .direction(this.directionValue) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .key('UIComponentTextInterface0015_001') + + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1; + if (this.clickFlags == 1) { + this.directionValue = Direction.Rtl; + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Ltr; + } else if (this.clickFlags == 3) { + this.clickFlags = 0; + this.directionValue = Direction.Auto; + } + }).key('UIComponentTextInterface0015_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0016.ets new file mode 100755 index 00000000..bae5820b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface0016.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 UIComponentTextInterface0016 { + + @State spanText: string = '这是测试文本?:!...this is test text?'; + @State directionValue: number = Direction.Auto; + @State clickFlags: number = 0; + + build() { + Row() { + Column() { + Text() { + Span(this.spanText) + ImageSpan($r('app.media.app_icon')) + .width('40vp') + .height('40vp') + .verticalAlign(ImageSpanAlignment.CENTER) + } + .direction(this.directionValue) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .key('UIComponentTextInterface0016_001') + + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1; + if (this.clickFlags == 1) { + this.directionValue = Direction.Auto; + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Ltr; + } else if (this.clickFlags == 3) { + this.clickFlags = 0; + this.directionValue = Direction.Rtl; + } + }).key('UIComponentTextInterface0016_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface002.ets new file mode 100755 index 00000000..87b6fa0e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface002.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 UIComponentTextInterface002 { + @State message: string = 'This is a text, 测试文本?;:This is a text, 测试文本?;:This is a text, 测试文本?;:' + @State message_ug: string = 'بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Auto + @State overflowValue: number = TextOverflow.Clip + @State clickFlags: number = 0 + + build() { + Row() { + Column() { + Text(this.message) + .direction(this.directionValue) + .textOverflow({overflow:this.overflowValue}) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .maxLines(1) + .onClick(()=>{ + this.message = this.message_ug + }) + .key('UIComponentTextInterface002_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.overflowValue = TextOverflow.Ellipsis + } else if (this.clickFlags == 2) { + this.clickFlags = 0 + this.overflowValue = TextOverflow.Clip + } + }).key('UIComponentTextInterface002_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface003.ets new file mode 100755 index 00000000..b3f005fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface003.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 UIComponentTextInterface003 { + @State message: string = 'This is a text, 测试文本?;:This is a text, 测试文本?;:This is a text, 测试文本?;:' + @State message_ug: string = 'بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Rtl + @State overflowValue: number = TextOverflow.Clip + @State clickFlags: number = 0 + + build() { + Row() { + Column() { + Text(this.message) + .direction(this.directionValue) + .textOverflow({overflow:this.overflowValue}) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .maxLines(1) + .onClick(()=>{ + this.message = this.message_ug + }) + .key('UIComponentTextInterface003_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.overflowValue = TextOverflow.Ellipsis + } else if (this.clickFlags == 2) { + this.clickFlags = 0 + this.overflowValue = TextOverflow.Clip + } + }).key('UIComponentTextInterface003_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface004.ets new file mode 100755 index 00000000..62b3a7f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface004.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 UIComponentTextInterface004 { + @State message: string = 'This is a text, 测试文本?;:This is a text, 测试文本?;:This is a text, 测试文本?;:' + @State message_ug: string = 'بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟ بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Ltr + @State overflowValue: number = TextOverflow.Clip + @State clickFlags: number = 0 + + build() { + Row() { + Column() { + Text(this.message) + .direction(this.directionValue) + .textOverflow({overflow:this.overflowValue}) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .maxLines(1) + .onClick(()=>{ + this.message = this.message_ug + }) + .key('UIComponentTextInterface004_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.overflowValue = TextOverflow.Ellipsis + } else if (this.clickFlags == 2) { + this.clickFlags = 0 + this.overflowValue = TextOverflow.Clip + } + }).key('UIComponentTextInterface004_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface005.ets new file mode 100755 index 00000000..c00813d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface005.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 UIComponentTextInterface005 { + @State message: string = 'This is a text, 测试文本?;:' + @State message_ug: string = ' بۇ سىناق نۇسخىسى :؟' + @State textAlignValue: number = TextAlign.Start + @State clickFlags: number = 0 + + build() { + Row() { + Column() { + Text(this.message_ug) + .textAlign(this.textAlignValue) + .fontSize(20) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .maxLines(1) + .onClick(()=>{ + this.message_ug = this.message + }) + .key('UIComponentTextInterface005_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.textAlignValue = TextAlign.Center + } else if (this.clickFlags == 2) { + this.textAlignValue = TextAlign.End + }else if (this.clickFlags == 3) { + this.clickFlags = 0 + this.textAlignValue = TextAlign.Start + } + }).key('UIComponentTextInterface005_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface006.ets new file mode 100755 index 00000000..c983bee1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface006.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 UIComponentTextInterface006 { + @State message: string = 'This is a text, 测试文本?;:' + @State message_ug: string = ' بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Auto + @State clickFlags: number = 0 + + build() { + Row() { + Column() { + Text(this.message_ug) + .direction(this.directionValue) + .fontSize(20) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 10, + offsetY: 10 + }) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .onClick(()=>{ + this.message_ug = this.message + }) + .key('UIComponentTextInterface006_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.directionValue = Direction.Rtl + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Ltr + } else if (this.clickFlags == 3) { + this.clickFlags = 0 + this.directionValue = Direction.Auto + } + }).key('UIComponentTextInterface006_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface007.ets new file mode 100755 index 00000000..debc932b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface007.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UIComponentTextInterface007 { + @State message: string = 'This is a text, 测试文本?;:' + @State message_ug: string = ' بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Auto + @State clickFlags: number = 0 + + build() { + Row() { + Column() { + Text(this.message_ug) + .direction(this.directionValue) + .fontSize(20) + .draggable(true) + .copyOption(CopyOptions.InApp) + .onCopy((value:string)=>{ + promptAction.showToast({ + message: 'copy success value: ' + value, + duration: 2000, + }) + }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .key('UIComponentTextInterface007_001') + + TextArea({ placeholder: '这是提示文本' }) + .margin({ top: 10 }) + .height(100).key('UIComponentTextInterface007_textArea_001') + + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.directionValue = Direction.Auto + }).key('UIComponentTextInterface007_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface008.ets new file mode 100755 index 00000000..03bfc8da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface008.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. + */ + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@ohos.base'; +@Entry +@Component +struct UIComponentTextInterface008 { + @State message: string = 'This is a text, 测试文本?;:' + @State message_ug: string = ' بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Auto + @State clickFlags: number = 0 + private portrait: boolean = true + build() { + Row() { + Column() { + Text(this.message_ug) + .direction(this.directionValue) + .fontSize(20) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 10, + offsetY: 10 + }) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .onClick(()=>{ + this.message_ug = this.message + }) + .key('UIComponentTextInterface008_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.directionValue = Direction.Ltr + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Rtl + } else if (this.clickFlags == 3) { + this.clickFlags = 0 + this.directionValue = Direction.Auto + } + }).key('UIComponentTextInterface008_button_001') + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface009.ets new file mode 100755 index 00000000..e94b532e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface009.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 { BusinessError } from '@ohos.base'; +import { window } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextInterface009 { + @State message: string = 'This is a text, 测试文本?;:' + @State message_ug: string = ' بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Auto + @State clickFlags: number = 0 + private portrait: boolean = true + + build() { + Row() { + Column() { + Text(this.message_ug) + .direction(this.directionValue) + .fontSize(20) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 10, + offsetY: 10 + }) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .onClick(() => { + this.message_ug = this.message + }) + .key('UIComponentTextInterface009_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.showSmallWindow(); + }).key('UIComponentTextInterface009_button_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.directionValue = Direction.Ltr + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Rtl + } else if (this.clickFlags == 3) { + this.clickFlags = 0 + this.directionValue = Direction.Auto + } + }).key('UIComponentTextInterface009_button_002') + + } + .width('100%') + .height('100%') + } + } + + showSmallWindow() { + let windowClass: window.Window | undefined = undefined; + let config: window.Configuration = { + name: "test", + windowType: window.WindowType.TYPE_DIALOG, + ctx: getContext() + }; + try { + let promise = window.createWindow(config); + promise.then((data) => { + windowClass = data; + let windowLimits: window.WindowLimits = { + maxWidth: 500, + maxHeight: 200, + minWidth: 500, + minHeight: 400 + }; + windowClass.setWindowLimits(windowLimits) + windowClass.resize(500, 200) + windowClass.moveWindowTo(300, 300); + windowClass.setUIContent("testability/pages/UIComponentTextInterface/UIComponentTextInterface007", (err: BusinessError) => { + let errCode: number = err.code; + if (errCode) { + console.error('Failed to load the content. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in loading the content.'); + windowClass?.showWindow((err: BusinessError) => { + let errCode: number = err.code; + if (errCode) { + console.error('Failed to show the window. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in showing the window.'); + }); + }) + }).catch((err: BusinessError) => { + console.error(`Failed to create the Window. Cause code: ${err.code}, message: ${err.message}`); + }); + } catch (exception) { + console.error(`Failed to create the window. Cause code: ${exception.code}, message: ${exception.message}`); + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface001.ets new file mode 100755 index 00000000..733c8146 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface001.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextSafePasteInterface001 { + @State text: string = 'This is test text.This is test text.'; + @State isHidden: boolean = false; + + build() { + Column() { + TextInput({ text: this.text }) + .fontSize(20) + .selectionMenuHidden(this.isHidden) + .key('UIComponentTextSafePasteInterface001_textInput_001') + Text('set Hidden = true') + .onClick(() => { + this.isHidden = true; + }) + .width('100%') + .textAlign(TextAlign.Start) + .margin({ top: 50 }) + .key('UIComponentTextSafePasteInterface001_text_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface002.ets new file mode 100755 index 00000000..3185911c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface002.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextSafePasteInterface002 { + @State text: string = 'This is test text.This is test text.'; + @State isHidden: boolean = false; + + build() { + Column() { + TextArea({ text: this.text }) + .fontSize(20) + .selectionMenuHidden(this.isHidden) + .key('UIComponentTextSafePasteInterface002_textArea_001') + Text('set Hidden = true') + .onClick(() => { + this.isHidden = true; + }) + .width('100%') + .textAlign(TextAlign.Start) + .margin({ top: 50 }) + .key('UIComponentTextSafePasteInterface002_text_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface003.ets new file mode 100755 index 00000000..accfe5fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface003.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. + */ + + +import pasteboard from '@ohos.pasteboard'; +import { BusinessError } from '@ohos.base'; + +@Entry +@Component +struct UIComponentTextSafePasteInterface003 { + @State message: string = ''; + @State text: string = ''; + + build() { + Row() { + Column({ space: 10 }) { + Text(this.message) + Text('123456789').copyOption(CopyOptions.InApp).key('UIComponentTextSafePasteInterface003_text_001') + TextInput({ placeholder: '请输入文本', text: this.text }).onPaste(() => { + this.message = 'onPaste callback' + this.text; + }).key('UIComponentTextSafePasteInterface003_textInput_001') + PasteButton().onClick((event: ClickEvent, result: PasteButtonOnClickResult) => { + if (PasteButtonOnClickResult.SUCCESS === result) { + pasteboard.getSystemPasteboard().getData((err: BusinessError, pasteData: pasteboard.PasteData) => { + if (err) { + console.error(`Failed to get paste data. Code is ${err.code}, message is ${err.message}`); + return; + } + // 剪贴板内容为 '123456' + this.text = '安全控件粘贴内容:' + pasteData.getPrimaryText(); + }); + } + }).key('UIComponentTextSafePasteInterface003_paste_001') + } + .width('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface004.ets new file mode 100755 index 00000000..1563dbdb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface004.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextSafePasteInterface004 { + @State isHidden: boolean = false; + + build() { + Row() { + Column({ space: 10 }) { + Button('selectionMenuHidden=true').onClick(() => { + this.isHidden = true; + }).id('UIComponentTextSafePasteInterface004_button_01') + TextArea({ placeholder: '请输入文本', text: '这是测试文本' }).selectionMenuHidden(this.isHidden) + .key('UIComponentTextSafePasteInterface004_textInput_001') + } + .width('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080.ets new file mode 100755 index 00000000..31b38e5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0080 { + @State text: string = '0123456' + @State res: string = 'before opt: '; + @State style001: TextInputStyle = TextInputStyle.Default; + @State start: number = 0 + @State end: number = 20 + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.res) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .id('res_text') + } + .width('100%') + + TextInput({ + placeholder: 'input', + controller: this.controller + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .id('textinputselection0080') + .onChange((value: string) => { + console.log(`onChange:${value}`); + this.text = value; + }) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + this.res = 'after onCopy: ' + value; + }) + .onCut((value: string) => { + console.log(`onCut:${value}`); + this.res = 'after onCut: ' + value; + }) + .onPaste((value: string) => { + console.log(`onPaste:${value}`); + this.res = 'after onPaste: ' + 'onPaste'; + }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0110.ets new file mode 100755 index 00000000..c7afe10f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0110.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0110 { + @State changeValue: string = '测试文本' + @State submitValue: string = '' + @State text: string = '0123456' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + + build() { + Column() { + Text('onSubmit:' + this.submitValue).fontSize(18).margin(15).id('submit_text') + TextInput({ + text: 'press ENTER for submit', + controller: this.controller + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .id('textinputselection0110') + .onSubmit((key: EnterKeyType) => { + console.log(`onSubmit:${key}`); + this.enterKeyType = key.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (key == this.enterKeyTypeNum[index]) { + this.submitValue = this.enterKeyTypeStr[index]; + } + } + }) + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('search0110') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + console.log(`onSubmit:${value}`); + this.submitValue = value; + }) + .onChange((value: string) => { + console.log(`onChange:${value}`); + this.changeValue = value; + }) + .margin(20) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0120.ets new file mode 100755 index 00000000..812b0b70 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0120.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0120 { + @State text: string = '0123456' + + build() { + Column() { + Column() { + // 为图片添加点击事件,点击完成后加载特定图片 + Image('icon.png') + .id('image0120') + .width(100) + .height(100) + .copyOption(CopyOptions.InApp) + } + .width('100%') + + TextInput({ + text: 'for image' + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .id('textinputselection0120') + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130.ets new file mode 100755 index 00000000..a9049471 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0130 { + @State text: string = '0123456' + build() { + Column() { + Column() { + // 为图片添加点击事件,点击完成后加载特定图片 + Image('icon.png') + .id('image0130') + .width(100) + .height(100) + .copyOption(CopyOptions.LocalDevice) + } + .width('100%') + + TextInput({ + text: 'for image' + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .id('textinputselection0130') + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0170.ets new file mode 100755 index 00000000..4c54b2d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0170.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0170 { + icon: Resource = $r("app.media.icon") + @State text: string = '0123456' + + build() { + Column() { + Column() { + Image('icon.png') + .id('image0170') + .width(100) + .height(100) + .backgroundColor(Color.Blue) + .copyOption(CopyOptions.None) + } + .width('100%') + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0300.ets new file mode 100755 index 00000000..4d20687b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0300.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0300 { + @State text: string = '这是提示文本' + @State res: string = 'before copy: '; + @State style001: TextInputStyle = TextInputStyle.Default; + @State start: number = 0 + @State end: number = 20 + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.res) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .id('res_text') + } + .width('100%') + + TextInput({ + placeholder: this.text, + controller: this.controller + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .id('textinputselection0300') + .copyOption(CopyOptions.InApp) + .onChange((value: string) => { + console.log(`onChange:${value}`); + }) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + }) + .onCut((value: string) => { + console.log(`onCut:${value}`); + }) + .onPaste((value: string) => { + console.log(`onPaste:${value}`); + }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310.ets new file mode 100755 index 00000000..2acd74c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0310 { + @State text: string = '这是提示文本' + @State res: string = 'before copy: '; + @State style001: TextInputStyle = TextInputStyle.Default; + @State start: number = 0 + @State end: number = 20 + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.res) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .id('res_text') + } + .width('100%') + + TextInput({ + placeholder: this.text, + controller: this.controller + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .id('textinputselection0310') + .copyOption(CopyOptions.LocalDevice) + .onChange((value: string) => { + console.log(`onChange:${value}`); + }) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + }) + .onCut((value: string) => { + console.log(`onCut:${value}`); + }) + .onPaste((value: string) => { + console.log(`onPaste:${value}`); + }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0340.ets new file mode 100755 index 00000000..748e3603 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0340.ets @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0340 { + @State text: string = '这是提示文本' + @State res: string = 'before copy: '; + @State style001: TextInputStyle = TextInputStyle.Default; + @State start: number = 0 + @State end: number = 20 + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.res) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .id('res_text') + } + .width('100%') + + TextInput({ + placeholder: this.text, + controller: this.controller + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .id('textinputselection0340') + .copyOption(CopyOptions.None) + .onChange((value: string) => { + console.log(`onChange:${value}`); + }) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + }) + .onCut((value: string) => { + console.log(`onCut:${value}`); + }) + .onPaste((value: string) => { + console.log(`onPaste:${value}`); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0360.ets new file mode 100755 index 00000000..1db17e8b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0360.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0360 { + @State text: string = '这是一段文本' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .fontSize(20) + .copyOption(CopyOptions.InApp) + .fontWeight(FontWeight.Bold) + .id('text_select_0360') + } + .width('100%') + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0370.ets new file mode 100755 index 00000000..01650ecf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0370.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0370 { + @State text: string = '这是一段文本' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .fontSize(20) + .copyOption(CopyOptions.LocalDevice) + .fontWeight(FontWeight.Bold) + .id('text_select_0370') + } + .width('100%') + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0380.ets new file mode 100755 index 00000000..f20d27e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0380.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0380 { + @State text: string = '这是一段文本' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .fontSize(20) + .copyOption(CopyOptions.None) + .fontWeight(FontWeight.Bold) + .id('text_select_0380') + } + .width('100%') + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0390.ets new file mode 100755 index 00000000..895bcf13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0390.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0390 { + @State text: string = '这是一段文本' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .fontSize(20) + .maxLines(1) + .copyOption(CopyOptions.LocalDevice) + .fontWeight(FontWeight.Bold) + .id('text_select_0390') + } + .width('100%') + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0400.ets new file mode 100755 index 00000000..d1609615 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0400.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0400 { + @State text: string = '这是一段文本\n这是一段文本\n这是一段文本\n这是一段文本\n这是一段文本' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .fontSize(20) + .copyOption(CopyOptions.LocalDevice) + .fontWeight(FontWeight.Bold) + .id('text_select_0400') + } + .width('100%') + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0410.ets new file mode 100755 index 00000000..da9d00f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0410.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionInterface0410 { + @State text: string = '这是一段文本' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .fontSize(20) + .maxLines(1) + .copyOption(CopyOptions.InApp) + .fontWeight(FontWeight.Bold) + .id('text_select_0410') + } + .width('100%') + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface_menu.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface_menu.ets new file mode 100755 index 00000000..d0a45e56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface_menu.ets @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import font from '@ohos.font'; + +@Entry +@Component +struct UIComponentTextSelectionInterface_menu { + private iconStr: ResourceStr = $r("app.media.icon") + + aboutToAppear() { + font.registerFont({ + familyName: 'ownfonttwo', + familySrc: $rawfile('font/own1.ttf') + }); + } + + @Builder + SubMenu() { + Menu() { + MenuItem({ content: "复制", labelInfo: "Ctrl+C" }) + MenuItem({ content: "粘贴", labelInfo: "Ctrl+V" }) + MenuItem({ content: "全选", labelInfo: "Ctrl+A" }) + } + } + + @Builder + MyMenu() { + Menu() { + MenuItem({ startIcon: $r("app.media.icon"), content: "菜单选项" }) + MenuItem({ startIcon: $r("app.media.icon"), content: "菜单选项" }) + MenuItem({ startIcon: $r("app.media.icon"), content: "菜单选项" }) + .enabled(false) + MenuItem({ + startIcon: this.iconStr, + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + MenuItemGroup({ header: '小标题' }) { + MenuItem({ + startIcon: this.iconStr, + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + } + + MenuItem({ + startIcon: this.iconStr, + content: "菜单选项", + }) + } + .font({ family: 'ownfonttwo' }) + } + + build() { + Row() { + Column() { + TextInput({ placeholder: 'click to show menu' }) + .fontSize(50) + .fontWeight(FontWeight.Bold).bindMenu(this.MyMenu) + } + //.bindMenu(this.MyMenu) + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0010.ets new file mode 100755 index 00000000..e225b6cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0010.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0010 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions: this.editorMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions) + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0010') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0010') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0020.ets new file mode 100755 index 00000000..68668757 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0020.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. + */ +import { SelectionMenu, EditorMenuOptions, ExpandedMenuOptions, EditorEventInfo, SelectionMenuOptions } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0020 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon:'icon.png'}] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions:this.editorMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0020') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT,this.MyMenu(),RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0020') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0030.ets new file mode 100755 index 00000000..29fd5547 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0030.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0030 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon: 'icon.png' }, { icon: 'cat.jpg' }] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions: this.editorMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions) + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0030') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0030') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0040.ets new file mode 100755 index 00000000..b047b1fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0040.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. + */ +import { SelectionMenu, EditorMenuOptions, ExpandedMenuOptions, EditorEventInfo, SelectionMenuOptions } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0040 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon:'icon.png'},{ icon:'cat.jpg'},{icon:'openeye.png'}] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions:this.editorMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0040') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT,this.MyMenu(),RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0040') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0050.ets new file mode 100755 index 00000000..aa00b576 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0050.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 { SelectionMenu, EditorMenuOptions, ExpandedMenuOptions, EditorEventInfo, SelectionMenuOptions } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0050 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon:'icon.png'},{ icon:'cat.jpg'},{icon:'openeye.png'},{ icon:'icon.png'}] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions:this.editorMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0050') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT,this.MyMenu(),RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0050') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0060.ets new file mode 100755 index 00000000..d260253a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0060.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 { SelectionMenu, EditorMenuOptions, ExpandedMenuOptions, EditorEventInfo, SelectionMenuOptions } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0060 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon:'icon.png'},{ icon:'cat.jpg'},{icon:'openeye.png'},{ icon:'icon.png'},{ icon:'cat.jpg'}] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions:this.editorMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions) + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0060') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT,this.MyMenu(),RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0060') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0070.ets new file mode 100755 index 00000000..daea9586 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0070.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0070 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon: 'icon.png' }, { icon: 'cat.jpg' }, { icon: 'openeye.png' }, { icon: 'icon.png' }, { icon: 'openeye.png' }, + { icon: 'cat.jpg' }] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions: this.editorMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions) + } + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0070') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0070') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0080.ets new file mode 100755 index 00000000..6b32fd4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0080.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 { SelectionMenu, SelectionMenuOptions } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0080 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private selectionMenuOptions: SelectionMenuOptions = { + controller: undefined + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions) + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0080') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0080') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0090.ets new file mode 100755 index 00000000..3aeb4468 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0090.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0090 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private selectionMenuOptions: SelectionMenuOptions = { + controller: this.controller + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions) + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0090') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + Button("Switch Locales").id('text_selectionmenu_btn_0090') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0100.ets new file mode 100755 index 00000000..1126f955 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0100.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0100 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private expandedMenuOptions: Array = + [{ + startIcon: '', content: '词典', action: () => { + } + }, { + startIcon: $r("app.media.icon"), content: '翻译', action: () => { + } + }, { + startIcon: $r("app.media.icon"), content: '搜索', action: () => { + } + }] + private selectionMenuOptions: SelectionMenuOptions = { + expandedMenuOptions: undefined + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0100') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0100') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0110.ets new file mode 100755 index 00000000..f8a37ae3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0110.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0110 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'HelloWord' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private expandedMenuOptions: Array = + [{ + startIcon: $r("app.media.icon"), content: '分享', action: () => { + } + }, { + startIcon: $r("app.media.icon"), content: '翻译', action: () => { + } + }, { + startIcon: $r("app.media.icon"), content: '搜索', action: () => { + } + }] + private selectionMenuOptions: SelectionMenuOptions = { + expandedMenuOptions: this.expandedMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions) + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0110') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 30 } }); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Black, fontSize: 25 } }); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width('100%') + .height(200) + + Button("Switch Locales").id('text_selectionmenu_btn_0110') + .onClick((event: ClickEvent) => { + Settings.switchLocales(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0120.ets new file mode 100755 index 00000000..e0999b0d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0120.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0120 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'LongPressTest' + @State btn1Str: string = 'SelectOption' + @State btn2Str: string = 'ChangeLocaleOption' + @State changeLocale: string = 'zh-CN' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private expandedMenuOptions: Array = + [{ + startIcon: 'cat.jpg', content: '词典', action: () => { + console.log('click it>>') + this.options.controller.closeSelectionMenu() + } + }, { + startIcon: 'icon.png', content: '翻译', action: () => { + } + }, { + startIcon: 'openeye.png', content: '搜索', action: () => { + } + }] + private selectionMenuOptions: SelectionMenuOptions = { + expandedMenuOptions: this.expandedMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0120') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 20 } }); + }) + .onSelect((value: RichEditorSelection) => { + console.log('onSelect >>>'); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.RIGHT_CLICK) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.SELECT) + .borderWidth(1) + .borderColor(Color.Red); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0130.ets new file mode 100755 index 00000000..c49eba06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0130.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. + */ +import { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0130 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'RichEditorSpanTypeTest' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private expandedMenuOptions: Array = + [{ + startIcon: 'cat.jpg', content: '词典', action: () => { + console.log('click it>>'); + this.options.controller.closeSelectionMenu(); + } + }, { + startIcon: 'icon.png', content: '翻译', action: () => { + } + }, { + startIcon: 'openeye.png', content: '搜索', action: () => { + } + }] + private selectionMenuOptions: SelectionMenuOptions = { + expandedMenuOptions: this.expandedMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0130') + .onReady(() => { + this.controller.setCaretOffset(0); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 20 } }); + this.controller.addImageSpan('cat.jpg', { imageStyle: { size: ["50px", "50px"] } }); + }) + .onSelect((value: RichEditorSelection) => { + console.log('onSelect >>>'); + }) + .bindSelectionMenu(RichEditorSpanType.IMAGE, this.MyMenu(), RichEditorResponseType.LONG_PRESS, { + onAppear: () => { + console.info(`onAppear`); + } + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .bindSelectionMenu(RichEditorSpanType.MIXED, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width(500) + .height(100) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_1.ets new file mode 100755 index 00000000..0f5536a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_1.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0140_1 { + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('It is Text') + .id('textSelectionMenuJingXiang0140_tx') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_2.ets new file mode 100755 index 00000000..2bf09416 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_2.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 UIComponentTextSelectionMenuJingXiang0140_2 { + textController: TextInputController = new TextInputController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + onCreateMenu(menuItems: Array) { + let item1: TextMenuItem = { + content: 'custom1', + icon: 'icon.png', + id: TextMenuItemId.of('custom1'), + } + let item2: TextMenuItem = { + content: 'custom2', + id: TextMenuItemId.of('custom2'), + icon: 'icon.png', + } + menuItems.push(item1) + menuItems.unshift(item2) + return menuItems + } + + build() { + Column() { + TextInput({ text: 'It is TextInput' }) + .id('textSelectionMenuJingXiang0140_txInput') + .margin(10) + .fontColor(Color.Green) + .bindContextMenu(this.TextCustomMenu(), ResponseType.LongPress) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_3.ets new file mode 100755 index 00000000..a379aafa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_3.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextSelectionMenuJingXiang0140_3 { + textController: TextInputController = new TextInputController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + TextArea({ text: 'It is TextArea' }) + .id('textSelectionMenuJingXiang0140_txArea') + .margin(10) + .fontColor(Color.Green) + .bindContextMenu(this.TextCustomMenu(), ResponseType.LongPress) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_4.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_4.ets new file mode 100755 index 00000000..6730e256 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_4.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 UIComponentTextSelectionMenuJingXiang0140_4 { + @State select: boolean = true + s_controller: SearchController = new SearchController() + + onCreateMenu(menuItems: Array) { + let item1: TextMenuItem = { + content: 'custom1', + icon: 'icon.png', + id: TextMenuItemId.of('custom1'), + } + let item2: TextMenuItem = { + content: 'custom2', + id: TextMenuItemId.of('custom2'), + icon: 'icon.png', + } + menuItems.push(item1) + menuItems.unshift(item2) + return menuItems + } + + build() { + Column() { + Search({ value: 'It is Search', placeholder: 'Type to search...', controller: this.s_controller }) + .id('textSelectionMenuJingXiang0140_search') + .searchButton('SEARCH') + .width('100%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .editMenuOptions({ + onCreateMenu: this.onCreateMenu, onMenuItemClick: (menuItem: TextMenuItem, textRange: TextRange) => { + if (menuItem.id.equals(TextMenuItemId.of("custom2"))) { + console.log("拦截 id: custom2 start:" + textRange.start + "; end:" + textRange.end) + return true; + } + if (menuItem.id.equals(TextMenuItemId.COPY)) { + console.log("拦截 COPY start:" + textRange.start + "; end:" + textRange.end) + return true; + } + if (menuItem.id.equals(TextMenuItemId.SELECT_ALL)) { + console.log("不拦截 SELECT_ALL start:" + textRange.start + "; end:" + textRange.end) + return false; + } + return false; + } + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_5.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_5.ets new file mode 100755 index 00000000..84b0841d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_5.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 { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0140_5 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'RichEditorSpanTypeTest' + @State textSize: number = 30 + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon: 'icon.png' }, { icon: 'cat.jpg' }, { icon: 'openeye.png' }, { icon: 'icon.png' }, { icon: 'openeye.png' }, + { icon: 'cat.jpg' }] + private expandedMenuOptions: Array = + [{ + startIcon: 'cat.jpg', content: '词典', action: () => { + console.log('click it>>'); + this.options.controller.closeSelectionMenu(); + } + }, { + startIcon: 'icon.png', content: '翻译', action: () => { + } + }, { + startIcon: 'openeye.png', content: '搜索', action: () => { + } + }] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions:this.editorMenuOptions, + controller:this.controller, + expandedMenuOptions: this.expandedMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + Column() { + RichEditor(this.options) + .id('textSelectionMenuJingXiang0140_richEd') + .onReady(() => { + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 20 } }); + }) + .onSelect((value: RichEditorSelection) => { + console.log('onSelect >>>'); + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width(500) + .height(100) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0160.ets new file mode 100755 index 00000000..179b3e24 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0160.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. + */ +import { + SelectionMenu, + EditorMenuOptions, + ExpandedMenuOptions, + EditorEventInfo, + SelectionMenuOptions +} from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextSelectionMenuJingXiang0160 { + @State select: boolean = true + controller: RichEditorController = new RichEditorController(); + textController: TextController = new TextController(); + options: RichEditorOptions = { controller: this.controller } + @State message: string = 'RichEditorSpanTypeTest' + @State textSize: number = 30 + @State fontWeight: FontWeight = FontWeight.Normal + @State start: number = -1 + @State end: number = -1 + @State visibleValue: Visibility = Visibility.Visible + @State colorTransparent: Color = Color.Transparent + @State textStyle: RichEditorTextStyle = {} + private editorMenuOptions: Array = + [{ icon: 'icon.png' }, { icon: 'cat.jpg' }, { icon: 'openeye.png' }, { icon: 'icon.png' }, { icon: 'openeye.png' }, + { icon: 'cat.jpg' }] + private expandedMenuOptions: Array = + [{ + startIcon: 'cat.jpg', content: '词典', action: () => { + console.log('click it>>'); + this.options.controller.closeSelectionMenu(); + } + }, { + startIcon: 'icon.png', content: '翻译', action: () => { + } + }, { + startIcon: 'openeye.png', content: '搜索', action: () => { + } + }] + private selectionMenuOptions: SelectionMenuOptions = { + editorMenuOptions: this.editorMenuOptions, + controller: this.controller, + expandedMenuOptions: this.expandedMenuOptions + } + + @Builder + MyMenu() { + Column() { + SelectionMenu(this.selectionMenuOptions); + } + .width(256) + .backgroundColor(Color.Transparent) + } + + build() { + Column() { + Column() { + RichEditor(this.options) + .id('text_selectionmenu_0160') + .onReady(() => { + this.controller.setCaretOffset(0); + this.controller.addTextSpan(this.message, { style: { fontColor: Color.Orange, fontSize: 20 } }); + }) + .onSelect((value: RichEditorSelection) => { + console.log('onSelect >>>'); + }) + .bindSelectionMenu(RichEditorSpanType.IMAGE, this.MyMenu(), RichEditorResponseType.LONG_PRESS, { + onAppear: () => { + console.info(`onAppear`); + } + }) + .bindSelectionMenu(RichEditorSpanType.TEXT, this.MyMenu(), RichEditorResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width(500) + .height(100) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_1.ets new file mode 100755 index 00000000..0f89e6fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_1.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. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0010_1 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ + text: this.tiTxt, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .width('80%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0010_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.tiTxt.length; + this.textInputController.setTextSelection(0, length); + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_2.ets new file mode 100755 index 00000000..b8b04938 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_2.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0010_2 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + + build() { + Column() { + Search({ + value: this.changeValue, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0010_search') + .searchButton('SEARCH') + .width('100%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + if (selectionStart == selectionEnd) { + this.seSelectRes = `Search{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.changeValue.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + this.seSelectRes = `Search{select:[${selectionStart},${selectionEnd}]}`; + } + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_3.ets new file mode 100755 index 00000000..687cdc2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_3.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. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0010_3 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taTxt: string = 'TextArea:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.taTxt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .id('textSelectionOptimization0010_txArea') + .width('100%') + .margin(20) + .height(50) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextArea{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.taTxt.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + this.taSelectRes = `TextArea{select:[${selectionStart},${selectionEnd}]}`; + } + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_1.ets new file mode 100755 index 00000000..de05c148 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_1.ets @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0030_1 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State nextType: number = InputType.Normal; + nextTypeStr: string = 'InputType.Number' + curTypeStr: string = 'InputType.Normal' + curTypeMsg: string = 'TextInputyuiewfi769\n%……&*(&))*(&*\n#$%^&YVJHG*HNT16545132' + // @State testRes: string = + // 'current InputType is:{' + this.curTypeStr + ',next InputType is' + this.nextTypeStr + '}\n'; + @State testRes: string = '' + @State btnEnable: boolean = true + + build() { + Column() { + TextInput({ + text: this.curTypeMsg, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .type(this.nextType) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0030_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current InputType is:' + this.curTypeStr + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch Type') + .id('textSelectionOptimization0030_1_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case InputType.Normal: + this.nextType = InputType.Number; + this.curTypeStr = 'InputType.Number'; + this.nextTypeStr = 'InputType.PhoneNumber'; + this.curTypeMsg = 'sgughakjh5876980809806\ngdausihio8 9uyssh98f67yh\n798789y98y89y8'; + break; + case InputType.Number: + this.nextType = InputType.PhoneNumber; + this.curTypeStr = 'InputType.PhoneNumber'; + this.nextTypeStr = 'InputType.Email'; + this.curTypeMsg = '13912345678\n7698-4578978\n(79868-85645dsfsfa8)'; + break; + case InputType.PhoneNumber: + this.nextType = InputType.Email; + this.curTypeStr = 'InputType.Email'; + this.nextTypeStr = 'InputType.Password'; + this.curTypeMsg = 'sahgfuahoi@gsuhf\n7@@d98-4578978\n(79868-vdidfa8)'; + break; + case InputType.Email: + this.nextType = InputType.Password; + this.curTypeStr = 'InputType.Password'; + this.nextTypeStr = 'InputType.URL'; + this.curTypeMsg = 'sahgDFS3452fuahoi@gsuhf\n7@@d98-4578978\n(79868-vdidfa8)'; + break; + case InputType.Password: + this.nextType = InputType.URL; + this.curTypeStr = 'InputType.URL'; + this.nextTypeStr = 'nothing'; + this.curTypeMsg = 'https://docs.qq.com/sheet/safa?tab=tb0riy\dfa://safafvs./browse/sds-6565?filter=-1\n'; + this.btnEnable = false; + break; + case InputType.URL: + this.btnEnable = false; + return; + } + // this.testRes += '{current InputType is:' + this.curTypeStr + ',next InputType is' + this.nextTypeStr + '}\n'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_2.ets new file mode 100755 index 00000000..e9d42819 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_2.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. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0030_2 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State nextType: number = SearchType.NORMAL; + nextTypeStr: string = 'SearchType.Number' + curTypeStr: string = 'SearchType.Normal' + curTypeMsg: string = 'asfsfafdsg4%^&*()_+(\n%……&*(&))*(&*\n#$%^&YVJHG*HNT16545132' + @State testRes: string = + 'current SearchType is:{' + this.curTypeStr + ',next SearchType is' + this.nextTypeStr + '}\n'; + @State btnEnable: boolean = true + + build() { + Column() { + Search({ + value: this.curTypeMsg, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0030_search') + .type(this.nextType) + .searchButton('SEARCH') + .width('100%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + this.seSelectRes = `Search{select:[${selectionStart},${selectionEnd}]}`; + }) + Button('switch Type') + .id('textSelectionOptimization0030_2_btn') + .enabled(this.btnEnable) + .onClick(() => { + switch (this.nextType) { + case SearchType.NORMAL: + this.nextType = SearchType.NUMBER; + this.curTypeStr = 'SearchType.Number'; + this.nextTypeStr = 'SearchType.PhoneNumber'; + this.curTypeMsg = 'sgughakjh5876980809806\ngdausihio8 9uyssh98f67yh\n798789y98y89y8'; + break; + case SearchType.NUMBER: + this.nextType = SearchType.PHONE_NUMBER; + this.curTypeStr = 'SearchType.PhoneNumber'; + this.nextTypeStr = 'SearchType.Email'; + this.curTypeMsg = '13912345678\n7698-4578978\n(79868-856458)'; + break; + case SearchType.PHONE_NUMBER: + this.nextType = SearchType.EMAIL; + this.curTypeStr = 'SearchType.Email'; + this.nextTypeStr = 'SearchType.Password'; + this.curTypeMsg = 'sahgfuahoi@gsuhf\n7@@d98-4578978\n(79868-vdidfa8)'; + break; + case SearchType.EMAIL: + this.nextType = SearchType.URL; + this.curTypeStr = 'SearchType.URL'; + this.nextTypeStr = 'nothing'; + this.curTypeMsg = 'https://docs.qq.com/sheet/safa?tab=tb0riy\dfa://safafvs./browse/sds-6565?filter=-1\n'; + this.btnEnable = false; + break; + case SearchType.URL: + this.btnEnable = false; + return; + } + this.testRes += '\n{current SearchType is:' + this.curTypeStr + + ',next SearchType is' + this.nextTypeStr + + '}\n'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_3.ets new file mode 100755 index 00000000..3fb39e28 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0030_3 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taTxt: string = 'TextInput:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State nextType: number = TextAreaType.NORMAL; + nextTypeStr: string = 'TextAreaType.Number' + curTypeStr: string = 'TextAreaType.Normal' + curTypeMsg: string = 'Textfssautyuiewfi769\n%……&*(&))*(&*\n#$%^&YVJHG*HNT16545132' + @State testRes: string = + '{current TextAreaType is:' + this.curTypeStr + ',next TextAreaType is' + this.nextTypeStr + '}\n'; + @State btnEnable: boolean = true + + build() { + Column() { + TextArea({ + text: this.curTypeMsg, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .type(this.nextType) + .width('100%') + .height('50') + .margin(40) + .fontSize(18) + .id('textSelectionOptimization0030_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + }) + Button('switch Type') + .id('textSelectionOptimization0030_3_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case TextAreaType.NORMAL: + this.nextType = TextAreaType.NUMBER; + this.curTypeStr = 'TextAreaType.Number'; + this.nextTypeStr = 'TextAreaType.PhoneNumber'; + this.curTypeMsg = 'sgughakjh5876980809806\\ngdausihio8 9uyssh98f67yh\\n798789y98y89y8'; + break; + case TextAreaType.NUMBER: + this.nextType = TextAreaType.PHONE_NUMBER; + this.curTypeStr = 'TextAreaType.PhoneNumber'; + this.nextTypeStr = 'TextAreaType.Email'; + this.curTypeMsg = '13912345678\\n7698-4578978\\n(79868-856458)'; + break; + case TextAreaType.PHONE_NUMBER: + this.nextType = TextAreaType.EMAIL; + this.curTypeStr = 'TextAreaType.Email'; + this.nextTypeStr = 'TextAreaType.URL'; + this.curTypeMsg = '13912345678\n7698-4578978\n(79868-85645dsfsfa8)'; + break; + case TextAreaType.EMAIL: + this.nextType = TextAreaType.URL; + this.curTypeStr = 'TextAreaType.URL'; + this.nextTypeStr = 'nothing'; + this.curTypeMsg = + 'https://docs.qq.com/sheet/safa?tab=tb0riy\\ndfa://safafvs./browse/sds-6565?filter=-1\na://safafvs./browsdgdwgdgjk.//fdsvv.vosm'; + this.btnEnable = false; + break; + case TextAreaType.URL: + this.btnEnable = false; + return; + } + this.testRes += '\n{current TextAreaType is:' + this.curTypeStr + + ',next TextAreaType is' + this.nextTypeStr + + '}\n'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_1.ets new file mode 100755 index 00000000..7a54d44f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_1.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. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0040_1 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput' + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .width('100%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0040_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.tiTxt.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_2.ets new file mode 100755 index 00000000..97d24a2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_2.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0040_2 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + + build() { + Column() { + Search({ + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0040_search') + .searchButton('SEARCH') + .width('100%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + if (selectionStart == selectionEnd) { + this.seSelectRes = `Search{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.changeValue.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + this.seSelectRes = `Search{select:[${selectionStart},${selectionEnd}]}`; + } + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_3.ets new file mode 100755 index 00000000..7ffb6973 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0040_3 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taTxt: string = 'TextArea:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .id('textSelectionOptimization0040_txArea') + .width('100%') + .margin(20) + .height(50) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextArea{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.taTxt.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + this.taSelectRes = `TextArea{select:[${selectionStart},${selectionEnd}]}`; + } + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_1.ets new file mode 100755 index 00000000..0a950d02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_1.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0050_1 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State nextType: number = TextInputStyle.Default; + nextTypeStr: string = 'TextInputStyle.Default' + curTypeStr: string = 'TextInputStyle.Default' + curTypeMsg: string = 'TextInput:' + this.curTypeStr + this.curTypeStr + this.curTypeStr + @State testRes: string = + '{current InputType is:' + this.curTypeStr + '}\n'; + @State btnEnable: boolean = true + + build() { + Column() { + TextInput({ + text: this.curTypeMsg, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .style(this.nextType) + .width('80%') + .height('50') + .margin(40) + .fontSize(18) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0050_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch Style') + .id('textSelectionOptimization0050_1_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case TextInputStyle.Default: + this.nextType = TextInputStyle.Inline; + this.curTypeStr = 'TextInputStyle.Inline'; + this.btnEnable = false; + break; + case TextInputStyle.Inline: + this.btnEnable = false; + break; + } + this.testRes += '{current TextInputStyle is:' + this.curTypeStr + '}\n'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_2.ets new file mode 100755 index 00000000..5a0b6b6d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_2.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0050_2 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taTxt: string = 'TextInput:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State nextType: number = TextContentStyle.DEFAULT; + nextTypeStr: string = 'TextContentStyle.Default' + curTypeStr: string = 'TextContentStyle.Default' + curTypeMsg: string = + 'TextArea:' + this.curTypeStr + this.curTypeStr + this.curTypeStr + this.curTypeStr + this.curTypeStr + @State testRes: string = + '{current TextContentStyle is:' + this.curTypeStr + '}\n'; + @State btnEnable: boolean = true + + build() { + Column() { + TextArea({ + text: this.curTypeMsg, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .style(TextContentStyle.DEFAULT) + .width('100%') + .height('50') + .margin(40) + .fontSize(18) + .id('textSelectionOptimization0050_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + }) + Button('switch Style') + .id('textSelectionOptimization0050_2_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case TextContentStyle.DEFAULT: + this.nextType = TextContentStyle.INLINE; + this.curTypeStr = 'TextContentStyle.Inline'; + this.btnEnable = false; + break; + case TextContentStyle.INLINE: + this.btnEnable = false; + break; + } + this.testRes += '{current TextInputStyle is:' + this.curTypeStr + '}\n'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_1.ets new file mode 100755 index 00000000..49a34db2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_1.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0060_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State nextType: number = TextAlign.Center; + nextTypeStr: string = 'TextAlign.Center' + curTypeStr: string = 'TextAlign.Center' + curTypeMsg: string = this.curTypeStr + '\n' + this.curTypeStr + @State testRes: string = '' + @State btnEnable: boolean = true + + build() { + Column() { + TextInput({ + text: this.curTypeStr + '\n' + this.curTypeStr, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .textAlign(this.nextType) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0060_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current TextAlign is:' + this.curTypeStr + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch TextAlign') + .id('textSelectionOptimization0060_1_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case TextAlign.Center: + this.nextType = TextAlign.Start; + this.curTypeStr = 'TextAlign.Start'; + this.nextTypeStr = 'TextAlign.End'; + break; + case TextAlign.Start: + this.nextType = TextAlign.End; + this.curTypeStr = 'TextAlign.End'; + this.nextTypeStr = 'TextAlign.JUSTIFY'; + break; + case TextAlign.End: + this.nextType = TextAlign.JUSTIFY; + this.curTypeStr = 'TextAlign.JUSTIFY'; + this.nextTypeStr = 'nothing'; + this.btnEnable = false; + break; + case TextAlign.JUSTIFY: + this.btnEnable = false; + break; + } + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_2.ets new file mode 100755 index 00000000..929bfa7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_2.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0060_2 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State nextType: number = TextAlign.Center; + nextTypeStr: string = 'TextAlign.Center' + curTypeStr: string = 'TextAlign.Center' + curTypeMsg: string = this.curTypeStr + '\n' + this.curTypeStr + @State testRes: string = ''; + @State btnEnable: boolean = true + + build() { + Column() { + Search({ + value: this.curTypeStr + '\n' + this.curTypeStr, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0060_search') + .textAlign(this.nextType) + .searchButton('SEARCH') + .width('80%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current TextAlign is:' + this.curTypeStr + '}\n'; + switch (this.nextType) { + case TextAlign.Center: + this.nextType = TextAlign.Start; + this.curTypeStr = 'TextAlign.Start'; + this.nextTypeStr = 'TextAlign.End'; + break; + case TextAlign.Start: + this.nextType = TextAlign.End; + this.curTypeStr = 'TextAlign.End'; + this.nextTypeStr = 'TextAlign.JUSTIFY'; + break; + case TextAlign.End: + this.nextType = TextAlign.JUSTIFY; + this.curTypeStr = 'TextAlign.JUSTIFY'; + this.nextTypeStr = 'nothing'; + this.btnEnable = false; + break; + case TextAlign.JUSTIFY: + this.btnEnable = false; + break; + } + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + this.seSelectRes = `Search{select:[${selectionStart},${selectionEnd}]}`; + }) + Button('switch TextAlign') + .id('textSelectionOptimization0060_2_btn') + .enabled(this.btnEnable).onClick(() => { + console.log(`onClick>>> ` + this.nextType); + switch (this.nextType) { + case TextAlign.Center: + this.nextType = TextAlign.Start; + this.curTypeStr = 'TextAlign.Start'; + this.nextTypeStr = 'TextAlign.End'; + break; + case TextAlign.Start: + this.nextType = TextAlign.End; + this.curTypeStr = 'TextAlign.End'; + this.nextTypeStr = 'TextAlign.JUSTIFY'; + break; + case TextAlign.End: + this.nextType = TextAlign.JUSTIFY; + this.curTypeStr = 'TextAlign.JUSTIFY'; + this.nextTypeStr = 'nothing'; + this.btnEnable = false; + break; + case TextAlign.JUSTIFY: + this.btnEnable = false; + break; + } + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_3.ets new file mode 100755 index 00000000..8fcba9af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0060_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State nextType: number = TextAlign.Center; + nextTypeStr: string = 'TextAlign.Center' + curTypeStr: string = 'TextAlign.Center' + curTypeMsg: string = this.curTypeStr + '\n' + this.curTypeStr + @State testRes: string = '{current TextAlign is:' + this.curTypeStr + '}\n' + @State btnEnable: boolean = true + + build() { + Column() { + TextArea({ + text: this.curTypeStr + '\n' + this.curTypeStr, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .textAlign(this.nextType) + .width('50%') + .height('50') + .margin(40) + .fontSize(20) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0060_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch TextAlign') + .id('textSelectionOptimization0060_3_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case TextAlign.Center: + this.nextType = TextAlign.Start; + this.curTypeStr = 'TextAlign.Start'; + this.nextTypeStr = 'TextAlign.End'; + break; + case TextAlign.Start: + this.nextType = TextAlign.End; + this.curTypeStr = 'TextAlign.End'; + this.nextTypeStr = 'TextAlign.JUSTIFY'; + break; + case TextAlign.End: + this.nextType = TextAlign.JUSTIFY; + this.curTypeStr = 'TextAlign.JUSTIFY'; + this.nextTypeStr = 'nothing'; + this.btnEnable = false; + break; + case TextAlign.JUSTIFY: + this.btnEnable = false; + break; + } + this.testRes += '{current TextAlign is:' + this.curTypeStr + '}\n'; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_1.ets new file mode 100755 index 00000000..bce4e5d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_1.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0070_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State testRes: string ='' + @State btnEnable: boolean = true + @State selectionMenuHidden:boolean = false + curTypeMsg: string = 'TextInput:\n'+'current selectionMenuHidden is:'+this.selectionMenuHidden; + + build() { + Column() { + TextInput({ + text: 'TextInput:\n'+'current selectionMenuHidden is:'+this.selectionMenuHidden, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .selectionMenuHidden(this.selectionMenuHidden) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0070_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current selectionMenuHidden is:' + this.selectionMenuHidden + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch selectionMenuHidden') + .id('textSelectionOptimization0070_1_btn') + .enabled(this.btnEnable).onClick(() => { + this.selectionMenuHidden = true; + this.btnEnable =false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_2.ets new file mode 100755 index 00000000..19264e54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_2.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0070_2 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State testRes: string ='' + @State btnEnable: boolean = true + @State selectionMenuHidden:boolean = false + curTypeMsg: string = 'TextInput:\n'+'current selectionMenuHidden is:'+this.selectionMenuHidden; + + build() { + Column() { + Search({ + value: 'Search:\n'+'current selectionMenuHidden is:'+this.selectionMenuHidden, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0070_search') + .selectionMenuHidden(this.selectionMenuHidden) + .searchButton('SEARCH') + .width('80%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current selectionMenuHidden is:' + this.selectionMenuHidden + '}\n'; + //this.testRes += '{current selectionMenuHidden is:' + this.selectionMenuHidden + ',onContentScroll[' + this.seScrollRes + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.seSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch selectionMenuHidden') + .id('textSelectionOptimization0070_2_btn') + .enabled(this.btnEnable).onClick(() => { + this.selectionMenuHidden = true; + this.btnEnable =false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_3.ets new file mode 100755 index 00000000..860bcc80 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0070_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State testRes: string = '' + @State btnEnable: boolean = true + @State selectionMenuHidden: boolean = false + @State curTypeMsg: string = 'TextArea:\n' + 'current selectionMenuHidden is:' + this.selectionMenuHidden; + + build() { + Column() { + TextArea({ + text: 'TextArea:\n' + 'current selectionMenuHidden is:' + this.selectionMenuHidden+ this.selectionMenuHidden+ this.selectionMenuHidden, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .selectionMenuHidden(this.selectionMenuHidden) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0070_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea {scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current selectionMenuHidden is:' + this.selectionMenuHidden + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch selectionMenuHidden') + .id('textSelectionOptimization0070_3_btn') + .enabled(this.btnEnable).onClick(() => { + this.selectionMenuHidden = true; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_1.ets new file mode 100755 index 00000000..1d798636 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_1.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0080_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State testRes: string ='' + @State btnEnable: boolean = true + @State lineHeight:number = 20 + curTypeMsg: string = 'TextInput:\n'+'current lineHeight is:'+this.lineHeight; + + build() { + Column() { + TextInput({ + text: 'TextInput:\n'+'current lineHeight is:'+this.lineHeight+this.lineHeight+this.lineHeight, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .lineHeight(30) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0080_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current lineHeight is:' + this.lineHeight + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch lineHeight') + .id('textSelectionOptimization0080_1_btn') + .enabled(this.btnEnable).onClick(() => { + this.lineHeight += 20; + this.btnEnable =false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_2.ets new file mode 100755 index 00000000..ca9d257d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_2.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0080_2{ + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State testRes: string ='' + @State btnEnable: boolean = true + @State lineHeight:number = 20 + curTypeMsg: string = 'Search:\n'+'current lineHeight is:'+this.lineHeight; + + build() { + Column() { + Search({ + value: 'Search:\n'+'current lineHeight is:'+this.lineHeight, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0080_search') + .lineHeight(this.lineHeight) + .searchButton('SEARCH') + .width('80%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current lineHeight is:' + this.lineHeight + '}\n'; + // this.testRes += '{current lineHeight is:' + this.lineHeight + ',onContentScroll[' + this.seScrollRes + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.seSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch lineHeight') + .id('textSelectionOptimization0080_2_btn') + .enabled(this.btnEnable).onClick(() => { + this.lineHeight +=20; + this.btnEnable =false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_3.ets new file mode 100755 index 00000000..4e1f2d4c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0080_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State testRes: string = '' + @State btnEnable: boolean = true + @State lineHeight: number = 20 + curTypeMsg: string = 'Search:\n' + 'current lineHeight is:' + this.lineHeight; + + build() { + Column() { + TextArea({ + text: 'TextArea:\n' + 'current lineHeight is:' + this.lineHeight + this.msg, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .lineHeight(this.lineHeight) + .width('80%') + .height('80') + .margin(40) + .fontSize(18) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0080_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea {scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current lineHeight is:' + this.lineHeight + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch lineHeight') + .id('textSelectionOptimization0080_3_btn') + .enabled(this.btnEnable).onClick(() => { + this.lineHeight += 20; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_1.ets new file mode 100755 index 00000000..60f45be9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_1.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0090_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State testRes: string ='' + @State btnEnable: boolean = true + @State letterSpacing:number = 3 + curTypeMsg: string = 'TextInput:\n'+'current letterSpacing is:'+this.letterSpacing; + + build() { + Column() { + TextInput({ + text: 'TextInput:\n'+'current letterSpacing is:'+this.letterSpacing+this.letterSpacing+this.letterSpacing, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .letterSpacing(3) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0090_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current letterSpacing is:' + this.letterSpacing + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch letterSpacing') + .id('textSelectionOptimization0090_1_btn') + .enabled(this.btnEnable).onClick(() => { + this.letterSpacing += 5; + this.btnEnable =false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_2.ets new file mode 100755 index 00000000..53f3d425 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_2.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0090_2{ + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State testRes: string ='' + @State btnEnable: boolean = true + @State letterSpacing:number = 5 + curTypeMsg: string = 'Search:\n'+'current letterSpacing is:'+this.letterSpacing; + + build() { + Column() { + Search({ + value: 'Search:\n'+'current letterSpacing is:'+this.letterSpacing, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0090_search') + .letterSpacing(this.letterSpacing) + .searchButton('SEARCH') + .width('80%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current letterSpacing is:' + this.letterSpacing + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.seSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch letterSpacing') + .id('textSelectionOptimization0090_2_btn') + .enabled(this.btnEnable).onClick(() => { + this.letterSpacing +=5; + this.btnEnable =false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_3.ets new file mode 100755 index 00000000..7e28a0d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0090_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State testRes: string = '' + @State btnEnable: boolean = true + @State letterSpacing:number = 5 + curTypeMsg: string = 'Search:\n'+'current letterSpacing is:'+this.letterSpacing; + + build() { + Column() { + TextArea({ + text: 'TextArea:\n' + 'current letterSpacing is:' + this.letterSpacing+ this.letterSpacing+ this.letterSpacing, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .letterSpacing(this.letterSpacing) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0090_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea {scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current letterSpacing is:' + this.letterSpacing + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch letterSpacing') + .id('textSelectionOptimization0090_3_btn') + .enabled(this.btnEnable).onClick(() => { + this.letterSpacing += 5; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_1.ets new file mode 100755 index 00000000..0763dc87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_1.ets @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0100_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State nextType: number = TextOverflow.None; + nextTypeStr: string = 'TextOverflow.None' + curTypeStr: string = 'TextOverflow.None' + @State testRes: string ='' + @State btnEnable: boolean = true + curTypeMsg: string = 'TextInput:\n'+'current TextOverflow is:'+this.curTypeStr; + + build() { + Column() { + TextInput({ + text: 'TextInput:\n'+'current TextOverflow is:'+this.curTypeStr+this.curTypeStr+this.curTypeStr, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .textOverflow(this.nextType) + .width('50%') + .height('50') + .maxLines(1) + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0100_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current TextOverflow is:' + this.curTypeStr + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch TextOverflow') + .id('textSelectionOptimization0100_1_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case TextOverflow.None: + this.nextType = TextOverflow.Clip; + this.curTypeStr = 'TextOverflow.Clip'; + this.nextTypeStr = 'TextOverflow.Ellipsis'; + break; + case TextOverflow.Clip: + this.nextType = TextOverflow.Ellipsis; + this.curTypeStr = 'TextOverflow.Ellipsis'; + this.nextTypeStr = 'TTextOverflow.MARQUEE'; + break; + case TextOverflow.Ellipsis: + this.nextType = TextOverflow.MARQUEE; + this.curTypeStr = 'TextOverflow.MARQUEE'; + this.nextTypeStr = 'nothing'; + this.btnEnable = false; + break; + case TextOverflow.MARQUEE: + this.btnEnable = false; + break; + } + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_3.ets new file mode 100755 index 00000000..83dd47e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0100_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State nextType: number = TextOverflow.None; + nextTypeStr: string = 'TextOverflow.None' + curTypeStr: string = 'TextOverflow.None' + @State testRes: string = '' + @State btnEnable: boolean = true + curTypeMsg: string = 'TextArea:\n' + 'current TextOverflow is:' + this.curTypeStr; + + build() { + Column() { + TextArea({ + text: 'TextArea:' + 'current TextOverflow is:' + this.curTypeStr + this.curTypeStr + this.curTypeStr, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .textOverflow(this.nextType) + .width('50%') + .height('50') + .margin(40) + .fontSize(18) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0100_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea {scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current TextOverflow is:' + this.curTypeStr + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch TextOverflow') + .id('textSelectionOptimization0100_3_btn') + .enabled(this.btnEnable).onClick(() => { + switch (this.nextType) { + case TextOverflow.None: + this.nextType = TextOverflow.Clip; + this.curTypeStr = 'TextOverflow.Clip'; + this.nextTypeStr = 'TextOverflow.Ellipsis'; + break; + case TextOverflow.Clip: + this.nextType = TextOverflow.Ellipsis; + this.curTypeStr = 'TextOverflow.Ellipsis'; + this.nextTypeStr = 'TTextOverflow.MARQUEE'; + break; + case TextOverflow.Ellipsis: + this.nextType = TextOverflow.MARQUEE; + this.curTypeStr = 'TextOverflow.MARQUEE'; + this.nextTypeStr = 'nothing'; + this.btnEnable = false; + break; + case TextOverflow.MARQUEE: + this.btnEnable = false; + break; + } + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_1.ets new file mode 100755 index 00000000..4675cfc1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_1.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0110_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State testRes: string = '' + @State btnEnable: boolean = true + @State textIndent: number = 30 + curTypeMsg: string = 'TextInput:\n' + 'current textIndent is:' + this.textIndent; + + build() { + Column() { + TextInput({ + text: 'TextInput:\n' + 'current textIndent is:' + this.textIndent + this.textIndent + this.textIndent, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .textIndent(3) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0110_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current textIndent is:' + this.textIndent + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch textIndent') + .id('textSelectionOptimization0110_1_btn') + .enabled(this.btnEnable).onClick(() => { + this.textIndent += 50; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_2.ets new file mode 100755 index 00000000..14279fd6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_2.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0110_2 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State testRes: string = '' + @State btnEnable: boolean = true + @State textIndent: number = 30 + curTypeMsg: string = 'Search:\n' + 'current textIndent is:' + this.textIndent; + + build() { + Column() { + Search({ + value: 'Search:\n' + 'current textIndent is:' + this.textIndent, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0110_search') + .textIndent(this.textIndent) + .searchButton('SEARCH') + .width('80%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current textIndent is:' + this.textIndent + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.seSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch textIndent') + .id('textSelectionOptimization0110_2_btn') + .enabled(this.btnEnable).onClick(() => { + this.textIndent += 50; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_3.ets new file mode 100755 index 00000000..210a3bb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0110_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State testRes: string = '' + @State btnEnable: boolean = true + @State textIndent: number = 30 + curTypeMsg: string = 'Search:\n' + 'current textIndent is:' + this.textIndent; + + build() { + Column() { + TextArea({ + text: 'TextArea:\n' + 'current textIndent is:' + this.textIndent + this.textIndent + this.textIndent, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .textIndent(this.textIndent) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0110_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea {scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current textIndent is:' + this.textIndent + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch textIndent') + .id('textSelectionOptimization0110_3_btn') + .enabled(this.btnEnable).onClick(() => { + this.textIndent += 50; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_1.ets new file mode 100755 index 00000000..e1456b75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_1.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0120_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State testRes: string = '' + @State btnEnable: boolean = true + @State enable: boolean = false + curTypeMsg: string = 'TextInput:\n' + 'current enabled is:' + this.enable; + + build() { + Column() { + TextInput({ + text: 'TextInput:\n' + 'current enabled is:' + this.enable + this.enable + this.enable, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .enabled(this.enable) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0120_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current enabled is:' + this.enable + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiTxt = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Button('switch enabled') + .id('textSelectionOptimization0120_1_btn') + .enabled(this.btnEnable).onClick(() => { + this.enable = true; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_2.ets new file mode 100755 index 00000000..20ffe5ca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_2.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0120_2 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State testRes: string = '' + @State btnEnable: boolean = true + @State enable: boolean = false + curTypeMsg: string = 'Search:\n' + 'current enabled is:' + this.enable; + + build() { + Column() { + Search({ + value: 'Search:\n' + 'current enabled is:' + this.enable, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0120_search') + .enabled(this.enable) + .searchButton('SEARCH') + .width('80%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current enabled is:' + this.enable + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.seSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch enabled') + .id('textSelectionOptimization0120_2_btn') + .enabled(this.btnEnable).onClick(() => { + this.enable = true; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_3.ets new file mode 100755 index 00000000..07de646b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_3.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextSelectionOptimization0120_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State testRes: string = '' + @State btnEnable: boolean = true + @State enable: boolean = false + curTypeMsg: string = 'Search:\n' + 'current enabled is:' + this.enable; + + build() { + Column() { + TextArea({ + text: 'TextArea:' + 'current enabled is:' + this.enable + this.enable + this.enable, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .enabled(this.enable) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0120_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea {scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current enabled is:' + this.enable + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.curTypeMsg.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + } + }) + Button('switch enabled') + .id('textSelectionOptimization0120_3_btn') + .enabled(this.btnEnable).onClick(() => { + this.enable = true; + this.btnEnable = false; + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_1.ets new file mode 100755 index 00000000..0e34621b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_1.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. + */ + +@Entry +@Component +struct UIComponentTextSelectionOptimization0130_1 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State nextType: number = MenuPolicy.DEFAULT; + nextTypeStr: string = 'MenuPolicy.DEFAULT' + @State curTypeStr: string = 'MenuPolicy.DEFAULT' + @State curTypeMsg: string = this.curTypeStr + '\n' + this.curTypeStr + @State testRes: string = '' + @State btnEnable: boolean = true + @State options: SelectionOptions = { + menuPolicy: this.nextType + } + + build() { + Column() { + TextInput({ + text: 'TextInput:' + this.curTypeStr + '\n' + this.msg, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .width('80%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0130_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current MenuPolicy is:' + this.curTypeStr + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.curTypeMsg.length; + this.textInputController.setTextSelection(0, length,this.options); + + }) + Button('switch MenuPolicy') + .id('textSelectionOptimization0130_1_btn') + .enabled(this.btnEnable).onClick(() => { + console.log(`onClick>>>`); + switch (this.nextType) { + case MenuPolicy.DEFAULT: + this.nextType = MenuPolicy.HIDE; + this.curTypeStr = 'MenuPolicy.HIDE'; + this.nextTypeStr = 'MenuPolicy.SHOW'; + break; + case MenuPolicy.HIDE: + this.nextType = MenuPolicy.SHOW; + this.curTypeStr = 'MenuPolicy.SHOW'; + this.nextTypeStr = 'nothing'; + break; + case MenuPolicy.SHOW: + this.btnEnable = false; + break; + } + // let options: SelectionOptions = { + // menuPolicy: this.nextType + // } + // this.textInputController.setTextSelection(0, this.curTypeMsg.length, options) + + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_2.ets new file mode 100755 index 00000000..10fe574a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_2.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 UIComponentTextSelectionOptimization0130_2 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + @State nextType: number = MenuPolicy.DEFAULT; + nextTypeStr: string = 'MenuPolicy.DEFAULT' + @State curTypeStr: string = 'MenuPolicy.DEFAULT' + @State curTypeMsg: string = this.curTypeStr + '\n' + this.curTypeStr + @State testRes: string = '' + @State btnEnable: boolean = true + @State options: SelectionOptions = { + menuPolicy: this.nextType + } + + build() { + Column() { + Search({ + value: 'Search:\n' + this.curTypeStr + '\n' + this.msg, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0130_search') + .searchButton('SEARCH') + .width('80%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current enabled is:' + this.curTypeStr + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.curTypeMsg.length; + this.searchController.setTextSelection(0, length,this.options); + }) + Button('switch enabled') + .id('textSelectionOptimization0130_2_btn') + .enabled(this.btnEnable).onClick(() => { + console.log(`onClick>>>`); + switch (this.nextType) { + case MenuPolicy.DEFAULT: + this.nextType = MenuPolicy.HIDE; + this.curTypeStr = 'MenuPolicy.HIDE'; + this.nextTypeStr = 'MenuPolicy.SHOW'; + break; + case MenuPolicy.HIDE: + this.nextType = MenuPolicy.SHOW; + this.curTypeStr = 'MenuPolicy.SHOW'; + this.nextTypeStr = 'nothing'; + break; + case MenuPolicy.SHOW: + this.btnEnable = false; + break; + } + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(15) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_3.ets new file mode 100755 index 00000000..a4d98f62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_3.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 UIComponentTextSelectionOptimization0130_3 { + @State msg: string = + "OpenHarmony由开放原子开源基金会(OpenAtom Foundation)" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State nextType: number = MenuPolicy.DEFAULT; + nextTypeStr: string = 'MenuPolicy.DEFAULT' + @State curTypeStr: string = 'MenuPolicy.DEFAULT' + @State curTypeMsg: string = this.curTypeStr + '\n' + this.curTypeStr + @State testRes: string = '' + @State btnEnable: boolean = true + @State options: SelectionOptions = { + menuPolicy: this.nextType + } + + build() { + Column() { + TextArea({ + text:'TextArea:' + this.curTypeStr + '\n' + this.msg, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .width('50%') + .height('50') + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0130_txArea') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea {scrolling:[${totalOffsetX},${totalOffsetY}]}`; + this.testRes += '{current MenuPolicy is:' + this.curTypeStr + '}\n'; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.curTypeMsg.length; + this.textAreaController.setTextSelection(0, length,this.options); + }) + Button('switch enabled') + .id('textSelectionOptimization0130_3_btn') + .enabled(this.btnEnable).onClick(() => { + console.log(`onClick>>>`); + switch (this.nextType) { + case MenuPolicy.DEFAULT: + this.nextType = MenuPolicy.HIDE; + this.curTypeStr = 'MenuPolicy.HIDE'; + this.nextTypeStr = 'MenuPolicy.SHOW'; + break; + case MenuPolicy.HIDE: + this.nextType = MenuPolicy.SHOW; + this.curTypeStr = 'MenuPolicy.SHOW'; + this.nextTypeStr = 'nothing'; + break; + case MenuPolicy.SHOW: + this.btnEnable = false; + break; + } + }) + + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0140.ets new file mode 100755 index 00000000..9b35aaab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0140.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. + */ + +@Entry +@Component +struct UIComponentTextSelectionOptimization0140 { + @State msg: string = 'UIComponentTextSelectionOptimization0140' + private scrollerForScroll: Scroller = new Scroller() + @State isScrollNext: boolean = true + @State taTxt: string = 'TextArea:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + textAreaController: TextAreaController = new TextAreaController() + @State tiTxt: string = 'TextInput:' + this.msg + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + textInputController: TextInputController = new TextInputController() + @State changeValue: string = 'search:' + this.msg + @State seSelectRes: string = '' + @State seScrollRes: string = '' + searchController: SearchController = new SearchController(); + + build() { + Column() { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + TextArea({ + text: this.taTxt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .id('textSelectionOptimization0140_txArea') + .width('100%') + .margin(20) + .height(200) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.taTxt.length; + this.textAreaController.setTextSelection(selectionStart, length); + }) + TextInput({ + text: this.tiTxt, + placeholder: 'The text input can hold an unlimited amount of text. input your word...', + controller: this.textInputController + }) + .width('80%') + .height(200) + .margin(40) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textSelectionOptimization0140_txInput') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + let length = this.tiTxt.length; + this.textInputController.setTextSelection(0, length); + }) + Search({ + value: this.changeValue, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textSelectionOptimization0140_search') + .searchButton('SEARCH') + .width('100%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + let length = this.changeValue.length; + this.searchController.setTextSelection(selectionStart, length); + }) + } + }.height(400) + .onScrollEdge((side: Edge) => { + if(side == Edge.Top){ + this.isScrollNext = true + } + }) + + Button('Scroll Text') + .onClick(() => { + if (this.scrollerForScroll.isAtEnd()) { + this.isScrollNext = false + } + this.scrollerForScroll.scrollPage({ next: this.isScrollNext }) + }) + .height(60) + .width(200) + .fontSize(20) + .margin(20) + .key('textSelectionOptimization0140_btn') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0130.ets new file mode 100755 index 00000000..b81f5b37 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0130.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextAbility0130 { + @State text: string = 'Text:Test for onCopy()...Test for onCopy()'; + @State res: string = 'After Copy:'; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + Column() { + Text(this.text) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textAbility0130') + .selection(this.start, this.end) + .onTextSelectionChange(() => { + console.log(`onTextSelectionChange >>>`); + this.start = 5; + this.end = 20; + }) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + this.res = 'after onCopy: ' + value; + }) + Column() { + Text(this.res) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .id('res_text') + } + .width('100%') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0150.ets new file mode 100755 index 00000000..f32a1b15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0150.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 UIComponentTextTextAbility0150 { + @State text: string = 'Text:Test for selection' + @State res: string = 'After Select: ' + @State start: number = 5 + @State end: number = 20 + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('text_textAbility0150') + .selection(this.start, this.end) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + this.res = 'After Select:' + value; + }) + .onTextSelectionChange((start, end) => { + console.log(`onTextSelectionChange:${start}` + ', ' + end); + }) + Column() { + Text(this.res) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .id('res_text') + } + .width('100%') + + Button('Set text selection').margin(20).id('btn_textAbility0150').onClick(() => { + this.text = 'test change text,this is test text.'; + }) + Button('change text selection').margin(20).id('btn02_textAbility015').onClick(() => { + this.text = 'test change text,this is test text.'; + this.end = this.end + 5; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0570.ets new file mode 100755 index 00000000..8da36bf3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0570.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 UIComponentTextTextAbility0570 { + @State text: string = 'Text:add ImageSpan' + @State res: string = 'After Copy: ' + @State start: number = 0 + @State end: number = 0 + + build() { + Column() { + Column() { + Text() { + Span(this.text) + ImageSpan('icon.png').width('50px').height('50px') + } + .onAppear(() => { + console.log(`onAppear>>`); + }) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('text_textAbility0570') + .selection(this.start, this.end) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + this.res = 'After Select:' + value; + }) + .onTextSelectionChange((start, end) => { + console.log(`onTextSelectionChange:${start}` + ', ' + end); + this.start = 0; + this.end = 20; + }) + + Column() { + Text(this.res) + .fontSize(20) + .fontWeight(FontWeight.Bold) + .id('res_text') + } + .width('100%') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0020.ets new file mode 100755 index 00000000..f7827af3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0020.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. + */ + +@Entry +@Component +struct UIComponentTextTextAction0020 { + @State text: string = 'Text:Test for Drag'; + @State start: number = 5; + @State end: number = 8; + + build() { + Column() { + Column() { + Text(this.text) + .margin(20) + .fontSize(16) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('textTextAction0020_1') + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTextAction0020_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0040.ets new file mode 100755 index 00000000..11df3342 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0040.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextAction0040 { + @State text: string = 'Text:Test for focusable' + @State textColor: number = Color.Black + + build() { + Column() { + Column() { + Text(this.text) + .width('80%') + .height('50') + .margin(20) + .fontColor(this.textColor) + .focusable(true) + .onClick(() => { + this.textColor = Color.Blue + }) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTextAction0040') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0050.ets new file mode 100755 index 00000000..086cea42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0050.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. + */ +import { common2D, drawing } from '@kit.ArkGraphics2D' +import { text } from "@kit.ArkGraphics2D" +import { image } from '@kit.ImageKit'; +import { GlobalThis } from '../../../test/model/globalThis'; + +function textFunc() { + //字体颜色,字重,字体大小等属性由此设置 + let myTextStyle: text.TextStyle = { + color: { + alpha: 255, + red: 255, + green: 0, + blue: 0 + }, + }; + let myParagraphStyle: text.ParagraphStyle = { + textStyle: myTextStyle, + align: text.TextAlign.END, + }; + let fontCollection = new text.FontCollection(); + let ParagraphGraphBuilder = new text.ParagraphBuilder(myParagraphStyle, fontCollection); + //更新文本样式 + ParagraphGraphBuilder.pushStyle(myTextStyle); + ParagraphGraphBuilder.addText('Test for Paragraph Paint') + let paragraph = ParagraphGraphBuilder.build(); + // 布局 + paragraph.layoutSync(600); + + const color: ArrayBuffer = new ArrayBuffer(160000); + let opts: image.InitializationOptions = { editable: true, pixelFormat: 3, size: { height: 200, width: 200 } } + let pixelMap: image.PixelMap = image.createPixelMapSync(color, opts); + let canvas = new drawing.Canvas(pixelMap); + + paragraph.paint(canvas, 100, 100); +} + +@Entry +@Component +struct UIComponentTextTextAction0050 { + @State text: string = 'Text:Test for Paragraph Paint' + @State res: string = 'After Copy:' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + /*Text().width('100%') + .height('200') + .fontSize(16).copyOption(CopyOptions.InApp) + .id('textTextAction0050_text').selection(5,20) + .onCopy((value:string)=>{ + console.log(`onCopy:${value}`); + this.res ='after onCopy: '+value; + })*/ + Column() { + Button('click').id('textTextAction0050_btn').onClick(() => { + textFunc() + }) + } + .width('100%') + }.width('100%').height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0060.ets new file mode 100755 index 00000000..f6d578fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0060.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 inspector from '@ohos.arkui.inspector' + +@Entry +@Component +struct UIComponentTextTextAction0060 { + @State text: string = 'Text:Test for inspector' + @State res: string = 'After Copy:' + @State start: number = 0 + @State end: number = 0 + @State vis: number = Visibility.Hidden + controller: TextInputController = new TextInputController() + listener: inspector.ComponentObserver = inspector.createComponentObserver('textTextAction0060_text') + + aboutToAppear() { + let onLayoutComplete: () => void = (): void => { + console.log(`onLayoutComplete>>>`); + // do something here + this.vis = Visibility.Visible + } + let onDrawComplete: () => void = (): void => { + console.log(`onDrawComplete>>>`); + this.start = 5 + this.end = 20 + // do something here + } + let offLayoutComplete: () => void = (): void => { + // do something here + } + let offDrawComplete: () => void = (): void => { + // do something here + } + let FuncLayout = onLayoutComplete // bind current js instance + let FuncDraw = onDrawComplete // bind current js instance + let OffFuncLayout = offLayoutComplete // bind current js instance + let OffFuncDraw = offDrawComplete // bind current js instance + + this.listener.on('layout', FuncLayout) + this.listener.on('draw', FuncDraw) + } + + build() { + Column() { + Column() { + Text(this.text) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .key('textTextAction0060_text') + .selection(this.start, this.end) + .visibility(this.vis) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0080.ets new file mode 100755 index 00000000..48521b16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0080.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import common from '@ohos.app.ability.common' + +const context = getContext(this) +const uiAbilityContext = context as common.UIAbilityContext + +@Entry +@Component +struct UIComponentTextTextAction0080 { + build() { + Column() { + Button("跳转到设置") + .id('textTextAction0080_btn') + .onClick(() => { + let context = getContext(this) as common.UIAbilityContext; + uiAbilityContext.startAbility({ + bundleName: 'com.ohos.settings', + abilityName: 'com.ohos.settings.MainAbility', + //uri: 'application_settings', //application_settings application_info_entry + /*parameters: { + pushParams: uiAbilityContext.abilityInfo.bundleName + // 应用包名com.ohos.settings + }*/ + }); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0100.ets new file mode 100755 index 00000000..900e8354 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0100.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 UIComponentTextTextAction0100 { + @State text: string = 'Text:Test for MARQUEE' + @State overflow: number = TextOverflow.None + @State color: number = Color.Yellow + + build() { + Column() { + Text(this.text) + .width('80%') + .height('100') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTextAction0100_text') + .textOverflow({ overflow: this.overflow }) + .width(200) + .borderWidth(1) + .borderColor(Color.Orange) + .backgroundColor(this.color) + .onClick(() => { + console.log(`onClick>>`); + }) + + Button('start MARQUEE').id('textTextAction0100_btn').onClick(() => { + console.log(`onClick>>`); + this.text += this.text; + this.overflow = TextOverflow.MARQUEE; + this.color = Color.Green; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0110.ets new file mode 100755 index 00000000..f375e60b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0110.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextAction0110 { + @State text: string = 'Text:textShadow' + @State overflow: number = TextOverflow.None + @State color: number = Color.Yellow + + build() { + Column() { + Text(this.text) { + Span(this.text).fontColor(Color.Gray) + } + .width('100%') + .height('100') + .margin(20) + .textShadow({ + radius: 5, + color: Color.Black, + offsetX: 0, + offsetY: 0 + }) + .fontSize(26) + .copyOption(CopyOptions.InApp) + .id('textTextAction0110_text') + .textOverflow({ overflow: this.overflow }) + .borderWidth(1) + .borderColor(Color.Orange) + .onClick(() => { + console.log(`onClick>>`); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0180.ets new file mode 100755 index 00000000..e911e5bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0180.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 UIComponentTextTextAction0180 { + @State text: string = '' + + build() { + Column() { + Text(this.text) + .width('100%') + .height('100') + .margin(20) + .fontSize(26) + .copyOption(CopyOptions.InApp) + .id('textTextAction0180_text') + + // 默认参数下,图标、文字、背景都存在 + + SaveButton({ icon: SaveIconStyle.PICTURE, text: SaveDescription.SAVE_IMAGE }) + .key('textTextAction0180_btn1') + .onClick((async (event: ClickEvent, result: SaveButtonOnClickResult) => { + if (result == SaveButtonOnClickResult.SUCCESS) { + console.log(`SAVE_IMAGE onClick>>`); + this.text = '保存图片成功'; + } + })) + + SaveButton({ icon: SaveIconStyle.LINES, text: SaveDescription.SAVE_FILE }) + .key('textTextAction0180_btn2') + .onClick((async (event: ClickEvent, result: SaveButtonOnClickResult) => { + if (result == SaveButtonOnClickResult.SUCCESS) { + console.log(`SAVE_FILE onClick>>`); + this.text = '保存文件成功'; + } + })) + + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD }) + .key('textTextAction0180_btn3') + .onClick((async (event: ClickEvent, result: SaveButtonOnClickResult) => { + if (result == SaveButtonOnClickResult.SUCCESS) { + console.log(`DOWNLOAD onClick>>`); + this.text = '保存视频成功'; + } + })) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0010.ets new file mode 100755 index 00000000..7d713fec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0010.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextCustomMenu0010 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('It is Text') { + Span('TextSpan:TextResponseType.LONG_PRESS') + } + .id('textCustomMenu0010_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0020.ets new file mode 100755 index 00000000..42d07d06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0020.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextCustomMenu0020 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('It is Text') { + Span('TextSpan:TextResponseType.RIGHT_CLICK') + } + .id('textCustomMenu0020_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), TextResponseType.RIGHT_CLICK) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0030.ets new file mode 100755 index 00000000..529eb4de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0030.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. + */ +@Entry +@Component +struct UIComponentTextTextCustomMenu0030 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('It is Text') { + Span('TextSpan:TextResponseType.SELECT') + } + .id('textCustomMenu0030_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), TextResponseType.SELECT) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0040.ets new file mode 100755 index 00000000..2ac98239 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0040.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 UIComponentTextTextCustomMenu0040 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('TextSpanType.IMAGE') { + ImageSpan('cat.jpg') + .width('100px') + .height('100px') + } + .id('textCustomMenu0040_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.IMAGE, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0050.ets new file mode 100755 index 00000000..7dda554b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0050.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextCustomMenu0050 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span('TextSpanType.MIXED') + ImageSpan('cat.jpg') + .width('100px') + .height('100px') + } + .id('textCustomMenu0050_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.MIXED, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0060.ets new file mode 100755 index 00000000..7bf6f849 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0060.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 UIComponentTextTextCustomMenu0060 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('TextSpanType.IMAGE') { + ImageSpan('cat.jpg') + .width('100px') + .height('100px') + } + .id('textCustomMenu0060_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0070.ets new file mode 100755 index 00000000..f71c27a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0070.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextCustomMenu0070 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('TextSpanType.Text') { + Span('CopyOptions.None') + } + .id('textCustomMenu0070_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.None) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0080.ets new file mode 100755 index 00000000..897e7660 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0080.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextCustomMenu0080 { + @State text: string = '' + textController: TextController = new TextController(); + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text('CopyOptions.InApp') + .id('textCustomMenu0080_text') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0090.ets new file mode 100755 index 00000000..6d92a01b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0090.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. + */ + +@Extend(Menu) +function MenuStyles() { + .radius($r('sys.float.ohos_id_corner_radius_card')) + .clip(true) + .backgroundColor('#F0F0F0') +} +@Entry +@Component +struct UIComponentTextTextCustomMenu0090 { + @State res: string = 'Test TextSpanType.Text' + textController: TextController = new TextController(); + @State textSpanType:number = TextSpanType.TEXT + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon:'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + .MenuStyles() + } + } + build() { + Column() { + Text(){ + Span(this.res) + ImageSpan('cat.jpg') + .width('100px') + .height('100px') + } + .id('textCustomMenu0090_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%').height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(this.textSpanType, this.TextCustomMenu(), TextResponseType.LONG_PRESS) + + Button('change to TextSpanType.IMAGE').fontSize(20).width('100%') + .margin(100).id('textCustomMenu0090_btn').onClick(()=>{ + this.textSpanType = TextSpanType.IMAGE; + this.res = 'TextSpanType.IMAGE'; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0100.ets new file mode 100755 index 00000000..d1514665 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0100.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 UIComponentTextTextCustomMenu0100 { + @State res: string = 'TextResponseType.LONG_PRESS' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "Menu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "Menu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "Menu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.res) + } + .id('textCustomMenu0100_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(30) + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(this.textSpanType, this.TextCustomMenu(), this.textResponseType) + + Button('change to TextResponseType.SELECT') + .fontSize(20) + .width('100%') + .margin(100) + .id('textCustomMenu0100_btn') + .onClick(() => { + this.textResponseType = TextResponseType.SELECT; + this.res = 'TextResponseType.SELECT'; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0110.ets new file mode 100755 index 00000000..f43d3805 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0110.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 UIComponentTextTextCustomMenu0110 { + @State res: string = 'Muitl TextSpanType' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + @Builder + ImageCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'icon.png', content: "ImageMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "ImageMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'icon.png', content: "ImageMenu 3", labelInfo: "" }) + } + } + } + } + + @Builder + MixCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'openeye.png', content: "MixMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'openeye.png', content: "MixMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'openeye.png', content: "MixMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.res) + ImageSpan('cat.jpg') + .width('100px') + .height('100px') + } + .id('textCustomMenu0110_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), this.textResponseType) + .bindSelectionMenu(TextSpanType.IMAGE, this.ImageCustomMenu(), this.textResponseType) + .bindSelectionMenu(TextSpanType.MIXED, this.MixCustomMenu(), this.textResponseType) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0120.ets new file mode 100755 index 00000000..117ee80e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0120.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextCustomMenu0120 { + @State res: string = 'Text content is undefined' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + build() { + Column() { + Text() { + Span(this.res) + } + .id('textCustomMenu0120_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, undefined, this.textResponseType) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0130.ets new file mode 100755 index 00000000..8f6f4a6c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0130.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 UIComponentTextTextCustomMenu0130 { + @State res: string = 'Text bind mutil custom menu' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + @Builder + ImageCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'icon.png', content: "ImageMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'icon.png', content: "ImageMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'icon.png', content: "ImageMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.res) + } + .id('textCustomMenu0130_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType) + .bindSelectionMenu(TextSpanType.TEXT, this.ImageCustomMenu, this.textResponseType) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0140.ets new file mode 100755 index 00000000..545d3402 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0140.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 UIComponentTextTextCustomMenu0140 { + @State msg: string = 'Test for OnAppear' + @State res: string = '' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.msg) + } + .id('textCustomMenu0140_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType, { + onAppear: () => { + console.log('textCustomMenu0130', 'onAppear>>>'); + this.res = "TextCustomMenu onAppear>>"; + } + }) + + Text(this.res).margin(200).fontSize(22).fontColor(Color.Blue).width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0150.ets new file mode 100755 index 00000000..6c373565 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0150.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 UIComponentTextTextCustomMenu0150 { + @State msg: string = 'Test for onDisappear' + @State res: string = '' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.msg) + } + .id('textCustomMenu0150_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType, { + onDisappear: () => { + console.log('textCustomMenu0150', 'onDisappear>>>'); + this.res = "TextCustomMenu onDisappear>>"; + } + }) + + Text(this.res).margin(200).fontSize(22).fontColor(Color.Blue).width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0160.ets new file mode 100755 index 00000000..b23c065f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0160.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 UIComponentTextTextCustomMenu0160 { + @State msg: string = 'Test for onAppear && onDisappear' + @State res: string = '' + @State res1: string = '' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.msg) + } + .id('textCustomMenu0160_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType, { + onAppear: () => { + this.res = "TextCustomMenu onAppear>>"; + console.log('textCustomMenu0160', 'onAppear>>>'); + }, + onDisappear: () => { + this.res = "TextCustomMenu onDisappear>>"; + console.log('textCustomMenu0160', 'onDisappear>>>'); + } + }) + + TextInput({ text: this.res }) + .margin(200) + .id('textCustomMenu0160_text2') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0170.ets new file mode 100755 index 00000000..e334b1de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0170.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextCustomMenu0170 { + @State msg: string = 'Test for onTextSelectionChange' + @State res: string = 'current select:[-1,-1]' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.msg) + } + .id('textCustomMenu0170_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType, { + onAppear: () => { + console.log('textCustomMenu0170', 'onAppear>>>'); + }, + onDisappear: () => { + console.log('textCustomMenu0170', 'onDisappear>>>'); + } + }) + .onTextSelectionChange((start: number, end: number) => { + console.log('textCustomMenu0170', 'onTextSelectionChange>>> start=' + start + ' end=' + end); + this.res = 'current select:[' + start + ',' + end + ']'; + }) + + Text(this.res) + .margin(200) + .id('textCustomMenu0170_text2') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0180.ets new file mode 100755 index 00000000..b6fa0066 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0180.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 UIComponentTextTextCustomMenu0180 { + @State msg: string = 'Test for onTextSelectionChange,case:TextResponseType.RIGHT_CLICK' + @State res: string = 'current select:[-1,-1]' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.RIGHT_CLICK + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.msg) + } + .id('textCustomMenu0180_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType, { + onAppear: () => { + console.log('textCustomMenu0180', 'onAppear>>>'); + }, + onDisappear: () => { + console.log('textCustomMenu0180', 'onDisappear>>>'); + } + }) + .onTextSelectionChange((start: number, end: number) => { + this.res = 'current select:[' + start + ',' + end + ']'; + }) + + Text(this.res) + .margin(200) + .id('textCustomMenu0180_text2') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0190.ets new file mode 100755 index 00000000..60e80303 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0190.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 UIComponentTextTextCustomMenu0190 { + @State msg: string = 'Test for onTextSelectionChange,case: TextResponseType.SELECT' + @State res: string = 'current select:[-1,-1]' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.SELECT + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.msg) + } + .id('textCustomMenu0190_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType, { + onAppear: () => { + console.log('textCustomMenu0190', 'onAppear>>>'); + }, + onDisappear: () => { + console.log('textCustomMenu0190', 'onDisappear>>>'); + } + }) + .onTextSelectionChange((start: number, end: number) => {; + this.res = 'current select:[' + start + ',' + end + ']'; + }) + + Text(this.res) + .margin(200) + .id('textCustomMenu0190_text2') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0200.ets new file mode 100755 index 00000000..8a539e0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0200.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 UIComponentTextTextCustomMenu0200 { + @State msg: string = 'Test for onTextSelectionChange,case: CopyOptions.None' + @State res: string = 'current select:[-1,-1]' + textController: TextController = new TextController(); + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.SELECT + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu 3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text() { + Span(this.msg) + } + .id('textCustomMenu0200_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.None) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType, { + onAppear: () => { + console.log('textCustomMenu0200', 'onAppear>>>'); + }, + onDisappear: () => { + console.log('textCustomMenu0200', 'onDisappear>>>'); + } + }) + .onTextSelectionChange((start: number, end: number) => { + this.res = 'current select:[' + start + ',' + end + ']'; + }) + + Text(this.res) + .margin(200) + .id('textCustomMenu0200_text2') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0210.ets new file mode 100755 index 00000000..a132c7c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0210.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 Utils from '../../../test/model/Utils'; + + +@Entry +@Component +struct UIComponentTextTextCustomMenu0210 { + @State msg: string = 'Test for closeSelectionMenu' + @State res: string = 'current select:[-1,-1]' + textController: TextController = new TextController(); + options: TextOptions = { controller: this.textController }; + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + console.log('textCustomMenu0210', 'closeSelectionMenu>>>'); + this.res = 'callback: closeSelectionMenu()'; + Utils.sleep(100); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text(undefined, this.options) { + Span(this.msg) + } + .id('textCustomMenu0210_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType) + + Text(this.res) + .margin(210) + .id('textCustomMenu0210_text2') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0220.ets new file mode 100755 index 00000000..4ee800d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0220.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Utils from '../../../test/model/Utils'; + + +@Entry +@Component +struct UIComponentTextTextCustomMenu0220 { + @State msg: string = 'Test for TextCustomMenu' + @State msg2: string = 'Test for ImageCustomMenu' + @State res: string = 'current select:[-1,-1]' + textController: TextController = new TextController(); + options: TextOptions = { controller: this.textController }; + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + console.log('textCustomMenu0220', 'closeSelectionMenu>>>'); + this.res = 'callback: TextCustomMenu closeSelectionMenu()'; + Utils.sleep(100); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu3", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + console.log('textCustomMenu0220', 'closeSelectionMenu>>>'); + this.res = 'callback: TextCustomMenu closeSelectionMenu()'; + Utils.sleep(100); + }) + } + } + } + } + + @Builder + ImageCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'icon.png', content: "ImageMenu1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + console.log('textCustomMenu0220', 'ImageCustomMenu closeSelectionMenu>>>'); + this.res = 'callback: ImageCustomMenu closeSelectionMenu()'; + Utils.sleep(100); + }) + MenuItem({ startIcon: 'icon.png', content: "ImageMenu2", labelInfo: "" }) + MenuItem({ startIcon: 'icon.png', content: "ImageMenu3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text(undefined, this.options) { + Span(this.msg) + } + .id('textCustomMenu0220_text1') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu(), this.textResponseType) + + Text(undefined, this.options) { + Span(this.msg2) + } + .id('textCustomMenu0220_text2') + .margin({ + top:150 + }) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.ImageCustomMenu(), this.textResponseType) + + Text(this.res) + .margin({ + top:100 + }) + .id('textCustomMenu0220_text3') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0230.ets new file mode 100755 index 00000000..b8979a50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0230.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 Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextTextCustomMenu0230 { + @State msg: string = 'Test for onTextSelectionChange,case: MOUSE_BUTTON_LEFT' + @State res: string = 'current select:[-1,-1]' + textController: TextController = new TextController(); + options: TextOptions = { controller: this.textController }; + @State textSpanType: number = TextSpanType.TEXT + @State textResponseType: number = TextResponseType.LONG_PRESS + + @Builder + TextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu1", labelInfo: "" }) + .onClick((event) => { + this.textController.closeSelectionMenu(); + console.log('textCustomMenu0230', 'closeSelectionMenu>>>'); + this.res = 'callback: closeSelectionMenu()'; + Utils.sleep(100); + }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu2", labelInfo: "" }) + MenuItem({ startIcon: 'cat.jpg', content: "TextMenu3", labelInfo: "" }) + } + } + } + } + + build() { + Column() { + Text(undefined, this.options) { + Span(this.msg) + } + .id('textCustomMenu0230_text') + .margin(50) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(TextSpanType.TEXT, this.TextCustomMenu, this.textResponseType) + .onTextSelectionChange((start: number, end: number) => { + console.log('textCustomMenu0230', 'onTextSelectionChange>>> start=' + start + ' end=' + end); + this.res = 'current select:[' + start + ',' + end + ']'; + }) + + Text(this.res) + .margin(210) + .id('textCustomMenu0230_text2') + .fontSize(22) + .fontColor(Color.Blue) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0010.ets new file mode 100755 index 00000000..6e46323b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0010.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. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0010 { + @State changeValue: string = 'selectionMenuHidden:default' + @State submitValue: string = '' + controller: SearchController = new SearchController() + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0010') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + console.log(`onSubmit:${value}`); + this.submitValue = value; + }) + .onChange((value: string) => { + console.log(`onChange:${value}`); + this.changeValue = value; + }) + .margin(20) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0030.ets new file mode 100755 index 00000000..a0c96036 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0030.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0030 { + @State changeValue: string = '' + @State submitValue: string = '' + controller: SearchController = new SearchController() + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0030') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + console.log(`onSubmit:${value}`); + this.submitValue = value; + }) + .onChange((value: string) => { + console.log(`onChange:${value}`); + this.changeValue = value; + }) + .margin(20) + + Button('TODO stopEditing') + .id('textInputCursor0030_btn') + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, stopEditing'); + this.controller.stopEditing(); + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0040.ets new file mode 100755 index 00000000..7f3f9806 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0040.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0040 { + @State changeValue: string = 'selectionMenuHidden set false' + @State submitValue: string = '' + controller: SearchController = new SearchController() + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0040') + .searchButton('SEARCH') + .width('95%') + .height(40) + .selectionMenuHidden(false) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + console.log(`onSubmit:${value}`); + this.submitValue = value; + }) + .onChange((value: string) => { + console.log(`onChange:${value}`); + this.changeValue = value; + }) + .margin(20) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0060.ets new file mode 100755 index 00000000..fcf43580 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0060.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0060 { + @State changeValue: string = 'selectionMenuHidden set true' + @State submitValue: string = '' + controller: SearchController = new SearchController() + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0060') + .searchButton('SEARCH') + .width('95%') + .height(40) + .selectionMenuHidden(true) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + console.log(`onSubmit:${value}`); + this.submitValue = value; + }) + .onChange((value: string) => { + console.log(`onChange:${value}`); + this.changeValue = value; + }) + .margin(20) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0080.ets new file mode 100755 index 00000000..766418dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0080.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0080 { + @State changeValue: string = 'search: defaultFocus' + @State selectRes: string = '' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0080') + .searchButton('SEARCH') + .width('95%') + .height(40) + .defaultFocus(true) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0090.ets new file mode 100755 index 00000000..5ca0494f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0090.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0090 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: enabled set false,' + this.msg + @State scrollRes: string = '' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0090') + .searchButton('SEARCH') + .width('95%') + .height(40) + .enabled(false) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0110.ets new file mode 100755 index 00000000..0cb04524 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0110.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0110 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: enabled set false,' + this.msg + @State selectRes: string = '[-1,-1]' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0110') + .searchButton('SEARCH') + .width('95%') + .height(40) + .enabled(false) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((start, end) => { + console.log(`onContentScroll>>>`); + this.selectRes = `select:[${start},${end}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130.ets new file mode 100755 index 00000000..c4e761b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0130 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: focusable set false,' + this.msg + @State scrollRes: string = '' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0130') + .searchButton('SEARCH') + .width('95%') + .height(40) + .focusable(false) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0150.ets new file mode 100755 index 00000000..267b9073 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0150.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0150 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: focusable set false,' + this.msg + @State selectRes: string = '[-1,-1]' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0150') + .searchButton('SEARCH') + .width('95%') + .height(40) + .focusable(false) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((start, end) => { + console.log(`onContentScroll>>>`); + this.selectRes = `select:[${start},${end}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0180.ets new file mode 100755 index 00000000..3c5a34ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0180.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0180 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: focusable set true,' + this.msg + @State selectRes: string = '[-1,-1]' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0180') + .searchButton('SEARCH') + .width('95%') + .height(40) + .focusable(true) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((start, end) => { + console.log(`onContentScroll>>>`); + this.selectRes = `select:[${start},${end}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0190.ets new file mode 100755 index 00000000..7145e6ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0190.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0190 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: focusable set true,' + this.msg + @State scrollRes: string = '' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0190') + .searchButton('SEARCH') + .width('95%') + .height(40) + .focusable(true) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0210.ets new file mode 100755 index 00000000..17a41f7f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0210.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0210 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: touchable set false,' + this.msg + @State scrollRes: string = '' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0210') + .searchButton('SEARCH') + .width('95%') + .height(40) + .touchable(false) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0230.ets new file mode 100755 index 00000000..8dce2533 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0230.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0230 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: touchable set false,' + this.msg + @State selectRes: string = '[-1,-1]' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0230') + .searchButton('SEARCH') + .width('95%') + .height(40) + .touchable(false) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((start, end) => { + console.log(`onContentScroll>>>`); + this.selectRes = `select:[${start},${end}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0250.ets new file mode 100755 index 00000000..5e333f06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0250.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0250 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: onContentScroll: ' + this.msg + @State scrollRes: string = '' + @State submitValue: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0250') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.scrollRes = `scrolling:[${totalOffsetX},${totalOffsetY}]`; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0260.ets new file mode 100755 index 00000000..d1ee715c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0260.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0260 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: onTextSelectionChange: ' + this.msg + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0260') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .caretStyle({width:50}) + .onTextSelectionChange((selectionStart: number, selectionEnd: number)=>{ + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0270.ets new file mode 100755 index 00000000..07129695 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0270.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0270 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: set CopyOptions.InApp, ' + this.msg + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0270') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .copyOption(CopyOptions.InApp) + .onTextSelectionChange((selectionStart: number, selectionEnd: number)=>{ + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0280.ets new file mode 100755 index 00000000..e0629f51 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0280.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0280 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: set CopyOptions.LocalDevice, ' + this.msg + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0280') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .copyOption(CopyOptions.LocalDevice) + .onTextSelectionChange((selectionStart: number, selectionEnd: number)=>{ + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0290.ets new file mode 100755 index 00000000..f5846034 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0290.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0290 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search: set CopyOptions.None, ' + this.msg + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0290') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .copyOption(CopyOptions.None) + .onTextSelectionChange((selectionStart: number, selectionEnd: number)=>{ + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0300.ets new file mode 100755 index 00000000..a6e38ff1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0300.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0300 { + @State changeValue: string = 'Search:TextAlign.Center' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0300') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .textAlign(TextAlign.Center) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0320.ets new file mode 100755 index 00000000..0e738235 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0320.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0320 { + @State changeValue: string = 'Search: TextAlign.End' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0320') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .textAlign(TextAlign.End) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0340.ets new file mode 100755 index 00000000..f4937088 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0340.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0340 { + @State changeValue: string = 'Search: TextAlign.JUSTIFY' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0340') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .textAlign(TextAlign.JUSTIFY) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0360.ets new file mode 100755 index 00000000..ee3abed9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0360.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0360 { + @State changeValue: string = 'Search: TextAlign.Start' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0360') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .textAlign(TextAlign.Start) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380.ets new file mode 100755 index 00000000..bd54545d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380.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 UIComponentTextTextInputCursor0380 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'Search: '+this.msg + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0380') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0450.ets new file mode 100755 index 00000000..4ac1951b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0450.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 UIComponentTextTextInputCursor0450 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'Search: stopEditing' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0450') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Button('TODO stopEditing') + .id('textInputCursor0450_btn') + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, stopEditing'); + this.controller.stopEditing(); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0460.ets new file mode 100755 index 00000000..d7698bc5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0460.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0460 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search:see current setTextSelection' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0460') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.controller.setTextSelection(10,20); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0470.ets new file mode 100755 index 00000000..71b09fb9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0470.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0470 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search.SearchType.EMAIL@haha.com' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0470') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .type(SearchType.EMAIL) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0480.ets new file mode 100755 index 00000000..f795a97e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0480.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0480 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search.SearchType.NORMAL,89302$%%^&^*_' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0480') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .type(SearchType.NORMAL) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0490.ets new file mode 100755 index 00000000..f9a81a3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0490.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0490 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = '65464628472397432' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0490') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .type(SearchType.NUMBER) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0510.ets new file mode 100755 index 00000000..3ad8c4ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0510.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0510 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = '(42864826 +_#*)' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0510') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .type(SearchType.PHONE_NUMBER) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0520.ets new file mode 100755 index 00000000..ca84d71e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0520.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0520 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State changeValue: string = 'search:caretPosition(5)' + @State selectRes: string = '' + controller: SearchController = new SearchController(); + + build() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textInputCursor0520') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.controller.caretPosition(5); + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point position:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0570.ets new file mode 100755 index 00000000..53dc297d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0570.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0570 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:selectionMenuHidden default,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0570') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onChange((value: string) => { + this.txt = value + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0590.ets new file mode 100755 index 00000000..966e3817 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0590.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. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0590 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:selectionMenuHidden false,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0590') + .width('95%') + .margin(20) + .fontSize(16) + .selectionMenuHidden(false) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onChange((value: string) => { + this.txt = value + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0610.ets new file mode 100755 index 00000000..80fd5260 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0610.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. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0610 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:selectionMenuHidden true,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0610') + .width('95%') + .margin(20) + .fontSize(16) + .selectionMenuHidden(true) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onChange((value: string) => { + this.txt = value + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0630.ets new file mode 100755 index 00000000..5266041f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0630.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 UIComponentTextTextInputCursor0630 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:selectionMenuHidden true,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0630') + .width('95%') + .margin(20) + .fontSize(16) + .selectionMenuHidden(true) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onChange((value: string) => { + this.txt = value + }) + + Button('TODO stopEditing') + .id('textInputCursor0630_btn') + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, stopEditing'); + this.controller.stopEditing(); + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0640.ets new file mode 100755 index 00000000..443e94c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0640.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0640 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:defaultFocus true,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0640') + .width('95%') + .margin(20) + .fontSize(16) + .defaultFocus(true) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0650.ets new file mode 100755 index 00000000..3e095935 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0650.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0650 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:enabled false,' + this.msg + @State scrollRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0650') + .width('95%') + .margin(20) + .fontSize(16) + .enabled(false) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0670.ets new file mode 100755 index 00000000..7bef73f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0670.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0670 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:enabled false,' + this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0670') + .width('95%') + .margin(20) + .fontSize(16) + .enabled(false) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0690.ets new file mode 100755 index 00000000..842368d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0690.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0690 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:focusable false,'+this.msg + @State scrollRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0690') + .width('95%') + .margin(20) + .fontSize(16) + .focusable(false) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0710.ets new file mode 100755 index 00000000..38b66bf0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0710.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0710 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:focusable false,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0710') + .width('95%') + .margin(20) + .fontSize(16) + .focusable(false) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0730.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0730.ets new file mode 100755 index 00000000..4315290e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0730.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0730 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:focusable true,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0730') + .width('95%') + .margin(20) + .fontSize(16) + .focusable(true) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0750.ets new file mode 100755 index 00000000..0a03347c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0750.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 UIComponentTextTextInputCursor0750 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:focusable true,' + this.msg + @State scrollRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0750') + .width('95%') + .height(50) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .focusable(true) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + selectionStart = 20; + selectionEnd = 100; + this.controller.setTextSelection(selectionStart, selectionEnd); + }) + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0770.ets new file mode 100755 index 00000000..3e7694a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0770.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 UIComponentTextTextInputCursor0770 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:touchable false,' + this.msg + @State scrollRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0770') + .width('95%') + .height(50) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .touchable(false) + .onContentScroll(() => { + console.log(`onContentScroll>>>`); + this.scrollRes = 'scrolling'; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0790.ets new file mode 100755 index 00000000..0111fb80 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0790.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0790 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:touchable false,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0790') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .touchable(false) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0810.ets new file mode 100755 index 00000000..ad1b2f47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0810.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 UIComponentTextTextInputCursor0810 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:onContentScroll,' + this.msg + @State scrollRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0810') + .width('95%') + .height(50) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number)=>{ + selectionStart = 20; + selectionEnd = this.txt.length; + this.controller.setTextSelection(selectionStart, selectionEnd); + }) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.scrollRes = `scrolling:[${totalOffsetX},${totalOffsetY}]`; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0820.ets new file mode 100755 index 00000000..5998193a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0820.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0820 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:caretStyle({width:50}),'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0820') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .caretStyle({width:50}) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0830.ets new file mode 100755 index 00000000..9a85a4b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0830.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0830 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:CopyOptions.InApp,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0830') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .copyOption(CopyOptions.InApp) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0840.ets new file mode 100755 index 00000000..da06d6a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0840.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0840 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:CopyOptions.LocalDevice,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0840') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .copyOption(CopyOptions.LocalDevice) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0850.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0850.ets new file mode 100755 index 00000000..7a0f5f40 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0850.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0850 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea:CopyOptions.None,'+this.msg + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0850') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .copyOption(CopyOptions.None) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0860.ets new file mode 100755 index 00000000..024e20bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0860.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0860 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea: set TextAlign.Center' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0860') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .textAlign(TextAlign.Center) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0880.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0880.ets new file mode 100755 index 00000000..da7c3964 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0880.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0880 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea: set TextAlign.End' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0880') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .textAlign(TextAlign.End) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0900.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0900.ets new file mode 100755 index 00000000..85daf0e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0900.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0900 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea: set TextAlign.JUSTIFY' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0900') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .textAlign(TextAlign.JUSTIFY) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0920.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0920.ets new file mode 100755 index 00000000..c0311c22 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0920.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInputCursor0920 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea: set TextAlign.Start' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0920') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .textAlign(TextAlign.Start) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940.ets new file mode 100755 index 00000000..111851ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor0940 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.msg, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0940') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0990.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0990.ets new file mode 100755 index 00000000..b7672b2a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0990.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 UIComponentTextTextInputCursor0990 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor0990') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1010.ets new file mode 100755 index 00000000..43ba04de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1010.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 UIComponentTextTextInputCursor1010 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea: test stopEditing' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1010') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Button('TODO stopEditing') + .id('textInputCursor1010_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, stopEditing'); + this.controller.stopEditing(); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1020.ets new file mode 100755 index 00000000..9560ed75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1020.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 UIComponentTextTextInputCursor1020 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.msg, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1020') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO Selection') + .id('textInputCursor1020_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, Selection'); + this.controller.setTextSelection(10, 20); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1030.ets new file mode 100755 index 00000000..c1043d62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1030.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 UIComponentTextTextInputCursor1030 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea_TextAreaType.EMAIL122@sjdjl' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1030') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .type(TextAreaType.EMAIL) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO Selection') + .id('textInputCursor1030_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, Selection'); + this.controller.setTextSelection(0, this.txt.length - 1); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1040.ets new file mode 100755 index 00000000..b046f817 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1040.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 UIComponentTextTextInputCursor1040 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = '[TextArea_TextAreaType.NORMAL@sjdjl平台239147@#%$^&??><>1546}' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1040') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .type(TextAreaType.NORMAL) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO Selection') + .id('textInputCursor1040_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, Selection'); + this.controller.setTextSelection(0, this.txt.length - 1); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1050.ets new file mode 100755 index 00000000..3d717c36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1050.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 UIComponentTextTextInputCursor1050 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = '35478287234233432523' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1050') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .type(TextAreaType.NUMBER) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO Selection') + .id('textInputCursor1050_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, Selection'); + this.controller.setTextSelection(0, this.txt.length - 1); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1060.ets new file mode 100755 index 00000000..65db9299 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1060.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 UIComponentTextTextInputCursor1060 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = '0_354782872 +_#*)' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1060') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .type(TextAreaType.PHONE_NUMBER) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO Selection') + .id('textInputCursor1060_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, Selection'); + this.controller.setTextSelection(0, this.txt.length - 1); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1070.ets new file mode 100755 index 00000000..77482508 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1070.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 UIComponentTextTextInputCursor1070 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = '0_354782872 +_#*)' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1070') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .type(TextAreaType.PHONE_NUMBER) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO Selection') + .id('textInputCursor1070_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, Selection'); + this.controller.setTextSelection(0, this.txt.length - 1); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1080.ets new file mode 100755 index 00000000..9c0be68f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1080.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 UIComponentTextTextInputCursor1080 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea: set caretPosition 5' + @State selectRes: string = '' + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.txt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .id('textInputCursor1080') + .width('95%') + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + this.controller.caretPosition(5); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1130.ets new file mode 100755 index 00000000..b64ee877 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1130.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1130 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: selectionMenuHidden[default]' + @State selectRes: string = '' + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1130') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1150.ets new file mode 100755 index 00000000..e8a975db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1150.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1150 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: selectionMenuHidden[false]' + @State selectRes: string = '' + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1150') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .selectionMenuHidden(false) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1170.ets new file mode 100755 index 00000000..98ba883e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1170.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1170 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: selectionMenuHidden[true]' + @State selectRes: string = '' + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1170') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .selectionMenuHidden(true) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1190.ets new file mode 100755 index 00000000..15518297 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1190.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1190 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: stopEditing' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg ,controller:this.controller}) + .id('textInputCursor1190') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO stopEditing') + .id('textInputCursor1190_btn') + .margin(20) + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, stopEditing'); + this.controller.stopEditing(); + }) + + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1200.ets new file mode 100755 index 00000000..b2bd7f76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1200.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1200 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: defaultFocus[true]' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1200') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .defaultFocus(true) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1210.ets new file mode 100755 index 00000000..ec01b2f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1210.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1210 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: enabled[false]' + @State scrollRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1210') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .enabled(false) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.scrollRes = `onContentScroll:[${totalOffsetX},${totalOffsetY}]`; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220.ets new file mode 100755 index 00000000..a2c0f95a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1220 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: enabled[false]' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1220') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .enabled(false) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1250.ets new file mode 100755 index 00000000..0585745a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1250.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1250 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: focusable[false]' + @State scrollRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1250') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .focusable(false) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.scrollRes = `onContentScroll:[${totalOffsetX},${totalOffsetY}]`; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260.ets new file mode 100755 index 00000000..22f28ec0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1260 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: focusable[false]' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1260') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .focusable(false) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1290.ets new file mode 100755 index 00000000..2c01baac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1290.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1290 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: focusable[true]' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1290') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .focusable(true) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1310.ets new file mode 100755 index 00000000..5c23da88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1310.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1310 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: focusable[true]' + @State scrollRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1310') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .focusable(true) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.scrollRes = `onContentScroll:[${totalOffsetX},${totalOffsetY}]`; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1330.ets new file mode 100755 index 00000000..582031c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1330.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1330 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: touchable[false]' + @State scrollRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1330') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .touchable(false) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.scrollRes = `onContentScroll:[${totalOffsetX},${totalOffsetY}]`; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340.ets new file mode 100755 index 00000000..f114e494 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1340 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: touchable[false]' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1340') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .touchable(false) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1370.ets new file mode 100755 index 00000000..c30f3f3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1370.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1370 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: onContentScroll' + @State scrollRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1370') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.scrollRes = `onContentScroll:[${totalOffsetX},${totalOffsetY}]`; + }) + Text(this.scrollRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1380.ets new file mode 100755 index 00000000..9653ae42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1380.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1380 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: set caretStyle' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1380') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .caretStyle({ width: 50 }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1390.ets new file mode 100755 index 00000000..6a454e15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1390.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1390 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: set CopyOptions.InApp' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1390') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.InApp) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1400.ets new file mode 100755 index 00000000..aa744a9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1400.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1400 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: CopyOptions.LocalDevice' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1400') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.LocalDevice) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1410.ets new file mode 100755 index 00000000..23b3060e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1410.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1410 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: CopyOptions.None' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1410') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .copyOption(CopyOptions.None) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1420.ets new file mode 100755 index 00000000..5f7753c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1420.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1420 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: TextAlign.Center' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.txt }) + .id('textInputCursor1420') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .textAlign(TextAlign.Center) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1440.ets new file mode 100755 index 00000000..44786775 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1440.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1440 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: TextAlign.End ' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.txt }) + .id('textInputCursor1440') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .textAlign(TextAlign.End) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1460.ets new file mode 100755 index 00000000..62dc3ca0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1460.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1460 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: TextAlign.JUSTIFY' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.txt }) + .id('textInputCursor1460') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .textAlign(TextAlign.JUSTIFY) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1480.ets new file mode 100755 index 00000000..5a0c34ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1480.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1480 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: TextAlign.Start' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.txt }) + .id('textInputCursor1480') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .textAlign(TextAlign.Start) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500.ets new file mode 100755 index 00000000..d672a99a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1500 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg }) + .id('textInputCursor1500') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1550.ets new file mode 100755 index 00000000..73635ead --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1550.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1550 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput() + .id('textInputCursor1550') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1570.ets new file mode 100755 index 00000000..47330456 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1570.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1570 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({controller: this.controller }) + .id('textInputCursor1570') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO stopEditing') + .id('textInputCursor1570_btn') + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, stopEditing'); + this.controller.stopEditing(); + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1580.ets new file mode 100755 index 00000000..9c59c257 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1580.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1580 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.msg, controller: this.controller }) + .id('textInputCursor1580') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Button('TODO setTextSelection') + .id('textInputCursor1580_btn') + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, setTextSelection'); + this.controller.setTextSelection(10, 20); + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1590.ets new file mode 100755 index 00000000..f66db90f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1590.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1590 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput_1580_InputType.Email@hdsj.ww' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({text:this.txt}) + .id('textInputCursor1590') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .type(InputType.Email) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1600.ets new file mode 100755 index 00000000..38c9be04 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1600.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1600 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput_1580_InputType.Normal@hdsjfdegr5654%&^*%^&?<>{.目标是面向全场景' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({text:this.txt}) + .id('textInputCursor1600') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .type(InputType.Normal) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1610.ets new file mode 100755 index 00000000..2d8c2957 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1610.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1610 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = '160043564676587863dgsgsdg354365' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({text:this.txt}) + .id('textInputCursor1610') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .type(InputType.Number) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1620.ets new file mode 100755 index 00000000..f6302d1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1620.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1620 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'InputType.Password' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({placeholder:'input Password'}) + .id('textInputCursor1620') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .type(InputType.Password) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1630.ets new file mode 100755 index 00000000..0f1f56f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1630.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1630 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = '(28_72394gdfjhgfj756373538756784132137)' + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.txt, controller: this.controller }) + .id('textInputCursor1630') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .type(InputType.PhoneNumber) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640.ets new file mode 100755 index 00000000..149a2421 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1640 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextInput: set caretPosition,'+this.msg + @State selectRes: string = '' + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.txt, controller: this.controller }) + .id('textInputCursor1640') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.selectRes = `point:[${selectionStart},${selectionEnd}]`; + } else { + this.selectRes = `select:[${selectionStart},${selectionEnd}]`; + } + }) + Text(this.selectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin(20) + .width('95%') + .height(40) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690.ets new file mode 100755 index 00000000..af15e853 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690.ets @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1690 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taTxt: string = 'TextArea:' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State changeValue: string = 'search:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + @State seSelectRes: string = '' + @State seScrollRes: string = '' + @State submitValue: string = '' + searchController: SearchController = new SearchController(); + textAreaController: TextAreaController = new TextAreaController() + textInputController: TextInputController = new TextInputController() + + build() { + Column() { + TextArea({ + text: this.taTxt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .id('textInputCursor1690_txArea') + .width('100%') + .margin(20) + .height(50) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextArea{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.taTxt.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + this.taSelectRes = `TextArea{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Text(this.taSelectRes) + .fontColor(Color.Green) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + TextInput({ + text: this.tiTxt, + controller: this.textInputController + }) + .id('textInputCursor1690_txInput') + .margin(20) + .fontColor(Color.Blue) + .fontSize(20) + .width('100%') + .height(50) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.tiScrollRes = `TextInput{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.tiSelectRes = `TextInput{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.tiTxt.length; + if (selectionEnd < length) { + this.textInputController.setTextSelection(selectionStart, length); + } + this.tiSelectRes = `TextInput{select:[${selectionStart},${selectionEnd}]}`; + } + // this.textInputController.stopEditing(); + }) + Text(this.tiSelectRes) + .fontColor(Color.Blue) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Search({ + value: this.changeValue, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textInputCursor1690_search') + .searchButton('SEARCH') + .width('100%') + .height(50) + .caretStyle({}) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + // this.searchController.stopEditing(); + if (selectionStart == selectionEnd) { + this.seSelectRes = `Search{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.changeValue.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + this.seSelectRes = `Search{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Text(this.seSelectRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720.ets new file mode 100755 index 00000000..8f16a684 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1720 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taTxt: string = 'TextArea:' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State changeValue: string = 'search:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + @State seSelectRes: string = '' + @State seScrollRes: string = '' + @State submitValue: string = '' + searchController: SearchController = new SearchController(); + textAreaController: TextAreaController = new TextAreaController() + textInputController: TextInputController = new TextInputController() + + build() { + Column() { + TextArea({ + text: this.taTxt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .id('textInputCursor1720_txArea') + .width('100%') + .margin(20) + .height(50) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextArea{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.taTxt.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + this.taSelectRes = `TextArea{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Text(this.taSelectRes) + .fontColor(Color.Green) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Search({ + value: this.changeValue, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textInputCursor1720_search') + .searchButton('SEARCH') + .width('100%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + if (selectionStart == selectionEnd) { + this.seSelectRes = `Search{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.changeValue.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + this.seSelectRes = `Search{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Text(this.seSelectRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + + Button('TODO requestFocus') + .id('textInputCursor1720_btn') + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, requestFocus'); + focusControl.requestFocus('textInputCursor1720_search'); + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1750.ets new file mode 100755 index 00000000..0e3fc178 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1750.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTextInputCursor1750 { + @State taTxt: string = 'this is test text'; + @State enable: boolean = true; + textInputController: TextInputController = new TextInputController() + + build() { + Column() { + Button('enable').onClick(() => { + this.enable = false; + }).margin(10).id('textInputCursor1750_button') + TextInput({ + text: this.taTxt, + placeholder: 'input your word...', + controller: this.textInputController + }) + .enabled(this.enable) + .id('textInputCursor1750_txInput') + .width('100%') + .margin(20) + .height(50) + .fontSize(16) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0010.ets new file mode 100755 index 00000000..116493c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0010.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import data from '@ohos.telephony.data' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0010 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:test keepEditableState' + @State subText: string = '' + @State enterKey: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0010') + .width(380) + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + // 调用keepEditableState方法,输入框保持编辑态 + event.keepEditableState(); + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey = this.enterKeyTypeStr[index]; + } + } + }) + + Text('current EnterKeyType is:' + this.enterKey+',\nsubmit text='+this.subText) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0020.ets new file mode 100755 index 00000000..fab56181 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0020.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import data from '@ohos.telephony.data' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0020 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:test keepEditableState' + @State subText: string = '' + @State enterKey: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State event: SubmitEvent |null=null; + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0020') + .width(380) + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.event = event; + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey = this.enterKeyTypeStr[index]; + } + } + }) + + Text('current EnterKeyType is:' + this.enterKey+',\nsubmit text='+this.event?.text) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0030.ets new file mode 100755 index 00000000..fc99c5d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0030.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. + */ +import data from '@ohos.telephony.data' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0030 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:test keepEditableState' + @State subText: string = '' + @State enterKey: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State event: SubmitEvent |null=null; + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0030') + .width(380) + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.event = event; + event.keepEditableState(); + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey = this.enterKeyTypeStr[index]; + } + } + }) + + Text('current EnterKeyType is:' + this.enterKey+',\nsubmit text='+this.event?.text) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0040.ets new file mode 100755 index 00000000..b0a58f46 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0040.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0040 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State textError: string = '' + @State text: string = 'TextInput:test no keepEditableState' + @State subText: string = '' + @State enterKey: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0040') + .width(380) + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey = this.enterKeyTypeStr[index]; + } + } + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + }) + + Text('current EnterKeyType is:' + this.enterKey+',\nsubmit text='+this.subText) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0060.ets new file mode 100755 index 00000000..352d556c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0060.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 { KeyCode } from '@kit.InputKit' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0060 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:keepEditableState' + @State enterKey: string = 'Go' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State nextKey: number = EnterKeyType.Go + @State nextKeyStr: string = 'Go' + @State curKeyStr: string = 'Go' + @State curKey: number = EnterKeyType.Go + @State testRes: string = '' + @State subText: string = '' + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0060') + .type(InputType.Normal) + .enterKeyType(this.nextKey) + .width('400') + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && (KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode)) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + // 调用keepEditableState方法,输入框保持编辑态 + event.keepEditableState(); + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.testRes += '{'+this.enterKeyTypeStr[index] + ',callback from onSubmit' + '\n'+'submit text='+this.subText+'}'; + } + } + }) + + Text('current EnterKeyType is:' + this.curKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Text('next EnterKeyType is:' + this.nextKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070.ets new file mode 100755 index 00000000..150507dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070.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. + */ +import { KeyCode } from '@kit.InputKit' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0070 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:keepEditableState' + @State enterKey: string = 'Go' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State nextKey: number = EnterKeyType.Go + @State nextKeyStr: string = 'Go' + @State curKeyStr: string = 'Go' + @State curKey: number = EnterKeyType.Go + @State testRes: string = '' + @State subText: string = '' + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0070') + .style(TextInputStyle.Inline) + .enterKeyType(this.nextKey) + .width('400') + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && (KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode)) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + // 调用keepEditableState方法,输入框保持编辑态 + event.keepEditableState(); + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + //event.text = 'TextInputKeepEditableState0070 onSubmit event.text'; + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.testRes += '\n{'+this.enterKeyTypeStr[index] + ',callback from onSubmit' + ',submit text='+this.subText+'}'; + } + } + }) + + Text('current EnterKeyType is:' + this.curKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Text('next EnterKeyType is:' + this.nextKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100.ets new file mode 100755 index 00000000..02b5ca27 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100.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 UIComponentTextTextInputKeepEditableState0100 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:test keepEditableState' + @State enterKey: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE]; + event: SubmitEvent |null=null + @State subText: string = '' + + build() { + Column() { + TextInput({ placeholder: 'input...', text: this.text }) + .id('textInputKeepEditableState0100') + .type(InputType.Normal) + .width('95%') + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.enterKeyType = enterKey.valueOf(); + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey = this.enterKeyTypeStr[index]; + } + } + // 调用keepEditableState方法,输入框保持编辑态 + event.keepEditableState(); + event.text = 'TextInputKeepEditableState0100 onSubmit event.text'; + }) + + Text('current EnterKeyType is:' + this.enterKey+',\nsubmit text='+this.subText) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0120.ets new file mode 100755 index 00000000..67901362 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0120.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 { KeyCode } from '@kit.InputKit' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0120 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:no keepEditableState,InputType.Normal' + @State enterKey: string = 'Go' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State nextKey: number = EnterKeyType.Go + @State nextKeyStr: string = 'Go' + @State curKeyStr: string = 'Go' + @State curKey: number = EnterKeyType.Go + @State testRes: string = '' + @State subText: string = '' + + build() { + Column() { + TextInput({ placeholder: 'input...', text: this.text }) + .id('textInputKeepEditableState0120') + .type(InputType.Normal) + .enterKeyType(this.nextKey) + .width('400') + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + console.log(`onKeyEvent>> curKeyStr=${this.curKeyStr},nextKeyStr=${this.nextKeyStr}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && (KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode)) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.enterKeyType = enterKey.valueOf(); + this.subText = event.text; + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.testRes += this.enterKeyTypeStr[index] + ',callback from onSubmit' + '\n'+'submit text='+this.subText; + } + } + // 调用keepEditableState方法,输入框保持编辑态 + // event.keepEditableState() + }) + + Text('current EnterKeyType is:' + this.curKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Text('next EnterKeyType is:' + this.nextKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130.ets new file mode 100755 index 00000000..2b5f2c6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130.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. + */ +import { KeyCode } from '@kit.InputKit' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0130 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:no keepEditableState,TextInputStyle.Inline' + @State enterKey: string = 'Go' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State nextKey: number = EnterKeyType.Go + @State nextKeyStr: string = 'Go' + @State curKeyStr: string = 'Go' + @State curKey: number = EnterKeyType.Go + @State testRes: string = '' + @State subText: string = '' + + build() { + Column() { + TextInput({ placeholder: 'input...', text: this.text }) + .id('textInputKeepEditableState0130') + .style(TextInputStyle.Inline) + .enterKeyType(this.nextKey) + .width('400') + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + console.log(`onKeyEvent>> curKeyStr=${this.curKeyStr},nextKeyStr=${this.nextKeyStr}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && ((KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode) || (KeyCode.KEYCODE_ENTER == event.keyCode))) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.enterKeyType = enterKey.valueOf(); + this.subText = event.text; + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.testRes += '{'+this.enterKeyTypeStr[index] + ',callback from onSubmit' + ',submit text='+this.subText+'}\n'; + } + } + }) + + Text('current EnterKeyType is:' + this.curKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Text('next EnterKeyType is:' + this.nextKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0140.ets new file mode 100755 index 00000000..19037e67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0140.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 UIComponentTextTextInputKeepEditableState0140 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:no keepEditableState,InputType.Normal' + @State enterKey: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE]; + event: SubmitEvent |null=null + @State subText: string = '' + + build() { + Column() { + TextInput({ placeholder: 'input...'}) + .id('textInputKeepEditableState0140') + .type(InputType.Normal) + .width('95%') + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.enterKeyType = enterKey.valueOf(); + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey = this.enterKeyTypeStr[index]; + } + } + }) + + Text('current EnterKeyType is:' + this.enterKey+',\nsubmit text='+this.subText) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0150.ets new file mode 100755 index 00000000..ee0a3022 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0150.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 { KeyCode } from '@kit.InputKit' + +@Entry +@Component +struct UIComponentTextTextInputKeepEditableState0150 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:no keepEditableState,TextInputStyle.Inline' + @State enterKey: string = 'Go' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + @State nextKey: number = EnterKeyType.Go + @State nextKeyStr: string = 'Go' + @State curKeyStr: string = 'Go' + @State curKey: number = EnterKeyType.Go + @State testRes: string = '' + @State subText: string = '' + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0150') + .style(TextInputStyle.Inline) + .enterKeyType(this.nextKey) + .width('400') + .borderWidth(3) + .onKeyEvent((event: KeyEvent) => { + console.log(`onKeyEvent>> keyText=${event.keyText},keyCode=${event.keyCode},type=${event.type}`); + this.curKeyStr = this.nextKeyStr; + if ((KeyType.Down == event.type) && (KeyCode.KEYCODE_NUMPAD_ENTER == event.keyCode)) { + if (this.curKey < EnterKeyType.NEW_LINE) { + this.nextKey++; + } + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (this.nextKey == this.enterKeyTypeNum[index]) { + this.nextKeyStr = this.enterKeyTypeStr[index]; + } + } + } + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + // 调用keepEditableState方法,输入框保持编辑态 + this.subText = event.text; + console.log(`onSubmit>> subText=${this.subText}`); + //event.text = 'TextInputKeepEditableState0070 onSubmit event.text'; + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.testRes += '{'+this.enterKeyTypeStr[index] + ',callback from onSubmit' + '\n'+'submit text='+this.subText+'}'; + } + } + }) + + Text('current EnterKeyType is:' + this.curKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Text('next EnterKeyType is:' + this.nextKeyStr) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + Text('test result is:\n' + this.testRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0180.ets new file mode 100755 index 00000000..1e90e967 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0180.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 UIComponentTextTextInputKeepEditableState0180 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State textError: string = '' + @State text: string = 'TextInput:test no keepEditableState' + @State subText: string = '' + @State enterKey: string = '' + @State subText1: string = '' + @State enterKey1: string = '' + @State subText2: string = '' + @State enterKey2: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + + build() { + Column() { + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0180_1') + .width(380) + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + event.keepEditableState(); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey1 = this.enterKeyTypeStr[index]; + } + } + this.subText1 = event.text; + console.log(`onSubmit>> subText=${this.subText1}`); + }) + Text('current EnterKeyType is:' + this.enterKey1+',\nsubmit text='+this.subText1) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + TextInput({ placeholder: 'input...' }) + .id('textInputKeepEditableState0180_2') + .width(380) + .margin({ top: 20, bottom: 10 }) + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey2 = this.enterKeyTypeStr[index]; + } + } + this.subText2 = event.text; + console.log(`onSubmit>> subText=${this.subText2}`); + }) + + Text('current EnterKeyType is:' + this.enterKey2+',\nsubmit text='+this.subText2) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0010.ets new file mode 100755 index 00000000..ec378ff0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0010.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle0010 { + @State message: string = '段落标题\\n正文第一段落开始0123456789正文第一段落结束.' + titleParagraphStyleAttr: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.Center }); + //第一段落首行缩进15vp + paragraphStyleAttr1: ParagraphStyle = new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + controller: TextController = new TextController(); + paragraphStyleString: StyledString = + new StyledString(this.message, + [ + { + start: 1, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.titleParagraphStyleAttr + }, + { + start: 5, + length: this.message.length, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: this.paragraphStyleAttr1 + } + ]); + + async onPageShow() { + this.controller.setStyledString(this.paragraphStyleString) + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + .width('100%') + .borderWidth(1) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0020.ets new file mode 100755 index 00000000..ade1a58b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0020.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle0020 { + // @State message: string = '段落标题\\n正文第一段落开始-maxLine=-10正文第一段落结束' + + // '\\n正文第二段落开始-maxLine=1正文第二段落结束\\n正文第三段落开始-maxLine=2正文第三段落结束\\n正文第四段落开始-maxLine=undefined正文第三段落结束.' + title: string = '段落标题' + string1: string = '\n正文第一段落开始-maxLine=-10正文第一段落结束' + string2: string = '\n正文第二段落开始-maxLine=1正文第二段落结束' + string3: string = '\n正文第三段落开始-maxLine=2正文第三段落结束' + string4: string = '\n正文第四段落开始-maxLine=undefined正文第三段落结束.' + @State message: string = this.title + this.string1 + this.string2 + this.string3 + this.string4 + titleParagraphStyleAttr: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.Center }); + //第一段落首行缩进15vp且maxLines: -10 + paragraphStyleAttr1: ParagraphStyle = new ParagraphStyle({ textIndent: LengthMetrics.vp(15), maxLines: -10 }); + //第二段落缩进15vp且maxLines: 1 + paragraphStyleAttr2: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.Start, maxLines: 1 }); + //第三段落 maxLines: 2 + paragraphStyleAttr3: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.End, maxLines: 2 }); + //第四段落 maxLines: undefined + paragraphStyleAttr4: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.End, maxLines: undefined }); + controller: TextController = new TextController(); + @State queryRes:string = 'Query the Paragraph result is:\n' + paragraphStyleString: StyledString = + new StyledString(this.message, + [ + { + start: 0, + length: this.title.length, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.titleParagraphStyleAttr + }, + { + start: this.title.length + 1, + length: this.title.length + this.string1.length, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr1 + }, + { + start: this.title.length + this.string1.length + 1, + length: this.title.length + this.string1.length + this.string2.length, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr2 + }, + { + start: this.title.length + this.string1.length + this.string2.length + 1, + length: this.title.length + this.string1.length + this.string2.length + this.string3.length, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr3 + }, + { + start: this.title.length + this.string1.length + this.string2.length + this.string3.length + 1, + length: this.message.length, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr4 + } + ]); + + async onPageShow() { + this.controller.setStyledString(this.paragraphStyleString) + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + .width('100%') + .borderWidth(1) + + //查询段落样式 + Button('Query').id('textStringParagraphStyle0020') + .onClick(() => { + let styles = this.paragraphStyleString.getStyles(0, this.paragraphStyleString.length); + console.info('paragraphStyledString style length:' + styles.length); + if (styles.length !== 0) { + for (let i = 0; i < styles.length; i++) { + console.info('paragraphStyledString style object start:' + styles[i].start); + console.info('paragraphStyledString style object length:' + styles[i].length); + console.info('paragraphStyledString style object key:' + styles[i].styledKey); + if (styles[i].styledKey === StyledStringKey.PARAGRAPH_STYLE) { + let paraAttr = styles[i].styledValue as ParagraphStyle;; + console.info('paragraphStyledString maxLines:' + paraAttr.maxLines); + this.queryRes += paraAttr.maxLines+"\n"; + } + } + } + }) + .margin({ top: 10 }) + + Text(this.queryRes).fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + .width('80%') + .borderWidth(1) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0010.ets new file mode 100755 index 00000000..c86976a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0010.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTransparency0010 { + @State text: string = 'Text:enabled(false)'; + @State start: number = 5; + @State end: number = 8; + + build() { + Column() { + Column() { + Text(this.text) + .margin(20) + .fontSize(16) + .enabled(false) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('textTransparency0010_1') + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0010_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0020.ets new file mode 100755 index 00000000..75a13f47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0020.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. + */ + +@Entry +@Component +struct UIComponentTextTransparency0020 { + @State text: string = 'Text:CopyOptions.None'; + @State start: number = 5; + @State end: number = 8; + + build() { + Column() { + Column() { + Text(this.text) + .margin(20) + .fontSize(16) + .draggable(true) + .copyOption(CopyOptions.None) + .id('textTransparency0020_1') + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0020_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0110.ets new file mode 100755 index 00000000..52d7da3f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0110.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTransparency0110 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'Search:test dragto TextInput testcase' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + + build() { + Column() { + Column() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .id('textTransparency0110_1') + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .draggable(true) + .margin(20) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0110_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0120.ets new file mode 100755 index 00000000..6ee0ba0c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0120.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 UIComponentTextTransparency0120 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = ' ' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + + build() { + Column() { + Column() { + Search({ + value: this.changeValue, placeholder: 'Type to search...', controller: this.controller + }) + .id('textTransparency0120_1') + .searchButton('SEARCH') + .width('100%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .draggable(true) + .margin(20) + .onDragEnd(() => { + console.log('onDragEnd>>>'); + this.controller.setTextSelection(0, this.changeValue.length); + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0120_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0130.ets new file mode 100755 index 00000000..d159788b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0130.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0130 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'Search:UIComponentTextTransparency0130' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + + build() { + Column() { + Column() { + Search({ + value: this.changeValue, placeholder: 'Type to search...', controller: this.controller + }) + .selectedBackgroundColor(Color.Blue) + .fontColor(Color.Blue) + .id('textTransparency0130_1') + .width('100%') + .height(40) + .textFont({ size: 14, weight: 400 }) + .draggable(true) + .margin(20) + Search({ + value: this.changeValue, placeholder: 'Type to search...', controller: this.controller + }) + .selectedBackgroundColor(Color.Green) + .fontColor(Color.Green) + .id('textTransparency0130_2') + .width('100%') + .height(40) + .textFont({ size: 14, weight: 400 }) + .draggable(true) + .margin(20) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0140.ets new file mode 100755 index 00000000..ce2ffc45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0140.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 text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0140 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'Search:UIComponentTextTransparency0140' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op:number = 1; + + build() { + Column() { + Column() { + Search({ + value: this.changeValue, placeholder: 'Type to search...', controller: this.controller + }) + .fontColor(Color.Blue) + .opacity(this.op) + .id('textTransparency0140_1') + .searchButton('SEARCH') + .width('85%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .draggable(true) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.op = 0; + }) + .onPreDrag(() => { + + }) + .onDragStart(() => { + + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0140_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0150.ets new file mode 100755 index 00000000..400d7a18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0150.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 text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0150 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'Search:UIComponentTextTransparency0150' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op:number = 1; + + build() { + Column() { + Column() { + Search({ + value: this.changeValue, placeholder: 'Type to search...', controller: this.controller + }) + .fontColor(Color.Blue) + .opacity(this.op) + .id('textTransparency0150_1') + .searchButton('SEARCH') + .width('100%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .draggable(true) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.op = 0.6; + }) + .onPreDrag(() => { + + }) + .onDragStart(() => { + + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0150_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0160.ets new file mode 100755 index 00000000..8643bc07 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0160.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0160 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextInput:UIComponentTextTransparency0160' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op:number = 1; + + build() { + Column() { + Column() { + TextInput({ + text: this.changeValue}) + .fontColor(Color.Blue) + .id('textTransparency0160_1') + .width('100%') + .height(40) + .backgroundColor('#F5F5F5') + .draggable(true) + .margin(20) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0160_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0170.ets new file mode 100755 index 00000000..9fadb4e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0170.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0170 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = ' ' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op:number = 1; + + build() { + Column() { + Column() { + TextInput({ + text: this.changeValue}) + .fontColor(Color.Blue) + .id('textTransparency0170_1') + .width('100%') + .height(40) + .backgroundColor('#F5F5F5') + .draggable(true) + .margin(20) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0170_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0180.ets new file mode 100755 index 00000000..7bdb39f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0180.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0180 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextInput:UIComponentTextTransparency0180' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextInput({ + text: this.changeValue + }) + .fontColor(Color.Yellow) + .id('textTransparency0180_1') + .width('100%') + .selectedBackgroundColor(Color.Blue) + .fontColor(Color.Blue) + .height(40) + .backgroundColor('#F5F5F5') + .draggable(true) + .margin(20) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .selectedBackgroundColor(Color.Green) + .fontColor(Color.Green) + .copyOption(CopyOptions.InApp) + .id('textTransparency0180_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0190.ets new file mode 100755 index 00000000..d44257f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0190.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0190 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextInput:UIComponentTextTransparency0190' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextInput({ + text: this.changeValue + }) + .opacity(this.op) + .fontColor(Color.Gray) + .id('textTransparency0190_1') + .width('100%') + .height(40) + .backgroundColor('#F5F5F5') + .draggable(true) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.op = 0; + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0190_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0200.ets new file mode 100755 index 00000000..9a038ede --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0200.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0200 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextInput:UIComponentTextTransparency0190' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextInput({ + text: this.changeValue + }) + .opacity(this.op) + .fontColor(Color.Gray) + .id('textTransparency0200_1') + .width('100%') + .height(40) + .backgroundColor('#F5F5F5') + .draggable(true) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.op = 0.6; + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0200_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0210.ets new file mode 100755 index 00000000..94c24108 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0210.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0210 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextInput:UIComponentTextTransparency0190' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextInput({ + text: this.changeValue + }) + .opacity(this.op) + .fontColor(Color.Gray) + .id('textTransparency0210_1') + .width('100%') + .height(40) + .backgroundColor('#F5F500') + .draggable(true) + .margin(20) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0210_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0220.ets new file mode 100755 index 00000000..c0e7a466 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0220.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0220 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextArea: UIComponentTextTransparency0220' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextArea({ + text: this.changeValue + }) + .fontColor(Color.Blue) + .id('textTransparency0220_1') + .width('100%') + .height(40) + .draggable(true) + .margin(20) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0220_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0230.ets new file mode 100755 index 00000000..263b8f58 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0230.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0230 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = ' ' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextArea({ + text: this.changeValue + }) + .fontColor(Color.Blue) + .id('textTransparency0230_1') + .width('100%') + .height(40) + .draggable(true) + .margin(20) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0230_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0240.ets new file mode 100755 index 00000000..b6dd40f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0240.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. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0240 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextArea: UIComponentTextTransparency0240' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextArea({ + text: this.changeValue + }) + .fontColor(Color.Green) + .id('textTransparency0240_1') + .width('100%') + .selectedBackgroundColor(Color.Blue) + .fontColor(Color.Blue) + .height(40) + .draggable(true) + .margin(20) + + TextArea({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .selectedBackgroundColor(Color.Green) + .fontColor(Color.Green) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0240_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0250.ets new file mode 100755 index 00000000..c11da91b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0250.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. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0250 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextArea: UIComponentTextTransparency0240' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextArea({ + text: this.changeValue + }) + .opacity(this.op) + .fontColor(Color.Brown) + .id('textTransparency0250_1') + .width('100%') + .height(40) + .draggable(true) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.op = 0; + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0250_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0260.ets new file mode 100755 index 00000000..eacdd468 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0260.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. + */ +import text from '@ohos.graphics.text'; + +@Entry +@Component +struct UIComponentTextTransparency0260 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'TextArea: UIComponentTextTransparency0260' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + TextArea({ + text: this.changeValue + }) + .opacity(this.op) + .fontColor(Color.Brown) + .id('textTransparency0260_1') + .width('100%') + .height(40) + .draggable(true) + .margin(20) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.op = 0.6; + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0260_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270.ets new file mode 100755 index 00000000..cbeedfb8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTextTransparency0270 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'Text: UIComponentTextTransparency0270 CopyOptions.InApp mouseDrag' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + + build() { + Column() { + Column() { + Text(this.changeValue) + .margin(20) + .fontSize(16) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('textTransparency0270_1') + .onPreDrag(() => { + console.log('0270 onPreDrag'); + return; + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textTransparency0270_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0311.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0311.ets new file mode 100755 index 00000000..ae183574 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0311.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 UIComponentTextTransparency0311 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'SR000UNOV' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + @State copyOption: number = CopyOptions.InApp; + + build() { + Column() { + Column() { + Text(this.changeValue) + .margin(20) + .fontSize(16) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('textTransparency0311_1') + .onPreDrag(() => { + console.log('0270 onPreDrag'); + return; + }) + + TextInput({ text: 'get drag result is :' }) + .width('100%') + .height('50') + .margin(40) + .draggable(true) + .fontSize(16) + .copyOption(this.copyOption) + .id('textTransparency0311_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + + Button('copyOption') + .id('textTransparency0311_btn') + .onClick(() => { + this.copyOption = CopyOptions.None; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0312.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0312.ets new file mode 100755 index 00000000..ebe1469d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0312.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 UIComponentTextTransparency0312 { + @State text: string = 'Search'; + @State start: number = 5; + @State end: number = 8; + @State changeValue: string = 'SR000UNOV' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + @State op: number = 1; + @State copyOption: number = CopyOptions.InApp; + @State inputType: number = InputType.Normal; + + build() { + Column() { + Column() { + Text(this.changeValue) + .margin(20) + .fontSize(16) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('textTransparency0312_1') + .onPreDrag(() => { + console.log('0270 onPreDrag'); + return; + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(40) + .type(this.inputType) + .draggable(true) + .fontSize(16) + .id('textTransparency0312_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + + Button('InputType') + .id('textTransparency0312_btn') + .onClick(() => { + this.inputType = InputType.Password; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface001.ets new file mode 100755 index 00000000..7186f066 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface001.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface001 { + @State text: string = '这是测试文本' + + @State inputType: number = InputType.Normal; + @State maxSize: number = -1; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .fontSize(15) + .key('UIComponentTypeUrlInterface001_textInput_001') + + Button('Password') + .visibility(this.button) + .onClick(() => { + this.inputType = InputType.Password; + this.button = Visibility.None; + }) + .key('UIComponentTypeUrlInterface001_button_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0010.ets new file mode 100755 index 00000000..ae1fe5a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0010.ets @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTypeUrlInterface0010 { + @State textValue: string = '' + + build() { + Column() { + Search({ value: 'www.' }).searchButton('SEARCH') + .type(SearchType.URL) + .key('UIComponentTypeUrlInterface0010_search_001') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0011.ets new file mode 100755 index 00000000..a68614f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0011.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SearchModifier } from '@ohos.arkui.modifier' + +class MySearchModifier implements AttributeModifier { + applyNormalAttribute(instance: SearchAttribute): void { + instance.type(SearchType.URL) + } +} +@Entry +@Component +struct UIComponentTypeUrlInterface0011 { + @State textValue: string = ''; + @State modifier: MySearchModifier = new MySearchModifier(); + + build() { + Column() { + Search({ value: 'www.' }).attributeModifier(this.modifier) + .key('UIComponentTypeUrlInterface0011_search_001') + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0012.ets new file mode 100755 index 00000000..687289e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0012.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface0012 { + controller: TextInputController = new TextInputController() + @State inputValue: string = "" + + // 自定义键盘组件 + @Builder + CustomKeyboardBuilder() { + Column() { + Button('x').onClick(() => { + // 关闭自定义键盘 + this.controller.stopEditing() + }) + Grid() { + ForEach([1, 2, 3, 4, 5, 6, 7, 8, 9, '*', 0, '#'], (item: number | string) => { + GridItem() { + Button(item + "") + .width(110).onClick(() => { + this.inputValue += item + }) + } + }) + }.maxCount(3).columnsGap(10).rowsGap(10).padding(5) + }.backgroundColor(Color.Gray) + } + + build() { + Column() { + TextInput({ controller: this.controller, text: '设置类型URL类型' }) + .type(InputType.URL) + .key('UIComponentTypeUrlInterface0012_textInput_001') + TextInput({ controller: this.controller, text: this.inputValue }) + .customKeyboard(this.CustomKeyboardBuilder()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .key('UIComponentTypeUrlInterface0012_textInput_002') + TextInput({ controller: this.controller, text: '未设置类型' }) + .key('UIComponentTypeUrlInterface0012_textInput_003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0013.ets new file mode 100755 index 00000000..3e2ea58d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0013.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface0013 { + @State placeholder: string = 'This is placeholder text' + + build() { + Row() { + Column() { + TextInput({ placeholder: this.placeholder }) + .type(InputType.URL) + .enablePreviewText(true) + .fontSize(20) + .key('UIComponentTypeUrlInterface0013_textInput_001') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface002.ets new file mode 100755 index 00000000..4bcd6ab6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface002.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface002 { + @State text: string = '这是测试文本,type=url,内联模式不生效' + + @State inputType: number = InputType.URL; + @State button: number = Visibility.Visible; + + build() { + Column() { + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .style(TextInputStyle.Inline) + .fontSize(15) + .key('UIComponentTypeUrlInterface002_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface003.ets new file mode 100755 index 00000000..c81905a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface003.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface003 { + @State text: string = 'wwww.baidu.com123' + + @State inputType: number = InputType.URL; + @State enterKey: number = EnterKeyType.Go; + + build() { + Column() { + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .fontSize(15) + .enterKeyType(this.enterKey) + .key('UIComponentTypeUrlInterface003_textInput_001') + + Button('Search') + .onClick(() => { + this.enterKey = EnterKeyType.Search; + }) + .key('UIComponentTypeUrlInterface003_button_001') + + Button('Send') + .onClick(() => { + this.enterKey = EnterKeyType.Send; + }) + .key('UIComponentTypeUrlInterface003_button_002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface004.ets new file mode 100755 index 00000000..261e8e97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface004.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UIComponentTypeUrlInterface004 { + @State text: string = 'wwww.baidu.com123' + + @State inputType: number = InputType.URL; + @State enterKey: number = EnterKeyType.Go; + + build() { + Column() { + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .fontSize(15) + .inputFilter('[0-9]') + .enterKeyType(this.enterKey) + .key('UIComponentTypeUrlInterface004_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface005.ets new file mode 100755 index 00000000..d35cbcfa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface005.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface005 { + @State text: string = 'wwww.baidu.com123' + @State inputType: number = InputType.URL; + @State enterKey: number = EnterKeyType.Go; + + build() { + Column() { + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .decoration({ type: TextDecorationType.Underline, color: Color.Red }) + .fontSize(15) + .enterKeyType(this.enterKey) + .key('UIComponentTypeUrlInterface005_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface006.ets new file mode 100755 index 00000000..c4ddf3db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface006.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface006 { + @State text: string = 'wwww.baidu.com123' + @State inputType: number = InputType.URL; + @State enterKey: number = EnterKeyType.Go; + + build() { + Column() { + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .showUnderline(true) + .fontSize(15) + .enterKeyType(this.enterKey) + .key('UIComponentTypeUrlInterface006_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface007.ets new file mode 100755 index 00000000..7d5dc04a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface007.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface007 { + @State text: string = 'wwww.baidu.com123' + @State inputType: number = InputType.URL; + @State log: string = ''; + + build() { + Column() { + Text(this.log) + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .showUnderline(true) + .fontSize(15) + .onChange((value: string, previewText?: PreviewText) => { + this.log = 'onChange log : ' + value; + }) + .key('UIComponentTypeUrlInterface007_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface008.ets new file mode 100755 index 00000000..e5e94743 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface008.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTypeUrlInterface008 { + @State text: string = 'wwww.baidu.com123' + @State inputType: number = InputType.URL; + @State log: string = ''; + + build() { + Column() { + Text().height('90%') + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .type(this.inputType) + .showUnderline(true) + .fontSize(15) + .onChange((value: string, previewText?: PreviewText) => { + this.log = 'onChange log : ' + value; + }) + .key('UIComponentTypeUrlInterface008_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface009.ets new file mode 100755 index 00000000..8789653c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface009.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. + */ + +@CustomDialog +struct CustomDialogExample { + @Link textValue: string + @Link inputValue: string + controller?: CustomDialogController + + build() { + Column() { + Text('Change text').fontSize(20).margin({ top: 10 }) + TextInput({ placeholder: '', text: this.textValue }) + .height(60) + .width('90%') + .onChange((value: string) => { + this.textValue = value + }) + .margin(10) + .key('UIComponentTypeUrlInterface009_textInput_001') + }.borderRadius(10) + } +} + +@Entry +@Component +struct UIComponentTypeUrlInterface009 { + @State textValue: string = '' + @State inputValue: string = 'click me' + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + textValue: $textValue, + inputValue: $inputValue + }), + cancel: this.exitApp, + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + customStyle: false, + cornerRadius: 10, + }) + + aboutToDisappear() { + this.dialogController = null + } + + onCancel() { + console.info('Callback when the first button is clicked') + } + + onAccept() { + console.info('Callback when the second button is clicked') + } + + exitApp() { + console.info('Click the callback in the blank area') + } + + build() { + Column() { + Button(this.inputValue) + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }).backgroundColor(0x317aff).key('UIComponentTypeUrlInterface009_button_001') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface001.ets new file mode 100755 index 00000000..f7b0c2e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface001.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. + */ + +import uiAppearance from '@ohos.uiAppearance' + +@Entry +@Component +struct UIComponentUISupportColorInterface001 { + @State text: string = 'This is test text. -- TextArea' + @State textInput: string = 'This is test text. -- TextInput' + + build() { + Row() { + Column() { + TextInput({ text: this.textInput }) + TextArea({ text: this.text }) + .height(100) + .fontSize(20) + .margin({ top: 20 }) + .key('UIComponentUISupportColorInterface001_textArea_001') + Button('change color').onClick(() => { + uiAppearance.setDarkMode(uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_LIGHT ? + uiAppearance.DarkMode.ALWAYS_LIGHT : uiAppearance.DarkMode.ALWAYS_LIGHT, (error) => { + if (error) { + console.error('Set dark-mode failed, ' + error.message); + } else { + console.info('Set dark-mode successfully.'); + } + let isDark = uiAppearance.getDarkMode() + console.info('Set dark-mode successfully. and is : ' + isDark); + }) + }).key('UIComponentUISupportColorInterface001_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface002.ets new file mode 100755 index 00000000..f292a21f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface002.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. + */ + +import uiAppearance from '@ohos.uiAppearance' + +@Entry +@Component +struct UIComponentUISupportColorInterface002 { + @State text: string = 'This is test text.' + @State textInput: string = 'This is test text. -- TextInput' + + build() { + Row() { + Column() { + TextInput({ text: this.textInput }) + TextArea({ text: this.text }) + .fontSize(20) + .margin({ top: 20 }) + .key('UIComponentUISupportColorInterface002_textArea_001') + Button('change color').onClick(() => { + uiAppearance.setDarkMode(uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_LIGHT ? + uiAppearance.DarkMode.ALWAYS_DARK : uiAppearance.DarkMode.ALWAYS_LIGHT, (error) => { + if (error) { + console.error('Set dark-mode failed, ' + error.message); + } else { + console.info('Set dark-mode successfully.'); + } + let isDark = uiAppearance.getDarkMode() + console.info('Set dark-mode successfully. and is : ' + isDark); + }) + }).key('UIComponentUISupportColorInterface002_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface003.ets new file mode 100755 index 00000000..15c211c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface003.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. + */ + +import uiAppearance from '@ohos.uiAppearance' + +@Entry +@Component +struct UIComponentUISupportColorInterface003 { + @State text: string = 'This is test text.' + @State textInput: string = 'This is test text. -- TextInput' + + build() { + Row() { + Column() { + TextInput({ text: this.textInput }) + TextArea({ text: this.text }) + .fontSize(20) + .margin({ top: 20 }) + .key('UIComponentUISupportColorInterface003_textArea_001') + Button('change color').onClick(() => { + uiAppearance.setDarkMode(uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK ? + uiAppearance.DarkMode.ALWAYS_LIGHT : uiAppearance.DarkMode.ALWAYS_DARK, (error) => { + if (error) { + console.error('Set dark-mode failed, ' + error.message); + } else { + console.info('Set dark-mode successfully.'); + } + let isDark = uiAppearance.getDarkMode() + console.info('Set dark-mode successfully. and is : ' + isDark); + }) + }).key('UIComponentUISupportColorInterface003_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface004.ets new file mode 100755 index 00000000..34974db7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface004.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. + */ + +import uiAppearance from '@ohos.uiAppearance' + +@Entry +@Component +struct UIComponentUISupportColorInterface004 { + @State text: string = 'This is test text.' + @State textInput: string = 'This is test text. -- TextInput' + + build() { + Row() { + Column() { + TextInput({ text: this.textInput }) + TextArea({ text: this.text }) + .fontSize(20) + .margin({ top: 20 }) + .key('UIComponentUISupportColorInterface004_textArea_001') + Button('change color').onClick(() => { + uiAppearance.setDarkMode(uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK ? + uiAppearance.DarkMode.ALWAYS_DARK : uiAppearance.DarkMode.ALWAYS_DARK, (error) => { + if (error) { + console.error('Set dark-mode failed, ' + error.message); + } else { + console.info('Set dark-mode successfully.'); + } + let isDark = uiAppearance.getDarkMode() + console.info('Set dark-mode successfully. and is : ' + isDark); + }) + }).key('UIComponentUISupportColorInterface004_button_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005.ets new file mode 100755 index 00000000..cb48229e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005.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 UIComponentUISupportColorInterface005 { + @State text: string = 'This is test text.'; + @State themeColor: number = ThemeColorMode.LIGHT; + @State index: number = 0; + + build() { + Row() { + WithTheme({ colorMode: this.themeColor }) { + Column() { + TextArea({ text: this.text }) + .fontSize(40) + Text('text') + .fontSize(40) + .fontWeight(FontWeight.Bold) + } + .justifyContent(FlexAlign.Center) + .width('70%') + .height('33%') + .backgroundColor($r('sys.color.background_primary')) + } + + WithTheme({ colorMode: this.themeColor }) { + Column() { + Button('change ThemeColor').fontSize(20).onClick(() => { + this.index = this.index + 1; + if (this.index == 1) { + this.themeColor = ThemeColorMode.LIGHT; + } else if (this.index == 2) { + this.themeColor = ThemeColorMode.DARK; + } else if (this.index == 3) { + this.themeColor = ThemeColorMode.SYSTEM; + this.index = 0; + } + + }).key('UIComponentUISupportColorInterface005_button_001') + } + .justifyContent(FlexAlign.Center) + .width('30%') + .height('33%') + } + + Column() { + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006.ets new file mode 100755 index 00000000..6588cd5c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006.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 UIComponentUISupportColorInterface006 { + @State text: string = 'This is test text.'; + @State themeColor: number = ThemeColorMode.LIGHT; + @State index: number = 0; + + build() { + Row() { + WithTheme({ colorMode: this.themeColor }) { + Column() { + TextInput({ text: this.text }) + .fontSize(40) + Text('text') + .fontSize(40) + .fontWeight(FontWeight.Bold) + } + .justifyContent(FlexAlign.Center) + .width('70%') + .height('33%') + .backgroundColor($r('sys.color.background_primary')) + } + + WithTheme({ colorMode: this.themeColor }) { + Column() { + Button('change ThemeColor').fontSize(20).onClick(() => { + this.index = this.index + 1; + if (this.index == 1) { + this.themeColor = ThemeColorMode.LIGHT; + } else if (this.index == 2) { + this.themeColor = ThemeColorMode.DARK; + } else if (this.index == 3) { + this.themeColor = ThemeColorMode.SYSTEM; + this.index = 0; + } + + }).key('UIComponentUISupportColorInterface006_button_001') + } + .justifyContent(FlexAlign.Center) + .width('30%') + .height('33%') + } + + Column() { + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0010.ets new file mode 100755 index 00000000..8f7f2883 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0010.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0010 { + @State msg: string = '1测试数据12ZXC、! 2测试数据12ZXC、!'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0010') + Text(this.msg) + .width('100%') + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .height(60) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = ' ZZZ1! XXX2!'; + this.start = 6; + this.end = 12; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0020.ets new file mode 100755 index 00000000..826694d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0020.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0020 { + @State msg: string = '1测试数据12ZXC、! 2测试数据12ZXC、!'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0020') + Text(this.msg) + .width('100%') + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .height(60) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = ' ZZZ1! XXX2!'; + this.start = 1; + this.end = 4; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0030.ets new file mode 100755 index 00000000..2c37691c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0030.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0030 { + @State msg: string = '1测试数据12ZXC、! 2测试数据12ZXC、!'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0030') + Text(this.msg) + .width('100%') + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .height(60) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = ' ZZZ1! XXX2!'; + this.start = 7; + this.end = 8; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0040.ets new file mode 100755 index 00000000..d893c013 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0040.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0040 { + @State msg: string = '1测试数据12ZXC、! 2测试数据12ZXC、!'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0040') + Text(this.msg) + .width('100%') + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .height(60) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = ' ZZZ1! XXX2!'; + this.start = 0; + this.end = 0; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0050.ets new file mode 100755 index 00000000..948ece08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0050.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0050 { + @State msg: string = '1测试数据12ZXC、! 2测试数据12ZXC、!'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0050') + Text(this.msg) + .width('100%') + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .height(60) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = ' ZZZ1! XXX2!'; + this.start = 1; + this.end = 13; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0060.ets new file mode 100755 index 00000000..b3f04cf0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0060.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UICustomTextShortCutKeyReplacement0060 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0060') + Text('123') { + ImageSpan('cat.jpg') + .width(57) + .height(57) + } + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .width('100%') + .height(60) + + Button('changeText') + .id('changeText') + .onClick(() => { + this.start =0; + this.end = 1; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0070.ets new file mode 100755 index 00000000..9bc76a96 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0070.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 UICustomTextShortCutKeyReplacement0070 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0070') + Text('123') { + ImageSpan('cat.jpg') + .width(57) + .height(57) + ImageSpan('cat.jpg') + .width(57) + .height(57) + ImageSpan('cat.jpg') + .width(57) + .height(57) + ImageSpan('cat.jpg') + .width(57) + .height(57) + } + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .width('100%') + .height(60) + + Button('changeText') + .id('changeText') + .onClick(() => { + this.start = 0; + this.end = 3; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0080.ets new file mode 100755 index 00000000..4a43066c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0080.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 UICustomTextShortCutKeyReplacement0080 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0080') + Text('123') { + Span('测试数据123zxc!@') + ImageSpan('cat.jpg') + .width(57) + .height(57) + } + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .width('100%') + .height(60) + + Button('changeText') + .id('changeText') + .onClick(() => { + this.start = 0; + this.end = 7; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090.ets new file mode 100755 index 00000000..9b1dfb89 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090.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 UICustomTextShortCutKeyReplacement0090 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0090') + Text('123') { + Span(' 测试78KKK! 90测试QQQ@') + } + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .width('100%') + .height(60) + + Button('changeText') + .id('changeText') + .onClick(() => { + this.start = 10; + this.end = 18; + }) + Button('changeText1') + .id('changeText1') + .onClick(() => { + this.start = 2; + this.end = 7; + }) + Button('changeText2') + .id('changeText2') + .onClick(() => { + this.start = 2; + this.end = 3; + }) + Button('changeText3') + .id('changeText3') + .onClick(() => { + this.start = 0; + this.end = 0; + }) + Button('changeText4') + .id('changeText4') + .onClick(() => { + this.start = 1; + this.end = 18; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0140.ets new file mode 100755 index 00000000..4f96a51b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0140.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 UICustomTextShortCutKeyReplacement0140 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0; + @State end: number = 0; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + }) + .id('UICustomTextShortCutKeyReplacement0140') + Text('123') { + Span('测试12zx! ') + ImageSpan('cat.jpg') + .width(57) + .height(57) + } + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .width('100%') + .height(60) + + Button('changeText') + .id('changeText') + .onClick(() => { + this.start =0; + this.end = 9; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface001.ets new file mode 100755 index 00000000..4968e562 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface001.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UISearchInterface001 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + Search({ placeholder: this.text }) + .width(336) + .height(56) + .copyOption(CopyOptions.InApp) + .onCopy((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .margin({ top: 20 }) + .key('UISearchInterface001_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface002.ets new file mode 100755 index 00000000..7fc132b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface002.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UISearchInterface002 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + Search({ placeholder: this.text }) + .width(336) + .height(56) + .copyOption(CopyOptions.LocalDevice) + .onCopy((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .margin({ top: 20 }) + .key('UISearchInterface002_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface003.ets new file mode 100755 index 00000000..5810ee3b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface003.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UISearchInterface003 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + Search({ placeholder: this.text }) + .width(336) + .height(56) + .copyOption(CopyOptions.LocalDevice) + .onCut((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .margin({ top: 20 }) + .key('UISearchInterface003_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface004.ets new file mode 100755 index 00000000..3f6623cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface004.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 UISearchInterface004 { + @State text: string = '这是提示文本' + @State pasteValue: string = '复制此Text内容去粘贴' + + build() { + Row() { + Column() { + Text(this.pasteValue) + .copyOption(CopyOptions.LocalDevice) + .onCopy((value: string) =>{ + console.info('UISearchInterface004 onCopy successful and value is ' + value); + }) + .fontSize(20) + .fontColor(Color.Black) + .margin({ top: 20 }) + .key('UISearchInterface004_text_001') + Search({ placeholder: this.text}) + .width(336) + .height(56) + .copyOption(CopyOptions.LocalDevice) + .onPaste((value: string, event: PasteEvent) => { + console.info('UISearchInterface004 onPaste successful and value is ' + value); + }) + .margin({ top: 20 }) + .key('UISearchInterface004_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface005.ets new file mode 100755 index 00000000..0c59757e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface005.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UISearchInterface005 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + Search({ placeholder: this.text}) + .width(336) + .height(56) + .copyOption(CopyOptions.None) + .margin({ top: 20 }) + .key('UISearchInterface005_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface006.ets new file mode 100755 index 00000000..2b5634a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface006.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UISearchInterface006 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + Search({ placeholder: this.text}) + .width(336) + .height(56) + .copyOption(CopyOptions.LocalDevice) + .margin({ top: 20 }) + .key('UISearchInterface006_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface001.ets new file mode 100755 index 00000000..f9de98f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface001.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UITextAreaInterface001 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + TextArea({ placeholder: this.text }) + .width('100%') + .height(100) + .copyOption(CopyOptions.InApp) + .onCopy((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .margin({ top: 20 }) + .key('UITextAreaInterface001_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface002.ets new file mode 100755 index 00000000..d7ecfc1f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface002.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UITextAreaInterface002 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + TextArea({ placeholder: this.text }) + .width('100%') + .height(100) + .copyOption(CopyOptions.LocalDevice) + .onCopy((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .margin({ top: 20 }) + .key('UITextAreaInterface002_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface003.ets new file mode 100755 index 00000000..efa5aaac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface003.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UITextAreaInterface003 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + TextArea({ placeholder: this.text }) + .width('100%') + .height(100) + .copyOption(CopyOptions.LocalDevice) + .onCut((value: string) => { + promptAction.showToast({ + message: value, + duration: 2000, + }) + }) + .margin({ top: 20 }) + .key('UITextAreaInterface003_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface004.ets new file mode 100755 index 00000000..2817074a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface004.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UITextAreaInterface004 { + @State text: string = '这是提示文本' + @State pasteValue: string = '复制此Text内容去粘贴' + + build() { + Row() { + Column() { + Text(this.pasteValue) + .copyOption(CopyOptions.LocalDevice) + .onCopy((value: string) => { + console.info('UITextAreaInterface004 onCopy successful and value is ' + value); + }) + .fontSize(20) + .fontColor(Color.Black) + .margin({ top: 20 }) + .key('UITextAreaInterface004_text_001') + TextArea({ placeholder: this.text }) + .width('100%') + .height(100) + .copyOption(CopyOptions.LocalDevice) + .onPaste((value: string, event: PasteEvent) => { + console.info('UITextAreaInterface004 onPaste successful and value is ' + value); + }) + .margin({ top: 20 }) + .key('UITextAreaInterface004_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface005.ets new file mode 100755 index 00000000..b512feb5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextAreaInterface/UITextAreaInterface005.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextAreaInterface005 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + TextArea({ placeholder: this.text}) + .width('100%') + .height(100) + .copyOption(CopyOptions.None) + .margin({ top: 20 }) + .key('UITextAreaInterface005_001') + } + .width('100%') + .height('100%') + } + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001.ets new file mode 100755 index 00000000..ac62127f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001.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 UITextBoxDisablePasteInterface001 { + @State text: string = 'This is test text.'; + @State placeholder: string = 'This is placeholder text.'; + + build() { + Row() { + Column() { + Text(this.text).copyOption(CopyOptions.InApp) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface001_text_001') + TextInput({ placeholder: this.placeholder }) + .fontSize(20) + .draggable(true) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface001_textInput_001') + TextInput({ placeholder: this.placeholder + ' disable paste' }) + .draggable(true) + .onPaste((content: string, event: PasteEvent) => { + event.preventDefault!(); + console.log('禁止粘贴'); + }) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface001_textInput_002') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002.ets new file mode 100755 index 00000000..9c7f02f7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002.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 UITextBoxDisablePasteInterface002 { + @State text: string = 'This is test text.'; + @State placeholder: string = 'This is placeholder text.'; + + build() { + Row() { + Column() { + Text(this.text).copyOption(CopyOptions.InApp) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface002_text_001') + TextArea({ placeholder: this.placeholder }) + .fontSize(20) + .draggable(true) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface002_textArea_001') + TextArea({ placeholder: this.placeholder + ' disable paste' }) + .draggable(true) + .onPaste((content: string, event: PasteEvent) => { + event.preventDefault!(); + console.log('禁止粘贴'); + }) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface002_textArea_002') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003.ets new file mode 100755 index 00000000..686cc3a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003.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. + */ + + +@Entry +@Component +struct UITextBoxDisablePasteInterface003 { + @State text: string = 'This is test text.'; + @State placeholder: string = 'This is placeholder text.'; + + build() { + Row() { + Column() { + Text(this.text).copyOption(CopyOptions.InApp) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface003_text_001') + Search({ placeholder: this.placeholder }) + .margin({ top: 20 }) + .draggable(true) + .key('UITextBoxDisablePasteInterface003_search_001') + Search({ placeholder: this.placeholder + ' disable paste' }) + .draggable(true) + .onPaste((content: string, event: PasteEvent) => { + event.preventDefault!(); + console.log('禁止粘贴'); + }) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface003_search_002') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004.ets new file mode 100755 index 00000000..7e000ef8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextBoxDisablePasteInterface004 { + @State text: string = 'This is test text.'; + @State placeholder: string = 'This is placeholder text.'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + controller1: RichEditorController = new RichEditorController(); + options1: RichEditorOptions = { controller: this.controller1 }; + + build() { + Row() { + Column() { + Text(this.text).copyOption(CopyOptions.InApp) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface004_text_001') + RichEditor(this.options) + .margin({ top: 20 }) + .draggable(true) + .key('UITextBoxDisablePasteInterface004_richEditor_001') + RichEditor(this.options1) + .draggable(true) + .onPaste((event: PasteEvent) => { + event.preventDefault!(); + console.log('禁止粘贴'); + }) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface004_richEditor_002') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface005.ets new file mode 100755 index 00000000..c715cbd2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface005.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextBoxDisablePasteInterface005 { + @State textEnable: string = 'This is test text.This is test text.'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + controllerTwo: RichEditorController = new RichEditorController(); + optionsTwo: RichEditorOptions = { controller: this.controllerTwo }; + + build() { + Row() { + Column() { + Text() { + Span(this.textEnable) + ImageSpan('testability/resources/icon.png').width(40).height(40) + } + .copyOption(CopyOptions.InApp) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface005_text_001') + + RichEditor(this.options) + .margin({ top: 20 }) + .draggable(true) + .copyOptions(CopyOptions.InApp) + .key('UITextBoxDisablePasteInterface005_richEditor_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface006.ets new file mode 100755 index 00000000..90d4fa1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface006.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextBoxDisablePasteInterface006 { + @State text: string = 'This is test text. disable paste'; + controllerTwo: RichEditorController = new RichEditorController(); + optionsTwo: RichEditorOptions = { controller: this.controllerTwo }; + + build() { + Row() { + Column() { + Text() { + Span(this.text) + ImageSpan('testability/resources/icon.png').width(40).height(40) + } + .copyOption(CopyOptions.InApp) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface006_text_001') + + RichEditor(this.optionsTwo) + .onPaste((event: PasteEvent) => { + event.preventDefault!(); + console.log('禁止粘贴'); + }) + .margin({ top: 20 }).key('UITextBoxDisablePasteInterface006_richEditor_001') + + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface007.ets new file mode 100755 index 00000000..e4ce645a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface007.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextBoxDisablePasteInterface007 { + @State textEnable: string = 'This is test text.This is test text.'; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + controllerTwo: RichEditorController = new RichEditorController(); + optionsTwo: RichEditorOptions = { controller: this.controllerTwo }; + + build() { + Row() { + Column() { + TextInput({ text: this.textEnable }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .margin({ top: 20 }) + .key('UITextBoxDisablePasteInterface007_textInput_001') + + RichEditor(this.options) + .margin({ top: 20 }) + .draggable(true) + .copyOptions(CopyOptions.InApp) + .key('UITextBoxDisablePasteInterface007_richEditor_001') + RichEditor(this.optionsTwo) + .onPaste((event: PasteEvent) => { + event.preventDefault!(); + console.log('禁止粘贴'); + }) + .margin({ top: 20 }).key('UITextBoxDisablePasteInterface007_richEditor_002') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface001.ets new file mode 100755 index 00000000..c93b21fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface001.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 UITextInputInterface001 { + @State text: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State startPotion: number = 0 + @State endPotion: number = this.startPotion + 20 + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .selectionMenuHidden(false) + .caretColor(Color.Blue) + .focusable(true) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .key('UITextInputInterface001_001') + Button('Select Text Button') + .margin(15) + .onClick(() => { + let options: SelectionOptions = { + menuPolicy: MenuPolicy.SHOW + } + this.controller.setTextSelection(this.startPotion, this.endPotion, options) + this.endPotion = this.endPotion + 20 + }).key('UITextInputInterface001_button_001') + }.width('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0010.ets new file mode 100755 index 00000000..47930d54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0010.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0010 { + controller = new TextInputController(); + @State text: string = 'This is the input text. Long press to display the selection.This is the input text. Long press to display the selection.'; + @State isScrollNext: boolean = false; + @State textSize: number = 15; + + build() { + Row() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .placeholderColor(Color.Grey) + .margin(15) + .fontSize(this.textSize) + .fontColor(Color.Black) + .onClick(() => { + this.controller.caretPosition(this.text.length - 1); + }) + .key('UITextInputInterface0010_textInput_001') + + Button('change Size').onClick(() => { + this.controller.caretPosition(0) + this.textSize = 25 + }).key('UITextInputInterface0010_button_001') + }.width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0011.ets new file mode 100755 index 00000000..31d9615e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0011.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0011 { + @State text: string = 'This is the input text'; + @State isScrollNext: boolean = false; + @State textSize: number = 15; + + build() { + Row() { + Column() { + TextInput({ text: this.text }) + .placeholderColor(Color.Grey) + .margin(15) + .fontSize(this.textSize) + .fontColor(Color.Black) + .key('UITextInputInterface0011_textInput_001') + }.width('50%') + + Column() { + TextInput({ text: this.text }) + .placeholderColor(Color.Grey) + .margin(15) + .fontSize(this.textSize) + .fontColor(Color.Black) + .key('UITextInputInterface0011_textInput_002') + }.width('50%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0012.ets new file mode 100755 index 00000000..6ee8afe8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0012.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0012 { + @State text: string = 'This is the input"" text'; + @State textSize: number = 15; + controller = new TextInputController(); + + build() { + Row() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .placeholderColor(Color.Grey) + .margin(15) + .fontSize(this.textSize) + .fontColor(Color.Black) + .onClick(() => { + this.controller.caretPosition(this.text.indexOf('"') + 1) + }) + .key('UITextInputInterface0012_textInput_001') + }.width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0013.ets new file mode 100755 index 00000000..f4b2687e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0013.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0013 { + @State text: string = 'This is the input text'; + @State textSize: number = 15; + + build() { + Row() { + Column() { + TextInput({ text: this.text }) + .placeholderColor(Color.Grey) + .margin(15) + .fontSize(this.textSize) + .fontColor(Color.Black) + .key('UITextInputInterface0013_textInput_001') + }.width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0014.ets new file mode 100755 index 00000000..e80f0de4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0014.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0014 { + @State placeholder: string = 'This is the input text'; + @State potion: number = 0; + controller = new TextInputController(); + + build() { + Row() { + Column() { + TextInput({ placeholder: this.placeholder, controller: this.controller }) + .placeholderColor(Color.Grey) + .margin(15) + .fontSize(20) + .fontColor(Color.Black) + .key('UITextInputInterface0014_textInput_001') + }.width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0015.ets new file mode 100755 index 00000000..60174b50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0015.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UITextInputInterface0015 { + @State placeholder: string = 'This is the input text'; + + build() { + Row() { + Column() { + TextInput({ placeholder: this.placeholder }) + .onTouch(() => { + promptAction.showToast({ + message: 'onTouch', + duration: 1000 + }) + }) + .fontSize(30) + .placeholderColor(Color.Grey) + .fontColor(Color.Black) + .key('UITextInputInterface0015_textInput_001') + }.border({ width: 1, color: Color.Red }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0016.ets new file mode 100755 index 00000000..a34fe642 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0016.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0016 { + @State placeholder: string = 'This is the input text'; + @State log: string = 'This is log: '; + + build() { + Row() { + Column() { + Text(this.log) + TextInput({ placeholder: this.placeholder }) + .onChange(() => { + this.log = this.log + ' onchange!!!' + }) + .onTextSelectionChange(() => { + this.log = this.log + ' onTextSelectionChange!!!' + }) + .fontSize(30) + .placeholderColor(Color.Grey) + .fontColor(Color.Black) + .key('UITextInputInterface0016_textInput_001') + }.width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0017.ets new file mode 100755 index 00000000..7e50ebf6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0017.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0017 { + @State placeholder: string = 'This is the placeholder text.' + + build() { + Scroll() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .margin(40) + .key('UITextInputInterface0017_textInput_001') + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .margin(40) + .key('UITextInputInterface0017_textInput_002') + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .margin(40) + .key('UITextInputInterface0017_textInput_003') + }.height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0018.ets new file mode 100755 index 00000000..34853909 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0018.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. + */ + +@Entry +@Component +struct UITextInputInterface0018 { + @State placeholder: string = 'This is the placeholder text.' + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .enableKeyboardOnFocus(true) + .margin(10) + .key('UITextInputInterface0018_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0019.ets new file mode 100755 index 00000000..ec160635 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0019.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. + */ + +@Entry +@Component +struct UITextInputInterface0019 { + controller: TextInputController = new TextInputController(); + @State text: string = 'This is the test text.This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .fontColor(Color.Black) + .margin(10) + .key('UITextInputInterface0019_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface002.ets new file mode 100755 index 00000000..fc8005dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface002.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. + */ +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UITextInputInterface002 { + @State text: string = 'This is the placeholder prompt text, cannot be copied.' + @State message: string = 'The prompt text cannot be selected.' + + build() { + Column() { + TextInput({ placeholder: this.text }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(20) + .fontColor(Color.Black) + .onClick(() => { + promptAction.showToast({ + message: 'TextInput: ' + this.message, + duration: 2000, + }) + }) + .key('UITextInputInterface002_textInput_001') + + TextArea({ placeholder: this.text }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .height(100) + .margin(20) + .fontColor(Color.Black) + .onClick(() => { + promptAction.showToast({ + message: 'TextArea: ' + this.message, + duration: 2000, + }) + }) + .key('UITextInputInterface002_textArea_001') + + Search({ placeholder: this.text }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(20) + .fontColor(Color.Black) + .onClick(() => { + promptAction.showToast({ + message: 'Search: ' + this.message, + duration: 2000, + }) + }) + .key('UITextInputInterface002_search_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0020.ets new file mode 100755 index 00000000..c487e35e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0020.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0020 { + @State placeholder: string = 'This is the placeholder text.'; + @State mode: number = InputType.Normal; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .type(this.mode) + .onClick(() => { + this.mode = InputType.Password + }) + .margin(10) + .key('UITextInputInterface0020_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0021.ets new file mode 100755 index 00000000..e27033f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0021.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0021 { + @State placeholder: string = 'This is the placeholder text.'; + @State mode: number = InputType.Normal; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .inputFilter('[A-Z]', (value: string) => { + console.log('not show string: ' + value) + }) + .margin(10) + .key('UITextInputInterface0021_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0022.ets new file mode 100755 index 00000000..8a69a7b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0022.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. + */ + +@Entry +@Component +struct UITextInputInterface0022 { + @State placeholder: string = 'This is the placeholder text.'; + @State mode: number = InputType.Normal; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .margin(10) + .key('UITextInputInterface0022_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0023.ets new file mode 100755 index 00000000..d5ba4e33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0023.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0023 { + @State placeholder: string = 'This is the placeholder text.'; + @State maxLength: number = 15; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .maxLength(this.maxLength) + .margin(10) + .key('UITextInputInterface0023_textInput_001') + Button('change MaxLength').onClick(() => { + this.maxLength = 30 + }).key('UITextInputInterface0023_button_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0024.ets new file mode 100755 index 00000000..18817520 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0024.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0024 { + @State placeholder: string = 'This is the placeholder text.'; + @State maxLength: number = 30; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .maxLength(this.maxLength) + .margin(10) + .key('UITextInputInterface0024_textInput_001') + Button('change MaxLength').onClick(() => { + this.maxLength = 15 + }).key('UITextInputInterface0024_button_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0025.ets new file mode 100755 index 00000000..6d80106a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0025.ets @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0025 { + @State placeholder: string = 'This is the placeholder text.'; + @State maxLength: number = 9; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .maxLength(this.maxLength) + .margin(10) + .key('UITextInputInterface0025_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0026.ets new file mode 100755 index 00000000..6ecba713 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0026.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0026 { + @State text: string = 'This is the test text.'; + @State maxLength: number = 9; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .fontColor(Color.Black) + .margin(10) + .key('UITextInputInterface0026_textInput_001') + Button('change caretPosition').onClick(() => { + this.controller.caretPosition(-1); + }).key('UITextInputInterface0026_button_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0027.ets new file mode 100755 index 00000000..c85fea13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0027.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0027 { + @State text: string = 'This is the test text.'; + @State maxLength: number = 9; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .fontColor(Color.Black) + .margin(10) + .key('UITextInputInterface0027_textInput_001') + Button('change caretPosition').onClick(() => { + this.controller.caretPosition(0); + }).key('UITextInputInterface0027_button_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0028.ets new file mode 100755 index 00000000..0e232f9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0028.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0028 { + @State text: string = 'This is the test text.'; + @State maxLength: number = 9; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .fontColor(Color.Black) + .margin(10) + .key('UITextInputInterface0028_textInput_001') + Button('change caretPosition').onClick(() => { + this.controller.caretPosition(8); + }).key('UITextInputInterface0028_button_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0029.ets new file mode 100755 index 00000000..07614acc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0029.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0029 { + @State text: string = 'This is the test text.'; + @State maxLength: number = 9; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .fontColor(Color.Black) + .onClick(() => { + this.controller.caretPosition(3); + }) + .caretColor(Color.Pink) + .margin(10) + .key('UITextInputInterface0029_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface003.ets new file mode 100755 index 00000000..4fe80966 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface003.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 promptAction from '@ohos.promptAction' + +@Entry +@Component +struct UITextInputInterface003 { + @State text: string = 'This is the placeholder prompt text, cannot be copied.' + @State message: string = 'The prompt text cannot be selected.' + controller: TextInputController = new TextInputController() + controllerArea: TextInputController = new TextInputController() + controllerSearch: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(10) + .fontColor(Color.Black) + .key('UITextInputInterface003_textInput_001') + + TextArea({ text: this.text, controller: this.controllerArea }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .height(100) + .margin(10) + .fontColor(Color.Black) + .key('UITextInputInterface003_textArea_001') + + Search({ value: this.text, controller: this.controllerSearch }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(10) + .fontColor(Color.Black) + .key('UITextInputInterface003_search_001') + + Button('Switch MenuPolicy type to HIDE') + .margin(10) + .width('90%') + .height('5%') + .fontSize(12) + .onClick(() => { + let options: SelectionOptions = { + menuPolicy: MenuPolicy.HIDE + } + this.controller.setTextSelection(0, this.text.length - 1, options) + this.controllerArea.setTextSelection(0, this.text.length - 1, options) + this.controllerSearch.setTextSelection(0, this.text.length - 1, options) + }) + .key('UITextInputInterface003_button_001') + + Button('Switch MenuPolicy type to SHOW') + .margin(10) + .width('90%') + .height('5%') + .fontSize(12) + .onClick(() => { + let options: SelectionOptions = { + menuPolicy: MenuPolicy.SHOW + } + this.controller.setTextSelection(0, this.text.length - 1, options) + this.controllerArea.setTextSelection(0, this.text.length - 1, options) + this.controllerSearch.setTextSelection(0, this.text.length - 1, options) + }) + .key('UITextInputInterface003_button_002') + + Button('Switch MenuPolicy type to DEFAULT') + .margin(10) + .width('90%') + .height('5%') + .fontSize(12) + .onClick(() => { + let options: SelectionOptions = { + menuPolicy: MenuPolicy.DEFAULT + } + this.controller.setTextSelection(0, this.text.length - 1, options) + this.controllerArea.setTextSelection(0, this.text.length - 1, options) + this.controllerSearch.setTextSelection(0, this.text.length - 1, options) + }) + .key('UITextInputInterface003_button_003') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0030.ets new file mode 100755 index 00000000..60609436 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0030.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0030 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .onCopy((value: string) => { + console.log('this is copy content: ' + value); + }) + .margin(10) + .key('UITextInputInterface0030_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0031.ets new file mode 100755 index 00000000..873b988a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0031.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0031 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .copyOption(CopyOptions.InApp) + .onCopy((value: string) => { + console.log('this is copy content: ' + value); + }) + .margin(10) + .key('UITextInputInterface0031_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0032.ets new file mode 100755 index 00000000..8726f661 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0032.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0032 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .copyOption(CopyOptions.LocalDevice) + .onCopy((value: string) => { + console.log('this is copy content: ' + value); + }) + .margin(10) + .key('UITextInputInterface0032_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0033.ets new file mode 100755 index 00000000..22dc3b69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0033.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0033 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .copyOption(CopyOptions.None) + .onCopy((value: string) => { + console.log('this is copy content: ' + value); + }) + .margin(10) + .key('UITextInputInterface0033_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0034.ets new file mode 100755 index 00000000..79ae7eeb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0034.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. + */ + +@Entry +@Component +struct UITextInputInterface0034 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .enterKeyType(EnterKeyType.Next) + .margin(10) + .key('UITextInputInterface0034_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0035.ets new file mode 100755 index 00000000..60a0bc83 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0035.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. + */ + +@Entry +@Component +struct UITextInputInterface0035 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .enterKeyType(EnterKeyType.Go) + .margin(10) + .key('UITextInputInterface0035_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0036.ets new file mode 100755 index 00000000..613197f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0036.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. + */ + +@Entry +@Component +struct UITextInputInterface0036 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .enterKeyType(EnterKeyType.Send) + .margin(10) + .key('UITextInputInterface0036_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0037.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0037.ets new file mode 100755 index 00000000..d83d14bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0037.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. + */ + +@Entry +@Component +struct UITextInputInterface0037 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .enterKeyType(EnterKeyType.Search) + .margin(10) + .key('UITextInputInterface0037_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0038.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0038.ets new file mode 100755 index 00000000..dc86f5b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0038.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. + */ + +@Entry +@Component +struct UITextInputInterface0038 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .enterKeyType(EnterKeyType.Done) + .margin(10) + .key('UITextInputInterface0038_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0039.ets new file mode 100755 index 00000000..3ae4b6b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0039.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0039 { + @State text: string = 'This is the test text.'; + @State changeValue: string = ''; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .onChange((value: string, previewText?: PreviewText) => { + this.changeValue = 'onChange value: ' + value; + }) + .margin(10) + .key('UITextInputInterface0039_textInput_001') + Text(this.changeValue) + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface004.ets new file mode 100755 index 00000000..d2272916 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface004.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 UITextInputInterface004 { + @State text: string = 'This is the input text. Long press to display the selection.' + private scrollerForScroll: Scroller = new Scroller() + @State isScrollNext: boolean = false + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scrollerForScroll) { + Column() { + TextInput({ text: this.text }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface004_textInput_001') + + TextArea({ text: this.text }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .height(100) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface004_textArea_001') + + Search({ value: this.text }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface004_search_001') + + }.width('100%') + } + .height('30%') + .key('UITextInputInterface004_scroll_001') + + Button('Scroll Next Page') + .margin({ top: 260, left: 20 }) + .width('90%') + .height('5%') + .fontSize(12) + .onClick(() => { + this.isScrollNext = !this.isScrollNext + this.scrollerForScroll.scrollPage({ next: this.isScrollNext }) + }) + .key('UITextInputInterface004_button_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0040.ets new file mode 100755 index 00000000..8f6e148d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0040.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0040 { + @State text: string = 'This is the test text.'; + @State onCopyValue: string = 'onCopy value: '; + + build() { + Column() { + TextInput({ placeholder: this.text }) + .fontColor(Color.Black) + .onCopy((value: string) => { + this.onCopyValue = value; + }) + .onCut((content: string) => { + this.onCopyValue = 'onCut content: ' + content; + }) + .margin(10) + .key('UITextInputInterface0040_textInput_001') + Text(this.onCopyValue) + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0041.ets new file mode 100755 index 00000000..cd34f3a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0041.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0041 { + @State text: string = 'This is the test text.This is the test text.'; + @State onCopyValue: string = ''; + + build() { + Column() { + Text(this.onCopyValue) + TextInput({ text: this.text }) + .fontColor(Color.Black) + .onCut((value: string) => { + this.onCopyValue = 'onCut value:' + value; + }) + .margin(10) + .key('UITextInputInterface0041_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0042.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0042.ets new file mode 100755 index 00000000..462c0cbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0042.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0042 { + @State text: string = 'This is the test text.'; + @State isEditChange: string = ''; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .onEditChange((bool) => { + this.isEditChange = 'textInputOne onEditChange:' + bool + }) + .margin(10) + .key('UITextInputInterface0042_textInput_001') + TextInput({ text: this.text }) + .fontColor(Color.Black) + .margin(10) + .key('UITextInputInterface0042_textInput_002') + Text(this.isEditChange) + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0043.ets new file mode 100755 index 00000000..dae82356 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0043.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0043 { + @State text: string = 'This is the test text.'; + @State isKeyType: string = ''; + + build() { + Column() { + TextInput({ text: this.text }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent)=>{ + this.isKeyType ='current enterKey is ' + enterKey.valueOf() + }) + .fontColor(Color.Black) + .margin(10) + .key('UITextInputInterface0043_textInput_001') + Text(this.isKeyType) + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0044.ets new file mode 100755 index 00000000..91ad7b20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0044.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. + */ + +@Entry +@Component +struct UITextInputInterface0044 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + TextInput({ text: this.text }) + .fontColor(Color.Black) + .maxLength(20) + .margin(10) + .key('UITextInputInterface0044_textInput_001') + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0045.ets new file mode 100755 index 00000000..00422d3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0045.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0045 { + @State placeholder: string = 'This is the placeholder text.'; + @State testSelection: string = ''; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .onTextSelectionChange((selectionStart: number, selectionEnd: number)=>{ + this.testSelection='selectionChange start : ' + selectionStart + ' end : ' + selectionEnd; + }) + .margin(10) + .key('UITextInputInterface0045_textInput_001') + Text(this.testSelection) + }.height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0046.ets new file mode 100755 index 00000000..8b687cf2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0046.ets @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0046 { + @State placeholder: string = 'This is the placeholder text.'; + @State testSelection: string = ''; + + build() { + Column() { + TextInput({ placeholder: this.placeholder }) + .fontColor(Color.Black) + .border({ width: 1, color: Color.Red }) + .key('UITextInputInterface0046_textInput_001') + }.border({ width: 1, color: Color.Green }) + .width('50%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0047.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0047.ets new file mode 100755 index 00000000..e83ed406 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0047.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0047 { + @State text: string = 'This is the test text.This is the test text.This is the test text.This is the test text.'; + @State index: number = 0; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .fontColor(Color.Black) + .style(TextInputStyle.Inline) + .key('UITextInputInterface0047_textInput_001') + Button('change select potion').onClick(() => { + this.controller.setTextSelection(0, this.index + 5); + this.index = this.index + 7; + }).key('UITextInputInterface0047_button_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0048.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0048.ets new file mode 100755 index 00000000..9b410c31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0048.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. + */ + +@Entry +@Component +struct UITextInputInterface0048 { + @State text: string = 'This is the test text.'; + @State index: number = 0; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .type(InputType.Password) + .key('UITextInputInterface0048_textInput_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0049.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0049.ets new file mode 100755 index 00000000..2481473b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0049.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0049 { + @State text: string = '这是测试文本'; + @State index: number = 0; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .copyOption(CopyOptions.InApp) + .key('UITextInputInterface0049_textInput_001') + Button('select one string').onClick(() => { + this.controller.setTextSelection(0, 1); + }).key('UITextInputInterface0049_button_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface005.ets new file mode 100755 index 00000000..d253c930 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface005.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 UITextInputInterface005 { + @State text: string = 'This is the input text. Long press to display the selection.' + @State isScrollNext: boolean = false + + build() { + Row(){ + Column() { + TextInput({ text: this.text }) + .placeholderColor(Color.Grey) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface005_textInput_001') + + TextArea({ text: this.text }) + .placeholderColor(Color.Grey) + .height(100) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface005_textArea_001') + + }.width('50%') + Column() { + Search({ value: this.text }) + .placeholderColor(Color.Grey) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface005_search_001') + + }.width('50%') + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0050.ets new file mode 100755 index 00000000..b0500fdc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0050.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0050 { + @State text: string = 'this inputText'; + @State index: number = 0; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: getContext().resourceManager.getStringSync($r("app.string.module_test_desc")), controller: this.controller }) + .copyOption(CopyOptions.InApp) + .showPasswordIcon(true) + .type(InputType.Password) + .key('UITextInputInterface0050_textInput_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0051.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0051.ets new file mode 100755 index 00000000..7d1978c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0051.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0051 { + @State text: string = 'this inputText'; + @State log: string = ''; + controller = new TextInputController(); + + build() { + Column() { + Text('这是log: ' + this.log) + TextInput({ text: this.text, controller: this.controller }) + .copyOption(CopyOptions.InApp) + .inputFilter('[A-Z]', (value: string) => { + this.log = this.log + value; + }) + .key('UITextInputInterface0051_textInput_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0052.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0052.ets new file mode 100755 index 00000000..70d2b585 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0052.ets @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0052 { + @State text: string = '超长文本:this is test text.this is test text.this is test text.this is test text.this is test text.this is test text.this is test text.'; + controller = new TextInputController(); + + build() { + Column() { + TextInput({ text: this.text, controller: this.controller }) + .copyOption(CopyOptions.InApp) + .key('UITextInputInterface0052_textInput_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0053.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0053.ets new file mode 100755 index 00000000..877a20c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0053.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0053 { + @State text: string = + '超长文本:this is test text.this is test text.this is test text.this is test text.this is test text.this is test text.this is test text.'; + + build() { + Column() { + Text().height('80%') + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .draggable(true) + .style(TextContentStyle.INLINE) + .key('UITextInputInterface0053_textInput_001') + TextInput({ placeholder: 'this is placeholder text' }) + .copyOption(CopyOptions.InApp) + .key('UITextInputInterface0053_textInput_002') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0054.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0054.ets new file mode 100755 index 00000000..848dad08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0054.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0054 { + @State text: string = '这是一条很长的测试文本,This is a very long test text。' + scroller: Scroller = new Scroller() + @State isScrollNext: boolean = false + + build() { + Row() { + Column() { + Scroll(this.scroller) { + Column() { + TextInput({ text: '01' + this.text }).height(100).fontSize(20).key('UITextInputInterface0054_textInput_001') + TextInput({ text: '02' + this.text }).height(100).fontSize(20) + TextInput({ text: '03' + this.text }).height(100).fontSize(20) + } + }.height(200) + + Button('scroll view').onClick(() => { + this.isScrollNext = !this.isScrollNext + this.scroller.scrollPage({ next: this.isScrollNext }) + }).key('UITextInputInterface0054_button_001') + } + .width('100%') + } + .height('50%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0055.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0055.ets new file mode 100755 index 00000000..8bc42046 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0055.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0055 { + @State textError: string = '' + @State text: string = '' + @State nameText: string = 'test' + + build() { + Column({ space: 20 }) { + TextInput({ placeholder: '请输入密码', text: this.text }) + .width(380) + .type(InputType.Password) + .showError(this.textError) + .onChange((value: string) => { + this.text = value + }) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + if (this.text == this.nameText) { + } else { + this.textError = '密码输入错误' + this.text = '' + event.keepEditableState() + } + }).key('UITextInputInterface0055_textInput_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0056.ets new file mode 100755 index 00000000..f7013940 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0056.ets @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0056 { + build() { + Column({ space: 20 }) { + TextInput({ placeholder: '请输数字和小写字母' }) + .width(380) + .inputFilter('[1-9]|[a-z]').key('UITextInputInterface0056_textInput_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0057.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0057.ets new file mode 100755 index 00000000..12e2c399 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0057.ets @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0057 { + @State text: string = 'This is the input text. Long press to display the selection.Long press to display the selection.Long press to display the selection' + + build() { + Column() { + TextInput({ text: this.text }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface0057_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0058.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0058.ets new file mode 100755 index 00000000..ec630e4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0058.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0058 { + @State text: string = 'this is placeholder text'; + @State type: number = InputType.PhoneNumber; + + build() { + Column() { + Button('inputType password').onClick(() => { + this.type = InputType.Password; + }).id('UITextInputInterface0058_01') + Button('inputType new_password').onClick(() => { + this.type = InputType.NEW_PASSWORD; + }).margin(5).id('UITextInputInterface0058_02') + Button('inputType number_password').onClick(() => { + this.type = InputType.NUMBER_PASSWORD; + }).id('UITextInputInterface0058_03') + TextInput({ placeholder: this.text }) + .type(this.type) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface0058_textInput_001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0059.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0059.ets new file mode 100755 index 00000000..00857314 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0059.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0059 { + @State text: string = 'this is placeholder text'; + @State callback: string = 'getTextContentRect回调 :'; + controller: TextAreaController = new TextAreaController(); + + build() { + Column() { + Button('获取回调').onClick(() => { + let rect: RectResult = this.controller.getTextContentRect(); + this.callback = + 'getTextContentRect回调 : x: ' + rect.x + ' y: ' + rect.y + ' width: ' + rect.width + ' height: ' + + rect.height; + }).id('UITextInputInterface0059_01') + TextArea({ placeholder: this.text, controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(15) + .height(100) + .fontColor(Color.Black) + .key('UITextInputInterface0059_textInput_001') + Text(this.callback) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface006.ets new file mode 100755 index 00000000..816a53e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface006.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface006 { + @State text: string = 'This is the input text. Long press to display the selection.' + @State placeholder: string = 'This is the placeholder text.' + @State isScrollNext: boolean = false + + build() { + Row(){ + Column() { + TextInput({ text: this.text }) + .copyOption(CopyOptions.InApp) + .draggable(true) + .placeholderColor(Color.Grey) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface006_textInput_001') + + TextInput({ placeholder: this.placeholder }) + .placeholderColor(Color.Grey) + .height(100) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface006_textInput_002') + + }.width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0060.ets new file mode 100755 index 00000000..12bf01f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0060.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0060 { + @State text: string = ''; + @State callback: string = 'onChange回调 :'; + @State isShow: boolean = false; + controller: TextInputController = new TextInputController(); + + build() { + Column() { + Button('添加文本').onClick(() => { + this.text = '添加文本'; + }).margin(5) + .id('UITextInputInterface0060_01') + Button('获取回调').onClick(() => { + this.isShow = true; + }).id('UITextInputInterface0060_02') + TextInput({ text: this.text, controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .margin(15) + .onChange((value: string, previewText?: PreviewText) => { + this.callback = + 'onChange回调 : value: ' + value; + }) + .fontColor(Color.Black) + .key('UITextInputInterface0060_textInput_001') + Text(this.callback).visibility(this.isShow ? Visibility.Visible : Visibility.None) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0061_pc.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0061_pc.ets new file mode 100755 index 00000000..3bca3395 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0061_pc.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0061_pc { + @State type: number = InputType.Password; + + build() { + Column() { + Button('InputType.Password').onClick(() => { + this.type = InputType.Password; + }).margin({ bottom: 10 }).id('UITextInputInterface0061_01') + Button('InputType.NUMBER_PASSWORD').onClick(() => { + this.type = InputType.NUMBER_PASSWORD; + }).margin({ bottom: 10 }).id('UITextInputInterface0061_02') + Button('InputType.NEW_PASSWORD').onClick(() => { + this.type = InputType.NEW_PASSWORD; + }).margin({ bottom: 10 }).id('UITextInputInterface0061_03') + TextInput({ placeholder: 'input your password' }) + .fontColor(Color.Black) + .margin(5) + .type(this.type) + .key('UITextInputInterface0061_textInput_001') + }.justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0065.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0065.ets new file mode 100755 index 00000000..40251d83 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0065.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 UITextInputInterface0065 { + @State text: string = 'This is the test text.'; + + build() { + Column() { + Text('minWidth: 100, maxWidth: 300') + TextInput({ text: 'text' }) + .fontColor(Color.Black) + .backgroundColor(Color.Pink) + .constraintSize({ minWidth: 100, maxWidth: 300 }) + .key('UITextInputInterface0065_textInput_001') + Text('minWidth: 300, maxWidth: 400') + TextInput({ text: 'text' }) + .fontColor(Color.Black) + .margin(5) + .backgroundColor(Color.Pink) + .constraintSize({ minWidth: 300, maxWidth: 400 }) + .key('UITextInputInterface0065_textInput_002') + }.justifyContent(FlexAlign.Start) + .alignItems(HorizontalAlign.Start) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface008.ets new file mode 100755 index 00000000..f9715200 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface008.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface008 { + @State placeholder: string = 'This is the placeholder text.' + @State isScrollNext: boolean = false + + build() { + Row(){ + Column() { + TextInput({ placeholder: this.placeholder }) + .type(InputType.Password) + .placeholderColor(Color.Grey) + .margin(15) + .fontColor(Color.Black) + .key('UITextInputInterface008_textInput_001') + }.width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0100.ets new file mode 100755 index 00000000..ca2a3a95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UITextInputInterface/UITextInputInterface0100.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UITextInputInterface0100 { + @State text: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State startPotion: number = 0 + @State endPotion: number = this.startPotion + 20 + controller: TextInputController = new TextInputController() + + build() { + Column() { + Search({ placeholder: 'this is search component..' }) + .width(400) + .height(56) + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin({ top: 20 }) + .key('UITextInputInterface001_002') + TextInput({ text: 'waiting drag text from textInput to search...', controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .selectionMenuHidden(false) + .caretColor(Color.Blue) + .draggable(true) + .margin(50) + .fontSize(14) + .fontColor(Color.Black) + .key('UITextInputInterface001_001') + + TextInput({ text: '...', controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .selectionMenuHidden(false) + .caretColor(Color.Blue) + .margin(50) + .draggable(true) + .fontSize(14) + .fontColor(Color.Black) + .key('UITextInputInterface001_003') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 index e58bd507..536b9f60 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 @@ -12,6 +12,18 @@ "installationFree": false, "pages": "$profile:test_pages", "requestPermissions": [ + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "usedScene": { + "abilities":[ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, { "name": "ohos.permission.WRITE_MEDIA" }, @@ -26,6 +38,12 @@ }, { "name":"ohos.permission.INTERNET" + }, + { + "name":"ohos.permission.CAPTURE_SCREEN" + }, + { + "name": "ohos.permission.READ_PASTEBOARD" } ], "abilities": [ @@ -49,6 +67,12 @@ } ] } + ], + "metadata": [ + { + "name": "half_leading", + "value": "true" + } ] } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json index cebaca0e..29e8f00a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json @@ -63,6 +63,10 @@ { "name": "search_placeholder", "value": "#FFCFA613" + }, + { + "name": "colorBlack", + "value": "#ff00ff" } ] } \ No newline at end of file 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 5cc05ce9..f1685fe0 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,522 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/UIAttributeFontInterface/UIAttributeFontInterface001", + "testability/pages/UITextInputInterface/UITextInputInterface001", + "testability/pages/UITextInputInterface/UITextInputInterface002", + "testability/pages/UITextInputInterface/UITextInputInterface003", + "testability/pages/UITextInputInterface/UITextInputInterface004", + "testability/pages/UITextInputInterface/UITextInputInterface005", + "testability/pages/UITextInputInterface/UITextInputInterface006", + "testability/pages/UITextInputInterface/UITextInputInterface008", + "testability/pages/UITextInputInterface/UITextInputInterface0010", + "testability/pages/UITextInputInterface/UITextInputInterface0011", + "testability/pages/UITextInputInterface/UITextInputInterface0012", + "testability/pages/UITextInputInterface/UITextInputInterface0013", + "testability/pages/UITextInputInterface/UITextInputInterface0014", + "testability/pages/UITextInputInterface/UITextInputInterface0015", + "testability/pages/UITextInputInterface/UITextInputInterface0016", + "testability/pages/UITextInputInterface/UITextInputInterface0017", + "testability/pages/UITextInputInterface/UITextInputInterface0018", + "testability/pages/UITextInputInterface/UITextInputInterface0019", + "testability/pages/UITextInputInterface/UITextInputInterface0020", + "testability/pages/UITextInputInterface/UITextInputInterface0021", + "testability/pages/UITextInputInterface/UITextInputInterface0022", + "testability/pages/UITextInputInterface/UITextInputInterface0023", + "testability/pages/UITextInputInterface/UITextInputInterface0024", + "testability/pages/UITextInputInterface/UITextInputInterface0025", + "testability/pages/UITextInputInterface/UITextInputInterface0026", + "testability/pages/UITextInputInterface/UITextInputInterface0027", + "testability/pages/UITextInputInterface/UITextInputInterface0028", + "testability/pages/UITextInputInterface/UITextInputInterface0029", + "testability/pages/UITextInputInterface/UITextInputInterface0030", + "testability/pages/UITextInputInterface/UITextInputInterface0031", + "testability/pages/UITextInputInterface/UITextInputInterface0032", + "testability/pages/UITextInputInterface/UITextInputInterface0033", + "testability/pages/UITextInputInterface/UITextInputInterface0034", + "testability/pages/UITextInputInterface/UITextInputInterface0035", + "testability/pages/UITextInputInterface/UITextInputInterface0036", + "testability/pages/UITextInputInterface/UITextInputInterface0037", + "testability/pages/UITextInputInterface/UITextInputInterface0038", + "testability/pages/UITextInputInterface/UITextInputInterface0039", + "testability/pages/UITextInputInterface/UITextInputInterface0040", + "testability/pages/UITextInputInterface/UITextInputInterface0041", + "testability/pages/UITextInputInterface/UITextInputInterface0042", + "testability/pages/UITextInputInterface/UITextInputInterface0043", + "testability/pages/UITextInputInterface/UITextInputInterface0044", + "testability/pages/UITextInputInterface/UITextInputInterface0045", + "testability/pages/UITextInputInterface/UITextInputInterface0046", + "testability/pages/UITextInputInterface/UITextInputInterface0047", + "testability/pages/UITextInputInterface/UITextInputInterface0048", + "testability/pages/UITextInputInterface/UITextInputInterface0049", + "testability/pages/UITextInputInterface/UITextInputInterface0050", + "testability/pages/UITextInputInterface/UITextInputInterface0051", + "testability/pages/UITextInputInterface/UITextInputInterface0052", + "testability/pages/UITextInputInterface/UITextInputInterface0053", + "testability/pages/UITextInputInterface/UITextInputInterface0054", + "testability/pages/UITextInputInterface/UITextInputInterface0055", + "testability/pages/UITextInputInterface/UITextInputInterface0056", + "testability/pages/UITextInputInterface/UITextInputInterface0057", + "testability/pages/UITextInputInterface/UITextInputInterface0100", + "testability/pages/UISearchInterface/UISearchInterface001", + "testability/pages/UISearchInterface/UISearchInterface002", + "testability/pages/UISearchInterface/UISearchInterface003", + "testability/pages/UISearchInterface/UISearchInterface004", + "testability/pages/UISearchInterface/UISearchInterface005", + "testability/pages/UISearchInterface/UISearchInterface006", + "testability/pages/UITextAreaInterface/UITextAreaInterface001", + "testability/pages/UITextAreaInterface/UITextAreaInterface002", + "testability/pages/UITextAreaInterface/UITextAreaInterface003", + "testability/pages/UITextAreaInterface/UITextAreaInterface004", + "testability/pages/UITextAreaInterface/UITextAreaInterface005", + "testability/pages/UIComponentSpanInterface/UIComponentSpanInterface001", + "testability/pages/UIComponentSpanInterface/UIComponentSpanInterface002", + "testability/pages/UIComponentSpanInterface/UIComponentSpanInterface003", + "testability/pages/UIComponentSpanInterface/UIComponentSpanInterface004", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface003", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface004", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface005", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface006", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolSpanInterface007", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface007", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface008", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface009", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0010", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0011", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0012", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0013", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0014", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0015", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0016", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0017", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0018", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0019", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0020", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0021", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0022", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0023", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0024", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0025", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0026", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0027", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0028", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0029", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0030", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0031", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0032", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0033", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0034", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0035", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0036", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0037", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0038", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0039", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0040", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0041", + "testability/pages/UIComponentSpanInterface/UIComponentSymbolGlyphInterface0042", + "testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface001", + "testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface001", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface002", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface003", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface004", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface005", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface006", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface007", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface008", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface009", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface0012", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface0013", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface0014", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface0015", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface0016", + + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface001", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface002", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface003", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface004", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface005", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface006", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface007", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface008", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface009", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0010", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0011", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0012", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0013", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0014", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0015", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0016", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0017", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0018", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0019", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0020", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0021", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0022", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0023", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0024", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0026", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0027", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0028", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0029", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0030", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0031", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0032", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0033", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0034", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0035", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0036", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0037", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0038", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0039", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0040", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0041", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0042", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0043", + "testability/pages/UIComponentTextInputPopupBoxInterface/UIComponentTextInputPopupBoxInterface0500", + + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface001", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface002", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface003", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface004", + + "testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface001", + "testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface002", + "testability/pages/UIComponentTextInputPhoneNumberInterface/UIComponentTextInputPhoneNumberInterface003", + + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface001", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface002", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface003", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface004", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface005", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface006", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface007", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface008", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface009", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0010", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0011", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0012", + "testability/pages/UIComponentTypeUrlInterface/UIComponentTypeUrlInterface0013", + + + "testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface001", + "testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface002", + "testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface003", + "testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface004", + "testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface005", + "testability/pages/UIComponentUISupportColorInterface/UIComponentUISupportColorInterface006", + + + + "testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface001", + "testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface002", + "testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface003", + "testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface004", + "testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface005", + "testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface006", + "testability/pages/UITextBoxDisablePasteInterface/UITextBoxDisablePasteInterface007", + + "testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface001", + "testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface002", + "testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface003", + + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0080", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0110", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0120", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0130", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0170", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0300", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0310", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0340", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0360", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0370", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0380", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0390", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0400", + "testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface0410", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0010", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0020", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0030", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0040", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0050", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0060", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0070", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0080", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0090", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0100", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0110", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0120", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0130", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_1", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_2", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_3", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_4", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0140_5", + "testability/pages/UIComponentTextSelectionMenuJingXiang/UIComponentTextSelectionMenuJingXiang0160", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0130", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0150", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0570", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0020", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0040", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0050", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0060", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0080", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0100", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0110", + "testability/pages/UIComponentTextTextAction/UIComponentTextTextAction0180", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0010", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0020", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0030", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0040", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0050", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0060", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0070", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0080", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0090", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0100", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0110", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0120", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0130", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0140", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0150", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0160", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0170", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0180", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0190", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0200", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0210", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0220", + "testability/pages/UIComponentTextTextCustomMenu/UIComponentTextTextCustomMenu0230", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0010", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0030", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0040", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0060", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0080", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0090", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0110", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0130", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0150", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0180", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0190", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0210", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0230", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0250", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0260", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0270", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0280", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0290", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0300", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0320", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0340", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0360", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0380", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0450", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0460", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0470", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0480", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0490", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0510", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0520", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0570", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0590", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0610", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0630", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0640", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0650", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0670", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0690", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0710", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0730", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0750", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0770", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0790", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0810", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0820", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0830", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0840", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0850", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0860", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0880", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0900", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0920", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0940", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor0990", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1010", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1020", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1030", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1040", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1050", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1060", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1070", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1080", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1130", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1150", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1170", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1190", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1200", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1210", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1220", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1250", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1260", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1290", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1310", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1330", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1340", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1370", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1380", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1390", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1400", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1410", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1420", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1440", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1460", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1480", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1500", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1550", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1570", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1580", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1590", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1600", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1610", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1620", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1630", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1640", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1690", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0010", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0020", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0030", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0040", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0060", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0070", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0120", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0130", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0140", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0180", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0010", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle0020", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0010", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0020", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0110", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0120", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0130", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0140", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0150", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0160", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0170", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0180", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0190", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0200", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0210", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0220", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0230", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0240", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0250", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0260", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0270", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0311", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0312", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0010_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0030_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0040_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0050_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0060_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0070_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0080_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0090_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0100_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0110_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0120_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_1", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_2", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0130_3", + "testability/pages/UIComponentTextSelectionOptimization/UIComponentTextSelectionOptimization0140", + + "testability/pages/UIComponentTextSafePasteInterface/UIComponentTextSafePasteInterface004", + "testability/pages/UITextInputInterface/UITextInputInterface0058", + "testability/pages/UITextInputInterface/UITextInputInterface0059", + "testability/pages/UITextInputInterface/UITextInputInterface0060", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0070", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0080", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0090", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0100", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0200", + "testability/pages/UIComponentTextInputPasswordInterface/UIComponentTextInputPasswordInterface0220", + "testability/pages/UITextInputInterface/UITextInputInterface0065", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1750", + "testability/pages/UITextInputInterface/UITextInputInterface0061_pc", + + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0010", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0020", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0030", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0040", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0050", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0390", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0400", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0410", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0420", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0430", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0440", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0450", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0460", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0470", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0480", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0490", + "testability/pages/UIComponentTextCopyAttributeReplacement/UIComponentTextCopyAttributeReplacement0500", + + "testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0010", + "testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0150", + "testability/pages/UIComponentSetFontSizeScaleReplacement/UIComponentSetFontSizeScaleReplacement0160", + + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0010", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0020", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0030", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0040", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0050", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0060", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0070", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0080", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0090", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0140", + "testability/pages/UIComponentTextCommonEmojiReplacement/UIComponentTextCommonEmojiReplacement", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0010", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0020", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0080", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0090", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0100", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0110", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0130", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement0140", + "testability/pages/UIComponentTextCommonClickReplacement/UIComponentTextCommonClickReplacement", + "testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0020", + "testability/pages/UIComponentOnSubmitReplacement/UIComponentOnSubmitReplacement0090", + "testability/pages/UIAttributeBackgroundSeriableReplacement/UIAttributeBackgroundSeriableReplacement0040", + "testability/pages/UIComponentInputKeyboardAvoidModeReplacement/UIComponentInputKeyboardAvoidMode0160", + "testability/pages/UIComponentTextHalfleadingReplacement/UIComponentTextHalfleadingReplacement0100", + "testability/pages/ActionEventWillClickReplacement/ActionEventWillClickReplacement0170", + "testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0010", + "testability/pages/UIComponentFrameNodeTextReplacement/UIComponentFrameNodeTextReplacement0100" ] } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/dark/element/color.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/dark/element/color.json new file mode 100755 index 00000000..4ab5edec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/dark/element/color.json @@ -0,0 +1,12 @@ +{ + "color": [ + { + "name": "bg_color", + "value": "#000000" + }, + { + "name": "txt_color", + "value": "#c6c6c6" + } + ] +} -- Gitee