diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/offIcon.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/offIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..4cc3288583304500745654f3cb33b9c52c288d9b Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/offIcon.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/onIcon.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/onIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..f13599666fa6479839a066be980ed0a92363d403 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/onIcon.png differ 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 0860e1238b7d5125d3247205585c174e61e3e827..d522f3a4adf96d1fd32c55c305c11c02e82676f5 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,78 @@ import UIComponentPopupBoxToastStyleInterface001 from './UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test'; import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import UIAttributesStateStylesInterfaceEditableTextThree + from './UIAttributesStateStylesInterfaceEditableTextThreeTest/UIAttributesStateStylesInterfaceEditableTextThree.test'; +import UIComponentAttributeImage from './UIComponentAttributeImageTest/UIComponentAttributeImage.test'; +import StatusManagerBelievable from './StatusManagerBelievableTest/StatusManagerBelievable.test'; +import UIComponentAttributeStringModifyingStyle + from './UIComponentAttributeStringModifyingStyleTest/UIComponentAttributeStringModifyingStyle.test'; +import UIComponentAttributeStringModifyingStyleText + from './UIComponentAttributeStringModifyingStyleTextTest/UIComponentAttributeStringModifyingStyleText.test'; +import UIComponentAttributeUserData from './UIComponentAttributeUserData/UIComponentAttributeUserData.test'; +import UIComponentCreateColor from './UIComponentCreateColorTest/UIComponentCreateColor.test'; +import UIComponentInputKeyboardAvoidMode + from './UIComponentInputKeyboardAvoidModeTest/UIComponentInputKeyboardAvoidMode.test'; +import UIComponentScrollSwiperInterfacemix + from './UIComponentScrollSwiperInterfacemixTest/UIComponentScrollSwiperInterfacemix.test'; +import UIComponentTextAttributeStringConstructsTest + from './UIComponentTextAttributeStringConstructsTest/UIComponentTextAttributeStringConstructs.test'; +import UIComponentTextAttribute from './UIComponentTextAttributeText/UIComponentTextAttribute.test'; +import UIComponentTextCommonCopyOptionDraggableTest + from './UIComponentTextCommonCopyOptionDraggableTest/UIComponentTextCommonCopyOptionDraggableTest.test'; +import UIComponentTextCommonCustomDrawingSpan + from './UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan.test'; +import UIComponentTextCommonItscaAttributeUpdater + from './UIComponentTextCommonItscaAttributeUpdaterTest/UIComponentTextCommonItscaAttributeUpdater.test'; +import UIComponentTextHyperlinkInteraction + from './UIComponentTextHyperlinkInteractionTest/UIComponentTextHyperlinkInteraction.test'; +import UIComponentTextImagePrivacySensitive + from './UIComponentTextImagePrivacySensitiveTest/UIComponentTextImagePrivacySensitive.test'; +import UIComponentTextInline from './UIComponentTextInlineTest/UIComponentTextInline.test'; +import UIComponentTextInputNumberDecimalTest + from './UIComponentTextInputNumberDecimalTest/UIComponentTextInputNumberDecimalTest.test'; +import UIComponentTextInputSecurityKeyboardScrollTest + from './UIComponentTextInputSecurityKeyboardScrollTest/UIComponentTextInputSecurityKeyboardScrollTest.test'; +import UIComponentTextInput0010 from './UIComponentTextInputTest/UIComponentTextInput.test'; +import UIComponentTextReverseAnalysis from './UIComponentTextReverseAnalysisTest/UIComponentTextReverseAnalysis.test'; +import UIComponentTextTextAreaActionTest + from './UIComponentTextTextAreaActionTest/UIComponentTextTextAreaActionTest.test'; +import UIComponentTextTextAreaEnhancesTest + from './UIComponentTextTextAreaEnhancesTest/UIComponentTextTextAreaEnhancesTest.test'; +import UIComponentTextTextAreaEnterkeyTypeTest + from './UIComponentTextTextAreaEnterkeyTypeTest/UIComponentTextTextAreaEnterkeyTypeTest.test'; +import UIComponentTextTextAreaEvaSaveInputMethodTest + from './UIComponentTextTextAreaEvaSaveInputMethodTest/UIComponentTextTextAreaEvaSaveInputMethodTest.test'; +import UIComponentTextTextAreaInterActionTest + from './UIComponentTextTextAreaInterActionTest/UIComponentTextTextAreaInterActionTest.test'; +import UIComponentTextTextAreaInterActiveTest + from './UIComponentTextTextAreaInterActiveTest/UIComponentTextTextAreaInterActiveTest.test'; +import UIComponentTextTextAreaInterfaceTest + from './UIComponentTextTextAreaInterfaceTest/UIComponentTextTextAreaInterfaceTest.test'; +import UIComponentTextTextAreaLayoutTest + from './UIComponentTextTextAreaLayoutTest/UIComponentTextTextAreaLayoutTest.test'; +import UIComponentTextTextAreaSelectionTest + from './UIComponentTextTextAreaSelectionTest/UIComponentTextTextAreaSelectionTest.test'; +import UIComponentTextTextAreaUxComsistencyTest + from './UIComponentTextTextAreaUxComsistencyTest/UIComponentTextTextAreaUxComsistencyTest.test'; +import UIComponentTextTextEditable from './UIComponentTextTextEditableTest/UIComponentTextTextEditable.test'; +import UIComponentTextTextGestureStyle + from './UIComponentTextTextGestureStyleTest/UIComponentTextTextGestureStyle.test'; +import UIComponentTextTextImageSpanAlt + from './UIComponentTextTextImageSpanAltTest/UIComponentTextTextImageSpanAlt.test'; +import UIComponentTextTextInterface from './UIComponentTextTextInterfaceTest/UIComponentTextTextInterface.test'; +import UIComponentTextTextLongPress from './UIComponentTextTextLongPressTest/UIComponentTextTextLongPress.test'; +import UIComponentTextTextMarquee from './UIComponentTextTextMarqueeTest/UIComponentTextTextMarquee.test'; +import UIComponentTextTextPrivacyMask from './UIComponentTextTextPrivacyMaskTest/UIComponentTextTextPrivacyMask.test'; +import UIComponentTextTextStringParagraphStyle + from './UIComponentTextTextStringParagraphStyleTest/UIComponentTextTextStringParagraphStyle.test'; +import UIComponentTextTextSupportFont from './UIComponentTextTextSupportFontTest/UIComponentTextTextSupportFont.test'; +import UIComponentTextTransparency from './UIComponentTextTransparencyTest/UIComponentTextTransparency.test'; +import UICustomTextShortCutKeyReplacement + from './UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement.test'; +import UIComponentTextTextEvasiveInputMethod from './UIComponentTextTextEvasiveInputMethodTest/UIComponentTextTextEvasiveInputMethod.test'; +import UIComponentTextTextAreaOnEditChangeTest + from './UIComponentTextTextAreaOnEditChangeTest/UIComponentTextTextAreaOnEditChangeTest.test'; export default function testsuite() { ComponentTextRicheditorFontfeatures(); @@ -239,6 +311,52 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + UIComponentAttributeImage(); + StatusManagerBelievable(); + UIComponentAttributeStringModifyingStyle(); + UIComponentAttributeStringModifyingStyleText(); + UIComponentTextAttributeStringConstructsTest(); + UIComponentTextCommonCustomDrawingSpan(); + UIComponentTextCommonItscaAttributeUpdater(); + UIComponentTextImagePrivacySensitive(); + UIComponentTextTextEditable(); + UIComponentTextTextGestureStyle(); + UIComponentTextTextImageSpanAlt(); + UIComponentTextTextInterface(); + UIComponentTextTextLongPress(); + UIComponentTextTextMarquee(); + UIComponentTextTextPrivacyMask(); + UIComponentTextTextStringParagraphStyle(); + UIComponentUISupportColor(); + UIComponentTextTransparency(); + UIAttributesStateStylesInterfaceEditableTextThree(); + UIComponentCreateColor(); + + UIComponentTextInput0010(); + UIComponentScrollSwiperInterfacemix(); + UIComponentTextAttribute(); + UIComponentTextTextAreaActionTest(); + UIComponentTextTextAreaEnterkeyTypeTest(); + UIComponentTextTextAreaEvaSaveInputMethodTest(); + UIComponentTextTextAreaInterActiveTest(); + UIComponentTextTextAreaInterfaceTest(); + UIComponentTextTextAreaLayoutTest(); + UIComponentTextTextAreaSelectionTest(); + UIComponentTextInputNumberDecimalTest(); + UIComponentTextInputSecurityKeyboardScrollTest(); + UIComponentTextTextAreaUxComsistencyTest(); + UIComponentTextCommonCopyOptionDraggableTest(); + UIComponentTextTextAreaEnhancesTest(); + UIComponentTextTextAreaInterActionTest(); + UIComponentTextTextSupportFont(); + UIComponentAttributeUserData(); + UICustomTextShortCutKeyReplacement(); + UIComponentTextHyperlinkInteraction(); + UIComponentTextInline(); + UIComponentTextReverseAnalysis(); + UIComponentInputKeyboardAvoidMode(); + UIComponentTextTextEvasiveInputMethod(); + UIComponentTextTextAreaOnEditChangeTest(); } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/StatusManagerBelievableTest/StatusManagerBelievable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/StatusManagerBelievableTest/StatusManagerBelievable.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..373ebfb5c406b928ffa32848442665e195b5da83 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/StatusManagerBelievableTest/StatusManagerBelievable.test.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, 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 { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function StatusManagerBelievable() { + + describe('StatusManagerBelievable', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_STATUSMANAGER_BELIEVABLE_0010 + * @tc.name : SUB_ACE_STATUSMANAGER_BELIEVABLE_0010 + */ + it('SUB_ACE_STATUSMANAGER_BELIEVABLE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_BELIEVABLE_0010 start.`); + Settings.createWindow("testability/pages/StatusManagerBelievable/StatusManagerBelievable0010"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_BELIEVABLE_0010 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributesStateStylesInterfaceEditableTextThreeTest/UIAttributesStateStylesInterfaceEditableTextThree.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributesStateStylesInterfaceEditableTextThreeTest/UIAttributesStateStylesInterfaceEditableTextThree.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ed21f99605d148924dc0a83a0959fe1090345da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributesStateStylesInterfaceEditableTextThreeTest/UIAttributesStateStylesInterfaceEditableTextThree.test.ets @@ -0,0 +1,388 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, 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' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIAttributesStateStylesInterfaceEditableTextThree() { + + describe('UIAttributesStateStylesInterfaceEditableTextThree', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0320 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0320 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0320 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree032"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(500); + let component = await driver.findComponent(ON.id('inputComponent')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0320 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0610 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0610 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0610 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree061"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(500); + let component = await driver.findComponent(ON.id('textAreaComponent')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0610 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_1 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_1 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_1 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree075"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_1 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_2 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_2 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_2 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree075"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('searchComponent')); + let clearFocus = await driver.findComponent(ON.id('clearFocus')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(1000); + clearFocus.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0750_2 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0900 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0900 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0900 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree090"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0900 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0920 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0920 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0920 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree092"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_1); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_2); + await Utils.sleep(500); + await driver.triggerKey(KeyCode.KEYCODE_2); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_0920 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1010 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1010 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1010 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree101"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1010 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1040 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1040 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1040 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree104"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + await Utils.sleep(500); + component.click(); + await Utils.sleep(500); + await component.inputText('123456123456123456'); + await Utils.sleep(500); + await component.longClick(); + await Utils.sleep(1000); + 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); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1040 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_1 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_1 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_1 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree105"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + await Utils.sleep(500); + component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_1 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_2 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_2 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_2 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree105"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + let clearFocus = await driver.findComponent(ON.id('clearFocus')); + await Utils.sleep(500); + component.click(); + await Utils.sleep(500); + clearFocus.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1050_2 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1060 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1060 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1060 start.`); + Settings.createWindow( + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/" + + "UIAttributesStateStylesInterfaceEditableTextThree106"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + await Utils.sleep(500); + await component.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1130 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1130 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1130 start.`); + Settings.createWindow( + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/" + + "UIAttributesStateStylesInterfaceEditableTextThree106"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(1000); + + await driver.pressBack(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1130 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1170 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1170 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1170 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree117"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + await Utils.sleep(500); + component.click(); + await Utils.sleep(1000); + let closeButton = await driver.findComponent(ON.id('closeButton')); + await Utils.sleep(1000); + closeButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1170 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1200 + * @tc.name : SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1200 + * @tc.desc : Bind custom keyboard + */ + it('SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1200 start.`); + Settings.createWindow("testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree120"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id('richEditorComponent')); + await Utils.sleep(500); + component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_STATESTYLES_INTERFACE_EDITABLETEXTTHREE_1200 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeImageTest/UIComponentAttributeImage.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeImageTest/UIComponentAttributeImage.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c44381e44a1a7ced3882748a462e8984f5f04d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeImageTest/UIComponentAttributeImage.test.ets @@ -0,0 +1,378 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentAttributeImage001() { + + describe('UIComponentAttributeImage001', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_SPAN_BASELINEOFFSET_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0010 + * @tc.desc Set Picture + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage001"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0020 + * @tc.desc Set image size + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage002"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0030 + * @tc.desc Set image size + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage003"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0040 + * @tc.desc Set the zoom type of the image + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage004"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0050 + * @tc.desc Set the outer margin + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage005"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0060 + * @tc.desc Set the outer margin + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage006"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0070 + * @tc.desc padding + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage007"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0080 + * @tc.desc Display images as spaces + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage008"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0090 + * @tc.desc The character length of the image is 1 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0090 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage009"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0100 + * @tc.desc Can display images + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage010"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0110 + * @tc.desc The image has been cleared + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage011"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage011")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0120 + * @tc.desc String removed + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage012"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage012")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0130 + * @tc.desc The image has been cleared + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage013"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage013")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0140 + * @tc.desc Clear the specified range style + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage014"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage014")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0150 + * @tc.desc Clear all styles + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage015"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage015")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0160 + * @tc.desc Replace the image + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage016"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage016")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0170 + * @tc.desc Insert picture + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage017"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage017")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0180 + * @tc.desc Insert image at the end + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeImage/UIComponentAttributeImage018"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("UIComponentAttributeImage018")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_IMAGE_0180 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeStringModifyingStyleTest/UIComponentAttributeStringModifyingStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeStringModifyingStyleTest/UIComponentAttributeStringModifyingStyle.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..afb4745cba2074e3053d2fcf7dc69531e35a243c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeStringModifyingStyleTest/UIComponentAttributeStringModifyingStyle.test.ets @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentAttributeStringModifyingStyle() { + + describe('UIComponentAttributeStringModifyingStyle', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_ATTRIBUTE_STRING_MODIFYING_STYLE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0150 + * @tc.desc Clear specified range and specify style + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle015"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIComponentAttributeStringModifyingStyle015")); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0160 + * @tc.desc Clear specified range and specify style + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle016"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIComponentAttributeStringModifyingStyle016")); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0220 + * @tc.desc Clear specified range and specify style + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0220 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle022"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIComponentAttributeStringModifyingStyle022")); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0230 + * @tc.desc Clear all styles within the specified range + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0230 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle023"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIComponentAttributeStringModifyingStyle023")); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0120 + * @tc.desc Clear all styles within the specified range + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle0120"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let insertButton = await driver.findComponent(ON.id("insert")); + insertButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0120 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeStringModifyingStyleTextTest/UIComponentAttributeStringModifyingStyleText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeStringModifyingStyleTextTest/UIComponentAttributeStringModifyingStyleText.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b49c1bf9fe083cf606cfc2d6f1ddbf8e1a8db597 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeStringModifyingStyleTextTest/UIComponentAttributeStringModifyingStyleText.test.ets @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentAttributeStringModifyingStyleText() { + + describe('UIComponentAttributeStringModifyingStyleText', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0230 + * @tc.desc Set multiple insertions and character deletions + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText023"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let insertButton = await driver.findComponent(ON.id("insert")); + let deleteButton = await driver.findComponent(ON.id("delete")); + insertButton.click(); + await Utils.sleep(2000); + deleteButton.click(); + await Utils.sleep(2000); + insertButton.click(); + await Utils.sleep(2000); + insertButton.click(); + await Utils.sleep(2000); + deleteButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0090 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0090 + * @tc.desc Set multiple insertions and character deletions + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0090 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0090"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let insertButton = await driver.findComponent(ON.id("insert")); + insertButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0090 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0100 + * @tc.desc Set multiple insertions and character deletions + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0100"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let insertButton = await driver.findComponent(ON.id("insert")); + insertButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0110 + * @tc.desc Set multiple insertions and character deletions + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0110 start.`); + Settings.createWindow( + "testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText011" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let insertButton = await driver.findComponent(ON.id("insert")); + let getString = await driver.findComponent(ON.id("getString")); + let getLength = await driver.findComponent(ON.id("getLength")); + let getStyles = await driver.findComponent(ON.id("getStyles")); + await insertButton.click(); + await Utils.sleep(2000); + await getString.click(); + await Utils.sleep(2000); + await getLength.click(); + await Utils.sleep(2000); + await getStyles.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0110 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeUserData/UIComponentAttributeUserData.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeUserData/UIComponentAttributeUserData.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..614b0dc4338e8e167bb03d1cd8937e8edd713846 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAttributeUserData/UIComponentAttributeUserData.test.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentAttributeUserData() { + + describe('UIComponentAttributeUserData', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_ATTRIBUTE_USERDATA_0030 + * @tc.name SUB_ACE_UI_COMPONENT_ATTRIBUTE_USERDATA_0030 + * @tc.desc ATSpan + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_USERDATA_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_USERDATA_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAttributeUserData/UIComponentAttributeUserData0030"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id("getStlye")); + await button.click(); + await Utils.sleep(1000); + let button1 = await driver.findComponent(ON.id("getStlye1")); + await button1.click(); + await Utils.sleep(1000); + let button2 = await driver.findComponent(ON.id("getStlye2")); + await button2.click(); + await Utils.sleep(1000); + let button3 = await driver.findComponent(ON.id("getStlye3")); + await button3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_USERDATA_0030 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCreateColorTest/UIComponentCreateColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCreateColorTest/UIComponentCreateColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d346a740023874160fdf8a8f2716a15e47582dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCreateColorTest/UIComponentCreateColor.test.ets @@ -0,0 +1,1307 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, MouseButton } from '@kit.TestKit' +import { Component } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentCreateColor() { + + describe('UIComponentCreateColor', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_CREATE_COLOR_0010_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_1 + * @tc.desc Set cursor color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor001"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await 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_CREATE_COLOR_0010_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_2 + * @tc.desc Set cursor color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor001"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let redCaret = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await redCaret.click(); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_3 + * @tc.desc Set cursor color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor001"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let greenCaret = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await greenCaret.click(); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0010_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_1 + * @tc.desc Set background color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor002"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_2 + * @tc.desc Set background color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor002"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let redBackground = await driver.findComponent(ON.id("redBackground")); + await Utils.sleep(500); + await redBackground.click(); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_3 + * @tc.desc Set background color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor002"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let greenBackground = await driver.findComponent(ON.id("greenBackground")); + await Utils.sleep(500); + await greenBackground.click(); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 + * @tc.desc Set opacity + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor003"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let caretColor = await driver.findComponent(ON.id("caretColor")); + let opacity = await driver.findComponent(ON.id("opacity")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await opacity.click(); + await Utils.sleep(500); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_1 + * @tc.desc Set textInput component style + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor004"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0020_2 + * @tc.desc Set textInput component style + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor004"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let redBackground = await driver.findComponent(ON.id("redBackgroundColor")); + let redCaret = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await redBackground.click(); + await Utils.sleep(500); + await redCaret.click(); + await Utils.sleep(500); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_2 end.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_3 + * @tc.desc Set textInput component style + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor004"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let greenBackgroundColor = await driver.findComponent(ON.id("greenBackgroundColor")); + let greenCaret = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await greenBackgroundColor.click(); + await Utils.sleep(500); + await greenCaret.click(); + await Utils.sleep(500); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0040_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_1 + * @tc.desc Switch input box type + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor006_1"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInputFirst: Component = await driver.findComponent(ON.id('UIComponentCreateColor0060')); + let textInputSecond: Component = await driver.findComponent(ON.id('UIComponentCreateColor0061')); + let textInputThird: Component = await driver.findComponent(ON.id('UIComponentCreateColor0062')); + await Utils.sleep(1000); + await textInputFirst.inputText('abc123'); + await Utils.sleep(1000); + await textInputSecond.inputText('abc123'); + await Utils.sleep(1000); + await textInputThird.inputText('123'); + await Utils.sleep(1000); + await textInputFirst.longClick(); + await Utils.sleep(1000); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(1000); + await selectAll?.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_2 + * @tc.desc Switch input box type + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor006_2"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInputFourth: Component = await driver.findComponent(ON.id('UIComponentCreateColor0063')); + let textInputFifth: Component = await driver.findComponent(ON.id('UIComponentCreateColor0064')); + let textInputSixth: Component = await driver.findComponent(ON.id('UIComponentCreateColor0065')); + let redCaret = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await redCaret.click(); + await Utils.sleep(1000); + await textInputFourth.inputText('123'); + await Utils.sleep(1000); + await textInputFifth.inputText('17825636325'); + await Utils.sleep(1000); + await textInputSixth.inputText('123'); + await Utils.sleep(1000); + await textInputFourth.longClick(); + await Utils.sleep(1000); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(1000); + await selectAll?.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_3 + * @tc.desc Switch input box type + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0060_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor006_3"); + await Utils.sleep(500); + let driver: Driver = Driver.create(); + let textInputSeventh: Component = await driver.findComponent(ON.id('UIComponentCreateColor0066')); + let textInputEighth: Component = await driver.findComponent(ON.id('UIComponentCreateColor0067')); + let textInputNinth: Component = await driver.findComponent(ON.id('UIComponentCreateColor0068')); + let greenCaret = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await greenCaret.click(); + await Utils.sleep(500); + await textInputSeventh.inputText('123'); + await Utils.sleep(500); + await textInputEighth.inputText('1234566'); + await Utils.sleep(500); + await textInputNinth.inputText('123'); + await Utils.sleep(500); + await textInputSeventh.longClick(); + await Utils.sleep(500); + let selectAll: Component = 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_CREATE_COLOR_0060_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_1 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor007"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + await Utils.sleep(500); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_2 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor007"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_3 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor007"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('inputComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await textInput.inputText('testtesttesttesttesttesttesttesttest'); + 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(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0070_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_1 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor008"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0080_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_2 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor008"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0080_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_3 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0080_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor008"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0080_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0090 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0090 + * @tc.desc Set opacity + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor009"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + let caretColor = await driver.findComponent(ON.id("caretColor")); + let opacity = await driver.findComponent(ON.id("opacity")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await opacity.click(); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0090 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_1 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor011"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0090 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_2 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor011"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0110_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_3 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0110_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor011"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0110_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0120 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0120 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0120 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0120"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + await Utils.sleep(100); + let btn: Component = await driver.findComponent(ON.id('changeButton2')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_1 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.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_CREATE_COLOR_0130_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_2 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.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_CREATE_COLOR_0130_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_3 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0130_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.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_CREATE_COLOR_0130_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_1 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(500); + await selectAll?.click(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('setTextSelection')); + await Utils.sleep(500); + await btn?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_2 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(500); + await selectAll?.click(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('setTextSelection')); + await Utils.sleep(500); + await btn?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_3 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(500); + await selectAll?.click(); + let btn: Component = await driver.findComponent(ON.id('setTextSelection')); + await Utils.sleep(500); + await btn?.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0140_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0150 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0150 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0150 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("btnCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.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_CREATE_COLOR_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0160 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0160 + * @tc.desc Switch to inline mode + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0160 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0160"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + await Utils.sleep(100); + let btn: Component = await driver.findComponent(ON.id('changeButton2')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_1 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + let point = await searchComponent.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_2 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + let point = await searchComponent.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_3 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + let point = await searchComponent.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0170_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_1 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + let point = await searchComponent.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_2 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + let point = await searchComponent.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_3 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + let point = await searchComponent.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_A); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0180_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_1 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0200_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_2 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0200_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_3 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0200_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textAreaComponent: Component = await driver.findComponent(ON.id('textAreaComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await textAreaComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await textAreaComponent.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_CREATE_COLOR_0200_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_1 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_1 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_1 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.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_CREATE_COLOR_0210_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_2 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_2 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_2 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("redCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.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_CREATE_COLOR_0210_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_3 + * @tc.name SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_3 + * @tc.desc Set caret color + */ + it('SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CREATE_COLOR_0210_3 start.`); + Settings.createWindow("testability/pages/UIComponentCreateColor/UIComponentCreateColor0210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let searchComponent: Component = await driver.findComponent(ON.id('searchComponent')); + let caretColor = await driver.findComponent(ON.id("greenCaret")); + await Utils.sleep(500); + await caretColor.click(); + await Utils.sleep(500); + await searchComponent.inputText('testtesttesttesttesttesttesttesttest'); + await Utils.sleep(500); + await searchComponent.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_CREATE_COLOR_0210_3 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInputKeyboardAvoidModeTest/UIComponentInputKeyboardAvoidMode.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInputKeyboardAvoidModeTest/UIComponentInputKeyboardAvoidMode.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..882bb6b4bea03e332fe2a83e5ca1cff3d458ec05 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInputKeyboardAvoidModeTest/UIComponentInputKeyboardAvoidMode.test.ets @@ -0,0 +1,401 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, Component, ON } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentInputKeyboardAvoidMode() { + + describe('UIComponentInputKeyboardAvoidMode', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0010 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0010"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0010_001')); + await button.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0010 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0020 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0020"); + await Utils.sleep(1000); + const driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0020_001')); + await Utils.sleep(1000); + await button.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0020 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0030"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0030_001')); + let toggle: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0030_002')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await toggle.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0020 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0040 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0040"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0040_001')); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0040_002')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0040 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0050 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0050"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0050_001')); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0050_002')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0050 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0060 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0060"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0060_001')); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0060_002')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0070 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0070"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0070_001')); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0070_002')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0070 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0080 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0080"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0080_001')); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0080_002')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0080 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0090 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0090 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0090"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0090_001')); + await input.click(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0090 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0100 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0100"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0100_001')); + let button: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0100_002')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0100 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0110 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0110"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0110_001')); + await input.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0110 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0120 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0120"); + await Utils.sleep(1000); + const driver = Driver.create(); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0120_001')); + await input.click(); + await Utils.sleep(1000); + await input.click(); + await input.click(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click(); + await Utils.sleep(1000); + let textArea: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0120_002')); + await input.dragTo(textArea); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0120 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0130 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0130"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0130_001')); + await input.click(); + await Utils.sleep(1000); + let inputText: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0130_001')); + let point = await inputText.getBoundsCenter(); + await driver.swipe(point.x, point.y, point.x, point.y - 200, 1000); + await Utils.sleep(3000); + await inputText.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_A) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0130 finish.`); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0150 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0150"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentInputKeyboardAvoidMode0150_001')); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INPUT_KEYBOARDAVOIDMODE_0150 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperInterfacemixTest/UIComponentScrollSwiperInterfacemix.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperInterfacemixTest/UIComponentScrollSwiperInterfacemix.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..add2a57e3caf2a4c26fc7aa878de4a14dff0d1f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperInterfacemixTest/UIComponentScrollSwiperInterfacemix.test.ets @@ -0,0 +1,361 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, MouseButton, ON, Component } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { KeyCode } from '@kit.InputKit' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentScrollSwiperInterfacemix() { + + describe('UIComponentScrollSwiperInterfacemix', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0430 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0430") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + + await driver.triggerKey(KeyCode.KEYCODE_TAB) + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_TAB) + await driver.triggerKey(KeyCode.KEYCODE_SPACE) + await driver.triggerKey(KeyCode.KEYCODE_ENTER) + focusControl.requestFocus('TextInput0430') + await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_UP) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0430 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0440 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0440") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + + await driver.triggerKey(KeyCode.KEYCODE_TAB) + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_TAB) + await driver.triggerKey(KeyCode.KEYCODE_SPACE) + await driver.triggerKey(KeyCode.KEYCODE_ENTER) + focusControl.requestFocus('TextInput0440') + await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_UP) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0440 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0450 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0450") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + + await driver.triggerKey(KeyCode.KEYCODE_TAB) + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_TAB) + await driver.triggerKey(KeyCode.KEYCODE_SPACE) + await driver.triggerKey(KeyCode.KEYCODE_ENTER) + focusControl.requestFocus('TextInput0450') + await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_UP) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0450 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0460 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0460") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + + await driver.triggerKey(KeyCode.KEYCODE_TAB) + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_TAB) + await driver.triggerKey(KeyCode.KEYCODE_SPACE) + await driver.triggerKey(KeyCode.KEYCODE_ENTER) + focusControl.requestFocus('TextInput0460') + await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_UP) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0460 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0470 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0470") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + + await driver.triggerKey(KeyCode.KEYCODE_TAB) + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_TAB) + await driver.triggerKey(KeyCode.KEYCODE_SPACE) + await driver.triggerKey(KeyCode.KEYCODE_ENTER) + focusControl.requestFocus('TextInput0470') + await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_UP) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT) + await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0470 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0890 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0890 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0890 start.`); + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0890"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('TextInput0890')); + await Utils.sleep(500); + await textInput.inputText('testtesttesawda'); + await Utils.sleep(500); + await textInput.longClick(); + await Utils.sleep(500); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x + 320, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_0890 end.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1120 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1120") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await driver.triggerKey(KeyCode.KEYCODE_SPACE) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1140 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1140 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1140 start.`); + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('TextInput1140')); + await Utils.sleep(500); + await textInput.inputText('testtesttes'); + await Utils.sleep(500); + await driver.triggerCombineKeys(2047, 2099); + await Utils.sleep(500); + await driver.triggerKey(2070); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1140 end.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1150 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1150") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInputCom = await driver.findComponent(ON.id('TextInput1150')) + let textInputComBounds = await textInputCom.getBounds(); + await Utils.sleep(100) + await textInputCom.inputText("123") + await Utils.sleep(2000) + let textInputComBound = await textInputCom.getBoundsCenter(); + await Utils.sleep(2000) + await driver.click((textInputComBounds.right - 30), textInputComBound.y) + await Utils.sleep(2000) + await textInputCom.inputText("456") + await Utils.sleep(2000) + await driver.mouseClick({ + x: textInputComBounds.right - 30, y: textInputComBound.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1150 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1160 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1160") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let textInputCom = await driver.findComponent(ON.id('TextInput1160')) + let textInputComBounds = await textInputCom.getBounds() + await Utils.sleep(1000) + let textInputComBound = await textInputCom.getBoundsCenter(); + await Utils.sleep(2000) + await driver.click((textInputComBounds.right - 30), textInputComBound.y) + await Utils.sleep(1000) + await driver.mouseClick({ + x: textInputComBounds.right - 30, y: textInputComBound.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1160 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1170 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1170") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1170 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1180 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1180") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1180 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1190 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1190") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1190 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1200 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1200") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1220 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + Settings.createWindow("testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1220") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACEMIX_1220 finish.`); + done() + }) + + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextAttributeStringConstructsTest/UIComponentTextAttributeStringConstructs.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextAttributeStringConstructsTest/UIComponentTextAttributeStringConstructs.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..df7846686ee215f0a95af8a1875e571053e1ce2d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextAttributeStringConstructsTest/UIComponentTextAttributeStringConstructs.test.ets @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, Component } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextAttributeStringConstructsTest() { + + describe('UIComponentTextAttributeStringConstructsTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_ATTRIBUTE_STRING_CONSTRUCTS_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0460 + * @tc.desc Drag and drop attribute string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0460 start.`); + Settings.createWindow("testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0460") + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextAttributeStringConstructs0460')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextAttributeStringConstructs0460')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0460 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0220 + * @tc.desc Drag and drop attribute string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0220") + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextAttributeStringConstructs0220')); + await btn.click(); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0220 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0320 + * @tc.desc Drag and drop attribute string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0320 start.`); + Settings.createWindow("testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0320") + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextAttributeStringConstructs0320')); + await btn.click(); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0320 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0330 + * @tc.desc Drag and drop attribute string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0330 start.`); + Settings.createWindow("testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0330") + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextAttributeStringConstructs0330')); + await btn.click(); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0330 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0340 + * @tc.desc Drag and drop attribute string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0340 start.`); + Settings.createWindow("testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0340") + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextAttributeStringConstructs0340')); + await btn.click(); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0340 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0350 + * @tc.desc Drag and drop attribute string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0350") + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextAttributeStringConstructs0350')); + await btn.click(); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0350 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0360 + * @tc.desc Drag and drop attribute string + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0360 start.`); + Settings.createWindow("testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0360") + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextAttributeStringConstructs0360')); + await btn.click(); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0360 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextAttributeText/UIComponentTextAttribute.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextAttributeText/UIComponentTextAttribute.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..422ad1f4172a93728dbc74aac2b2c5ac603fffd9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextAttributeText/UIComponentTextAttribute.test.ets @@ -0,0 +1,1763 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextAttribute() { + + describe('UIComponentTextAttribute', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_ATTRIBUTE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0010 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0010 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0010'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0010')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0020 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0020 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0020'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0020')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0030 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0030 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0030'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0030')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0040 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0040 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0040'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0040')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0050 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0050 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0050'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0050')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0060 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0060 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0060'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0060')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0080 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0080 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0080'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0080')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0090 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0090 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0090'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0090')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0100 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0100 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0100'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0100')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0110 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0110 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0110'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0110')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0120 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0120 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0120'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0120')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0130 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0130 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0130'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0130')); + await textInput.click(); + await Utils.sleep(1000); + let tp1 = await driver.findComponent(ON.id('tp1')); + await tp1.click(); + await Utils.sleep(200); + let tp2 = await driver.findComponent(ON.id('tp2')); + await tp2.click(); + await Utils.sleep(200); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0140 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0140 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0140'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0140')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0150 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0150 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0150'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0150')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0160 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0160 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0160'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0160')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0170 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0170 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0170'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0170')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0170 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0180 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0180 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0180'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0180')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0180 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0190 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0190 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0190'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0190')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0190 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0200 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0200 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0200'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0200')); + await textInput.click(); + await Utils.sleep(1000); + let tp1 = await driver.findComponent(ON.id('tp1')); + await tp1.click(); + await Utils.sleep(200); + let tp2 = await driver.findComponent(ON.id('tp2')); + await tp2.click(); + await Utils.sleep(200); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0200 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0210 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0210 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0210'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0210')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0210 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0220 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0220 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0220'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0220')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0220 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0230 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0230 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0230'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0230')); + await textInput.click(); + await Utils.sleep(1000); + let addWidth = await driver.findComponent(ON.id('addWidth')); + await addWidth.click(); + await Utils.sleep(200); + let changeWidth = await driver.findComponent(ON.id('changeWidth')); + await changeWidth.click(); + await Utils.sleep(200); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0230 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0240 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0240 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0240'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0240')); + await textInput.click(); + await Utils.sleep(1000); + let addWidth = await driver.findComponent(ON.id('addWidth')); + await addWidth.click(); + await Utils.sleep(200); + let changeWidth = await driver.findComponent(ON.id('changeWidth')); + await changeWidth.click(); + await Utils.sleep(200); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0240 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0250 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0250 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0250'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0250')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0250 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0260 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0260 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0260 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0260'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0260')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0260 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0270 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0270 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0270 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0270'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0270')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0270 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0280 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0280 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0280 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0280'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0280')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0280 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0290 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0290 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0290 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0290'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0290')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0290 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0300 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0300 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0300 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0300'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0300')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0300 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0310 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0310 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0310 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0310'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0310')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0310 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0320 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0320 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0320 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0320'); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0320')); + await textArea.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0320 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0330 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0330 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0330 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0330'); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0330')); + await textArea.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0330 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0340 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0340 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0340 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0340'); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0340')); + await textArea.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let tp1 = await driver.findComponent(ON.id('tp1')); + await tp1.click(); + await Utils.sleep(200); + let tp2 = await driver.findComponent(ON.id('tp2')); + await tp2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0340 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0350 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0350 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0350 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0350'); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0350')); + await textArea.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0350 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0360 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0360 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0360 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0360'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0360')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0360 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0370 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0370 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0370'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0370')); + await textInput.click(); + await Utils.sleep(1000); + let tp1 = await driver.findComponent(ON.id('tp1')); + await tp1.click(); + await Utils.sleep(200); + let tp2 = await driver.findComponent(ON.id('tp2')); + await tp2.click(); + await Utils.sleep(200); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0370 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0380 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0380 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0380 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0380'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0380')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0380 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0390 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0390 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0390 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0390'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0390')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0390 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0400 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0400 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0400'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0400')); + await textInput.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0400 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0410 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0410 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0410 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0410'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0410')); + await textInput.longClick(); + await Utils.sleep(1000); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0410 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0420 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0420 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0420 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0420'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0420')); + await textInput.click(); + await Utils.sleep(1000); + let select: Component = await driver.findComponent(ON.id('select')); + await select?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0420 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0430 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0430 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0430 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0430'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0430')); + await textInput.longClick(); + await Utils.sleep(1000); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0430 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0440 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0440 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0440 start.`); + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0440'); + await Utils.sleep(500); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0440_01')); + await textArea.longClick(); + await Utils.sleep(500); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(100); + let textArea1 = await driver.findComponent(ON.id('UIComponentTextAttribute0440_02')); + await textArea1.longClick(); + await Utils.sleep(500); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await selectAll1?.click(); + await Utils.sleep(100); + let textArea2 = await driver.findComponent(ON.id('UIComponentTextAttribute0440_03')); + await textArea2.longClick(); + await Utils.sleep(500); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await selectAll2?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0440 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0450 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0450 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0450'); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0450')); + await textArea.click(); + await Utils.sleep(1000); + let change: Component = await driver.findComponent(ON.id('change')); + await change?.click(); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(1000); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0440 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0460 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0460 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0460'); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0460')); + await textArea.click(); + await Utils.sleep(1000); + let change: Component = await driver.findComponent(ON.id('change')); + await change?.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0440 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0470 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0470 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0470 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0470'); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0470 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0480 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0480 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0480 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0480'); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0480 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0490 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0490 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0490 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0490'); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0490 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0500 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0500 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0500 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0500'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0500')); + await textInput.longClick(); + await Utils.sleep(1000); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(1000); + let ch1 = await driver.findComponent(ON.id('ch1')); + await ch1.click(); + await Utils.sleep(200); + let ch2 = await driver.findComponent(ON.id('ch2')); + await ch2.click(); + await Utils.sleep(200); + let ch3 = await driver.findComponent(ON.id('ch3')); + await ch3.click(); + await Utils.sleep(200); + let ch4 = await driver.findComponent(ON.id('ch4')); + await ch4.click(); + await Utils.sleep(200); + let ch5 = await driver.findComponent(ON.id('ch5')); + await ch5.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0500 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0510 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0510 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0510 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0510'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0510')); + await textInput.click(); + await Utils.sleep(1000); + let select: Component = await driver.findComponent(ON.id('select')); + await select?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0510 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0520 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0520 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0520 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0520'); + await Utils.sleep(1000); + let textInput = await driver.findComponent(ON.id('UIComponentTextAttribute0520')); + await textInput.longClick(); + await Utils.sleep(1000); + let select: Component = await driver.findComponent(ON.text('全选')); + await select?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0520 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0530 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0530 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0530 start.`); + let driver = Driver.create(); + await Utils.sleep(500); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0530'); + await Utils.sleep(500); + let textArea = await driver.findComponent(ON.id('UIComponentTextAttribute0530_01')); + await textArea.longClick(); + await Utils.sleep(500); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await selectAll?.click(); + await Utils.sleep(100); + let textArea1 = await driver.findComponent(ON.id('UIComponentTextAttribute0530_02')); + await textArea1.longClick(); + await Utils.sleep(500); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await selectAll1?.click(); + await Utils.sleep(100); + let textArea2 = await driver.findComponent(ON.id('UIComponentTextAttribute0530_03')); + await textArea2.longClick(); + await Utils.sleep(500); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await selectAll2?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0530 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0540 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0540 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0540 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0540'); + await Utils.sleep(1000); + let search = await driver.findComponent(ON.id('UIComponentTextAttribute0540')); + await search.longClick(); + await Utils.sleep(1000); + let select: Component = await driver.findComponent(ON.text('全选')); + await select?.click(); + await Utils.sleep(1000); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy?.click(); + await Utils.sleep(1000); + let search01 = await driver.findComponent(ON.id('UIComponentTextAttribute0540_01')); + await search01.click(); + await Utils.sleep(1000); + await search01.click(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await paste?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0540 end.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0550 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0550 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0550 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0550'); + await Utils.sleep(1000); + let search = await driver.findComponent(ON.id('UIComponentTextAttribute0550')); + await search.longClick(); + await Utils.sleep(1000); + let select: Component = await driver.findComponent(ON.text('全选')); + await select?.click(); + await Utils.sleep(1000); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy?.click(); + await Utils.sleep(1000); + let search01 = await driver.findComponent(ON.id('UIComponentTextAttribute0550_01')); + await search01.click(); + await Utils.sleep(1000); + await search01.click(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await paste?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0550 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0560 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0560 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0560 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0560'); + await Utils.sleep(1000); + let search = await driver.findComponent(ON.id('UIComponentTextAttribute0560')); + await search.inputText('aaaaaaa'); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0560 end.`); + done(); + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0570 +* @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0570 +* @tc.desc text Attribute +*/ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0570 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0570'); + await Utils.sleep(1000); + let search = await driver.findComponent(ON.id('UIComponentTextAttribute0570')); + let change1: Component = await driver.findComponent(ON.id('change1')); + await change1?.click(); + await Utils.sleep(100); + let change2: Component = await driver.findComponent(ON.id('change2')); + await change2?.click(); + await Utils.sleep(100); + let change3: Component = await driver.findComponent(ON.id('change3')); + await change3?.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let select: Component = await driver.findComponent(ON.text('全选')); + await select?.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy?.click(); + await Utils.sleep(100); + let search01 = await driver.findComponent(ON.id('UIComponentTextAttribute0570_01')); + await search01.click(); + await Utils.sleep(100); + await search01.click(); + await Utils.sleep(100); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await paste?.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0570 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0640 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0640 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0640 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0640'); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextAttribute0640')); + await Utils.sleep(200); + await search.click(); + await Utils.sleep(1000); + await Utils.lockAndUnlock(driver); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0640 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0600 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0600 + * @tc.desc text Attribute + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0600 start.`); + let driver = Driver.create(); + await Utils.sleep(1000); + Settings.createWindow('testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0600'); + await Utils.sleep(1000); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextAttribute0600')); + await Utils.sleep(200); + await search.longClick(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_0600 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonCopyOptionDraggableTest/UIComponentTextCommonCopyOptionDraggableTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonCopyOptionDraggableTest/UIComponentTextCommonCopyOptionDraggableTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b9a310e3b0c54c3e1e23daebc097be1f597aa9e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonCopyOptionDraggableTest/UIComponentTextCommonCopyOptionDraggableTest.test.ets @@ -0,0 +1,1237 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, Component, ON, MouseButton } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextCommonCopyOptionDraggableTest() { + + describe('UIComponentTextCommonCopyOptionDraggableTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_COPYOPTION_DRAGGABLE_0010_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0010'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(1000); + await text.dragTo(textInput) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0010'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(100); + await btn.longClick(); + await Utils.sleep(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0010')); + await Utils.sleep(1000); + await text.dragTo(textInput) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0010_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0020'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0020'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await btn.longClick(); + await Utils.sleep(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0020')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0020_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0030 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0030'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0030')); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0030')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll1.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0030')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll2.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0030')); + await Utils.sleep(1000); + await text.dragTo(textInput) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0040 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0040'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0040')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0040')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0040')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0040')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0060 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0060'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0060')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0060')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.mouseClick(textAreaPoint, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(100); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0060')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.mouseClick(searchPoint, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0060')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + let textInputPoint = await textInput.getBoundsCenter(); + await Utils.sleep(100); + await driver.mouseClick(textInputPoint, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0070 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0070'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextCommonCopyOptionDraggable0070')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0070')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0070')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll1.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0070')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + await Utils.sleep(100); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll2.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0070')); + await Utils.sleep(1000); + await text.dragTo(textInput) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0080 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0080'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextCommonCopyOptionDraggable0080')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0080')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0080')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0080')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0080')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0090 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0090'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0090')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0090')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0090')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0100 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0100'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0100')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0100')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll1.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0100')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll2.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0100')); + await Utils.sleep(1000); + await text.dragTo(textInput) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0110 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0110'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0110')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0110')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0110')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0110')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0120 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0120'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0120')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0120')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll1.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0120')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll2.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0120')); + await Utils.sleep(1000); + await text.dragTo(textInput) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0130 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0130'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0130')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0130')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0130')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0130')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0140 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0140'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0140')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0140')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0150 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0150'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0150')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0150')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0150')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0150')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0160 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0160'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0160')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0160')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll1.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0160')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll2.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0160')); + await Utils.sleep(100); + await text.dragTo(textInput) + await Utils.sleep(100); + await textInput.doubleClick() + await Utils.sleep(100); + await textArea.longClick() + await Utils.sleep(100); + await textInput.longClick() + await Utils.sleep(100); + let btn: Component = + await driver.findComponent(ON.id('btnUIComponentTextCommonCopyOptionDraggable0160')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0170 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0170 start.`); + Settings.createWindow('testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0170'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0170')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0170')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0170')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + await search.longClick(); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0170')); + await Utils.sleep(100); + await textInput.click(); + await Utils.sleep(100); + await textInput.longClick(); + await Utils.sleep(1000); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(100); + let btn: Component = + await driver.findComponent(ON.id('btnUIComponentTextCommonCopyOptionDraggable0170')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0170 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0050 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0050 start.`); + Settings.createWindow( + 'testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0050' + ); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0050')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0050')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll1: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll1.click(); + await Utils.sleep(100); + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0050')); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, searchPoint.x, searchPoint.y) + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + await Utils.sleep(100); + let selectAll2: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll2.click(); + await Utils.sleep(100); + let textInput: Component = + await driver.findComponent(ON.id('TextInputUIComponentTextCommonCopyOptionDraggable0050')); + await Utils.sleep(1000); + await text.dragTo(textInput) + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0050 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180_1 start.`); + Settings.createWindow( + 'testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0180' + ); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0180')); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(1000); + // 切换横屏 + Settings.changeOrientation(); + + await Utils.sleep(1000); + let textPoint = await text.getBoundsCenter(); + await Utils.sleep(100); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCopyOptionDraggable0180')); + await Utils.sleep(100); + let textAreaPoint = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.drag(textPoint.x, textPoint.y, textAreaPoint.x, textAreaPoint.y) + await Utils.sleep(1000); + // 切换竖屏 + Settings.changeOrientation(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180_2 start.`); + Settings.createWindow( + 'testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0180' + ); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextUIComponentTextCommonCopyOptionDraggable0180')); + await Utils.sleep(100); + await text.longClick(); + await Utils.sleep(100); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(100); + await selectAll.click(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + + // 切换横屏 + Settings.changeOrientation(); + + let search: Component = await driver.findComponent(ON.id('SearchUIComponentTextCommonCopyOptionDraggable0180')); + await Utils.sleep(100); + await search.click(); + await Utils.sleep(100); + let searchPoint = await search.getBoundsCenter(); + await Utils.sleep(100); + await driver.mouseClick(searchPoint, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(1000); + let paste1: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste1.click(); + await Utils.sleep(100); + // 切换竖屏 + Settings.changeOrientation(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_COPYOPTION_DRAGGABLE_0180_2 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2108e2165176f71d51ee8a10fd2a820c0d106b7d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan.test.ets @@ -0,0 +1,1337 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, Component, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextCommonCustomDrawingSpan() { + + describe('UIComponentTextCommonCustomDrawingSpan', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_CUSTOM_DRAWINGSPAN_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0010 + * @tc.desc Rewrite width + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan001"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan001")); + await Utils.sleep(2000); + component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0020 + * @tc.desc Input Outliers + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan002"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan002")); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0040 + * @tc.desc Rewrite height + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan004"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan004")); + await Utils.sleep(1000); + component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0050 + * @tc.desc Input Outliers + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan005"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan005")); + await Utils.sleep(1000); + component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0070 + * @tc.desc Draw content with graphic and text background colors + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan007"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0080 + * @tc.desc Draw content with text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan008"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0090 + * @tc.desc Draw nothing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan009"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0120 + * @tc.desc Set text to bind SelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan012"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan012")); + await Utils.sleep(2000); + component.longClick(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0150 + * @tc.desc Call getString to obtain the Custom Span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan015"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan015")); + await Utils.sleep(1000); + component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0160 + * @tc.desc Obtain the length of CustomSpan + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan016"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan016")); + await Utils.sleep(1000); + component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0200 + * @tc.desc Obtain the length of CustomSpan + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan020"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let removeButton = await driver.findComponent(ON.id("removeButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0210 + * @tc.desc Obtain the length of CustomSpan + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0210 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan021"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let removeButton = await driver.findComponent(ON.id("removeButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0220 + * @tc.desc Replace the selected Customs Span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan022"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan022")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0230 + * @tc.desc Replace the selected Customs Span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan023"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan023")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0270 + * @tc.desc Specify the new style for the specified type + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0270 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan027"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan027")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0280 + * @tc.desc Specify the new style for the specified type + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0280 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan028"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan028")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0320 + * @tc.desc Clear the specified range type style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0320 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan032"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan032")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0330 + * @tc.desc Clear the specified range type style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0330 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan033"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan033")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0340 + * @tc.desc Clear the specified range type style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0340 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan034"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan034")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0340 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0350 + * @tc.desc Clear the specified range type style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan035"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan035")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0360 + * @tc.desc Clear Content + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0360 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan036"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let removeButton = await driver.findComponent(ON.id("removeButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0370 + * @tc.desc Continuous clearing + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0370 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan037"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let removeButton = await driver.findComponent(ON.id("removeButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0380 + * @tc.desc Clear Content + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0380 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan038"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let removeButton = await driver.findComponent(ON.id("removeButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0380 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0390 + * @tc.desc Clear Content + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0390 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan039"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let removeButton = await driver.findComponent(ON.id("removeButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0390 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0400 + * @tc.desc Get length + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0400 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan040"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let removeButton = await driver.findComponent(ON.id("removeButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + removeButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0400 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0410 + * @tc.desc Clear Styles + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0410 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan041"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let clearButton = await driver.findComponent(ON.id("clearButton")); + await Utils.sleep(1000); + clearButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0410 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0420 + * @tc.desc Replace to the specified location + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0420 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan042"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let replaceButton = await driver.findComponent(ON.id("replaceButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + replaceButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0420 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0430 + * @tc.desc Replace to the specified location + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0430 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan043"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let replaceButton = await driver.findComponent(ON.id("replaceButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + replaceButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0430 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0440 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0440 + * @tc.desc Replace to the specified location + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0440 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan044"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let replaceButton = await driver.findComponent(ON.id("replaceButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + replaceButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0440 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0450 + * @tc.desc Replace to the specified location + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0450 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan045"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let replaceButton = await driver.findComponent(ON.id("replaceButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + replaceButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0450 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0460 + * @tc.desc Insert Content + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0450 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan046"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let insertButton = await driver.findComponent(ON.id("insertButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + insertButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0460 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0470 + * @tc.desc Insert Content + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0470 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan047"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let insertButton = await driver.findComponent(ON.id("insertButton")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + insertButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0470 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0480 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0480 + * @tc.desc Additional content + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0470 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan048"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let appendButton = await driver.findComponent(ON.id("appendButton")); + await Utils.sleep(1000); + appendButton.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0480 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0490 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0490 + * @tc.desc Long press on Custom Span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0470 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan049"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan049")); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0490 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0510 + * @tc.desc Set obscured + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0510 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan051"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan051")); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + await component.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0510 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520 + * @tc.desc Set hidden and visible settings + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan052"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan052")); + 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_COMMON_CUSTOM_DRAWINGSPAN_0520_1 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520 + * @tc.desc Set hidden and visible settings + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan052"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan052")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + await button.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0520_2 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0530 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0530 + * @tc.desc Set disable control + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0530 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan053"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("enabledButton")); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan053")); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + await component.longClick(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0530 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0540 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0540 + * @tc.desc Set drag and drop + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0540 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan054"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan054")); + let textArea = await driver.findComponent(ON.id('textArea')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + await component.dragTo(textArea) + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0540 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0550 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0550 + * @tc.desc Set padding + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0550 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan055"); + await Utils.sleep(2000) + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan055")); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0550 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0250 + * @tc.desc Specify the new style for the specified type + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0250"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan0250")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0250 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0260 + * @tc.desc Specify the new style for the specified type + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0250"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan0250")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0260 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0290 + * @tc.desc Specify the new style for the specified type + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0290 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0290"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan0290")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0290 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0300 + * @tc.desc Specify the new style for the specified type + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0290"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan0290")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0300 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0310 + * @tc.desc Specify the new style for the specified type + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0310 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0290"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan0290")); + await Utils.sleep(1000); + startButton.click(); + await Utils.sleep(1000); + lengthButton.click(); + await Utils.sleep(1000); + button.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0100 + * @tc.desc Set text to bind SelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0100 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan010" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan010")); + await Utils.sleep(2000); + await component.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0110 + * @tc.desc Set text to bind SelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0110 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan011" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan011")); + await Utils.sleep(1000); + await component.longClick(); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(500); + let textArea: Component = + await driver.findComponent(ON.id('TextAreaUIComponentTextCommonCustomDrawingSpan011')); + await textArea.click(); + await textArea.longClick(); + let paste2: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0130 + * @tc.desc Set text to bind SelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0130 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan013" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan013_btn1")); + await Utils.sleep(2000); + await component.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0140 + * @tc.desc Set text to bind SelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0140 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan014" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let component1 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan014_btn1")); + await Utils.sleep(1000); + await component1.click(); + + let component2 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan014_btn2")); + await Utils.sleep(1000); + await component2.click(); + + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0170 + * @tc.desc Set text to bind SelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0170 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan017" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let component1 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan017_btn1")); + await Utils.sleep(1000); + await component1.click(); + + let component2 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan017_btn2")); + await Utils.sleep(1000); + await component2.click(); + + let component3 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan017_btn3")); + await Utils.sleep(1000); + await component3.click(); + + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0190 + * @tc.desc Set text to bind SelectionMenu + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0190 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan019" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let component1 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan019_btn1")); + await Utils.sleep(1000); + await component1.click(); + + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0240 + * @tc.desc Replace the selected Customs Span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0240 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan024" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let startButton = await driver.findComponent(ON.id("startButton")); + let lengthButton = await driver.findComponent(ON.id("length")); + let button = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan024")); + await Utils.sleep(1000); + await startButton.click(); + await Utils.sleep(1000); + await lengthButton.click(); + 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_COMMON_CUSTOM_DRAWINGSPAN_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0500 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0500 + * @tc.desc Long press on Custom Span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0500 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan050"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan050")); + let point = await component.getBoundsCenter(); + await Utils.sleep(1000); + for (let index = 0; index <2 ; index++) { + await driver.click(point.x,point.y); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0500 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0560 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0560 + * @tc.desc Set padding + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0560 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan056"); + await Utils.sleep(2000) + let driver: Driver = Driver.create(); + let component1 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan056_1")); + await Utils.sleep(1000); + await component1.click(); + let component2 = await driver.findComponent(ON.id("UIComponentTextCommonCustomDrawingSpan056_2")); + await Utils.sleep(1000); + await component2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CUSTOM_DRAWINGSPAN_0560 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonItscaAttributeUpdaterTest/UIComponentTextCommonItscaAttributeUpdater.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonItscaAttributeUpdaterTest/UIComponentTextCommonItscaAttributeUpdater.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c8d9430bae990739c4f286ccf4b78c76e4b11b8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonItscaAttributeUpdaterTest/UIComponentTextCommonItscaAttributeUpdater.test.ets @@ -0,0 +1,346 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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 { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextCommonItscaAttributeUpdater() { + + describe('UIComponentTextCommonItscaAttributeUpdater', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_COMON_ITSCAATTRIBUTEUPDATER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0010 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater001"); + let driver: Driver = Driver.create(); + let component = await driver.findComponent(ON.id("UIComponentTextCommonItscaAttributeUpdater001")); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0020 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater002"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id("UIComponentTextCommonItscaAttributeUpdater002")); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0030 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater003"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id("UIComponentTextCommonItscaAttributeUpdater003")); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0040 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater004"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id("UIComponentTextCommonItscaAttributeUpdater004")); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0050 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater005"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id("UIComponentTextCommonItscaAttributeUpdater005")); + component.click(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + changeBtn.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_ITSCAATTRIBUTEUPDATER_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_ITSCAATTRIBUTEUPDATER_0130 + * @tc.desc AttributeUpdater替换Span类型 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_ITSCAATTRIBUTEUPDATER_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_ITSCAATTRIBUTEUPDATER_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater013"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id("UIComponentTextCommonItscaAttributeUpdater013_text")); + component.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_ITSCAATTRIBUTEUPDATER_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0060 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0060 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater006" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let component = await driver.findComponent(ON.id("UIComponentTextCommonItscaAttributeUpdater006")); + await component.click(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + await changeBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0070 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0070 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater007" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + await changeBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0080 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0080 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater008" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + await changeBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0080 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0090 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0090 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater009" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + await changeBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0090 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0100 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0100 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater010" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + await changeBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0110 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0110 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater011" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + await changeBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0120 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0120 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater012" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let changeBtn = await driver.findComponent(ON.id("change")); + await changeBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0140 + * @tc.desc Replace text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0140 start.`); + Settings.createWindow( + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater014" + ); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let changeBtn1 = await driver.findComponent(ON.id("change1")); + await changeBtn1.click(); + await Utils.sleep(1000); + let changeBtn2 = await driver.findComponent(ON.id("change2")); + await changeBtn2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMON_ITSCAATTRIBUTEUPDATER_0140 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkInteractionTest/UIComponentTextHyperlinkInteraction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkInteractionTest/UIComponentTextHyperlinkInteraction.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..3827c39ab96eb0d4d06d4f2afb7f579834b24130 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkInteractionTest/UIComponentTextHyperlinkInteraction.test.ets @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, 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, Component, ON, MouseButton } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextHyperlinkInteraction() { + + describe('UIComponentTextHyperlinkInteraction', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_HYPERLINK_INTERACTION_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0030"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextHyperlinkInteraction0030_001')); + let point = await button.getBoundsCenter(); + await driver.mouseClick({x: point.x, y: point.y}, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(4000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0030 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0040 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0040"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextHyperlinkInteraction0040_001')); + let point = await button.getBoundsCenter(); + await driver.mouseMoveTo({x: point.x, y: point.y}); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0040 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0080 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0080"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextHyperlinkInteraction0080_001')); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + let point = await button.getBoundsCenter(); + await driver.mouseMoveTo({x: point.x, y: point.y}); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0080 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0090 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0090"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextHyperlinkInteraction0090_001')); + let point = await button.getBoundsCenter(); + await driver.mouseMoveTo({x: point.x, y: point.y - 3}); + await Utils.sleep(2); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERACTION_0090 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextImagePrivacySensitiveTest/UIComponentTextImagePrivacySensitive.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextImagePrivacySensitiveTest/UIComponentTextImagePrivacySensitive.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0df948617aba019e84777f97e5c29462369f6e74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextImagePrivacySensitiveTest/UIComponentTextImagePrivacySensitive.test.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextImagePrivacySensitive() { + + describe('UIComponentTextImagePrivacySensitive', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_IMAGE_PRIVACYSENSITIVE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_IMAGE_PRIVACYSENSITIVE_0010 + * @tc.desc Set privacySensitive + */ + it('SUB_ACE_UI_COMPONENT_TEXT_IMAGE_PRIVACYSENSITIVE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_IMAGE_PRIVACYSENSITIVE_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextImagePrivacySensitive/UIComponentTextImagePrivacySensitive001'); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_IMAGE_PRIVACYSENSITIVE_0010 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInlineTest/UIComponentTextInline.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInlineTest/UIComponentTextInline.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fca30beec290b5c4301f3b48964e1142ce014fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInlineTest/UIComponentTextInline.test.ets @@ -0,0 +1,431 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, Component, ON, MouseButton } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextInline() { + + describe('UIComponentTextInline', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_INLINE_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0010 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0010"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0010_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0010 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0020 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0020"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0020_001')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0020 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0030"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input : Component = await driver.findComponent(ON.id('UIComponentTextInline0030_001')); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0030_002')); + await input.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_1 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0030"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input : Component = await driver.findComponent(ON.id('UIComponentTextInline0030_001')); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0030_002')); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_2 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0030"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input : Component = await driver.findComponent(ON.id('UIComponentTextInline0030_001')); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0030_002')); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0030_3 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0060 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0060"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0060_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0070 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0070"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0070_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0070 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0080 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0080"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0080_001')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0080 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0090"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input : Component = await driver.findComponent(ON.id('UIComponentTextInline0090_001')); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0090_002')); + await input.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_1 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0090"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input : Component = await driver.findComponent(ON.id('UIComponentTextInline0090_001')); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0090_002')); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_2 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0090"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let input : Component = await driver.findComponent(ON.id('UIComponentTextInline0090_001')); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0090_002')); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0090_3 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0120 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0120"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0120_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0120 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0130"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0130_001')); + await button.click(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130_1 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextInline/UIComponentTextInline0130"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextInline0130_001')); + await button.click(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(1000); + Settings.changeOrientation(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_INLINE_0130_2 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputNumberDecimalTest/UIComponentTextInputNumberDecimalTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputNumberDecimalTest/UIComponentTextInputNumberDecimalTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4a905f587f424e0c1c40b92d93a6a4b3bf4efca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputNumberDecimalTest/UIComponentTextInputNumberDecimalTest.test.ets @@ -0,0 +1,291 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextInputNumberDecimalTest() { + + describe('UIComponentTextInputNumberDecimalTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTINPUT_NUMBER_DECIMAL_0010 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0010 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0010'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0010')); + await Utils.sleep(500); + await textInput.inputText('123456'); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0010_1')); + await Utils.sleep(500); + await textInput1.inputText('123.456'); + await Utils.sleep(1000); + let textInput2: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0010_2')); + await Utils.sleep(500); + await textInput2.inputText('123456.'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0020 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0020 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0020'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0020')); + await Utils.sleep(500); + await textInput.inputText('123.456'); + await Utils.sleep(500); + await driver.triggerKey(2044); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0030 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0030 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0030'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0030')); + await Utils.sleep(500); + await textInput.inputText('123.5.6'); + await Utils.sleep(500); + await driver.triggerKey(2044); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0040 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0040 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0040'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0040')); + await Utils.sleep(500); + await textInput.inputText('aaaa123.5.6'); + await Utils.sleep(500); + await driver.triggerKey(2044); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0050 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0050 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0050 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0050'); + let driver = Driver.create(); + let textInput1: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0050_1')); + await Utils.sleep(500); + await textInput1.inputText('123.5.6'); + await Utils.sleep(500); + await textInput1.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 copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500); + await copy.click(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0050')); + await Utils.sleep(500); + await textInput.doubleClick(); + await Utils.sleep(500); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500); + await paste.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0060 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0060 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0060'); + let driver = Driver.create(); + let textInput1: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0060_1')); + await Utils.sleep(500); + await textInput1.inputText('123.5.6'); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0060')); + await Utils.sleep(500); + await textInput.inputText('dadada123@.da1'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0070 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0070 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0070'); + let driver = Driver.create(); + let textInput1: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_1')); + await Utils.sleep(500); + await textInput1.inputText('123.5.6'); + await Utils.sleep(500); + let textInput2: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_2')); + await Utils.sleep(500); + await textInput2.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput3: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_3')); + await Utils.sleep(500); + await textInput3.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput4: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_4')); + await Utils.sleep(500); + await textInput4.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput5: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_5')); + await Utils.sleep(500); + await textInput5.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput6: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_6')); + await Utils.sleep(500); + await textInput6.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput7: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_7')); + await Utils.sleep(500); + await textInput7.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput8: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_8')); + await Utils.sleep(500); + await textInput8.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput9: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_9')); + await Utils.sleep(500); + await textInput9.inputText('dadada123@.da1'); + await Utils.sleep(500); + let textInput10: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0070_10')); + await Utils.sleep(500); + await textInput10.inputText('dadada123@.da1'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0080 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0080 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0080'); + let driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('TextInputUIComponentTextInputNumberDecimal0080')); + await Utils.sleep(500); + await textInput.inputText('123abc'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0100 + * @tc.name SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0100 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0100'); + let driver = Driver.create(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_NUMBER_DECIMAL_0100 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputSecurityKeyboardScrollTest/UIComponentTextInputSecurityKeyboardScrollTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputSecurityKeyboardScrollTest/UIComponentTextInputSecurityKeyboardScrollTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..47cd78c4a250fd43484bab6331bd44257c837388 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputSecurityKeyboardScrollTest/UIComponentTextInputSecurityKeyboardScrollTest.test.ets @@ -0,0 +1,386 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextInputSecurityKeyboardScrollTest() { + + describe('UIComponentTextInputSecurityKeyboardScrollTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0010 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0010 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0010'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0010')); + await Utils.sleep(500); + await textInput.inputText('adawdawd1213'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0020 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0020 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0020'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0020')); + await Utils.sleep(500); + await textInput.inputText('adawdawd1213'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0030 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0030 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0030'); + let driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0030')); + await Utils.sleep(500); + await textInput.inputText('adawdawd1213'); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0030_1')); + await Utils.sleep(500); + await textInput1.inputText('adawdawd1213'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0050 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0040 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0040'); + let driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0040')); + await Utils.sleep(500); + await textInput.inputText('adawdawd1213'); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0040_1')); + await Utils.sleep(500); + await textInput1.inputText('adawdawd1213'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0050 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0050 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0050 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0050'); + let driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0050')); + await Utils.sleep(500); + await textInput.inputText('adawdawd1213'); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0050_1')); + await Utils.sleep(500); + await textInput1.inputText('adawdawd1213'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0060 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0060 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0060'); + let driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0060')); + await Utils.sleep(500); + await textInput.inputText('adawdawd1213'); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0060_1')); + await Utils.sleep(500); + await textInput1.inputText('adawdawd1213'); + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextInputSecurityKeyboardScroll0060')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(500); + await textInput1.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0070 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0070 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0070'); + let driver = Driver.create(); + await Utils.sleep(500); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0070')); + await Utils.sleep(500); + await textInput.inputText('adawdawd1213'); + 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 copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500); + await copy.click(); + await Utils.sleep(500); + let textInput1: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0070_1')); + await Utils.sleep(500); + await textInput1.longClick(); + await Utils.sleep(500); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500); + await paste.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0080 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0080 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0080'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0080')); + await Utils.sleep(500); + await textInput.inputText('adad123'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0090 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0090 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0090'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0090')); + await Utils.sleep(500); + await textInput.inputText('12345678915151515'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0100 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0100 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0100'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0100')); + await Utils.sleep(500); + await textInput.inputText('1234512345123451234512'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0110 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0110 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0110'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0110')); + await Utils.sleep(500); + await textInput.inputText('1234512345123451234512'); + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextInputSecurityKeyboardScroll0110')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0120 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0120 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0120'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0120')); + await Utils.sleep(500); + await textInput.inputText('1234512345123451234512123456456456654664646464646466'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0130 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0130 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0130'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0130')); + await Utils.sleep(500); + await textInput.inputText('1234566'); + await Utils.sleep(500); + let point = await textInput.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x + 320, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0140 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0140 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0140'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0140')); + await Utils.sleep(500); + await textInput.inputText('1234566'); + await Utils.sleep(500); + await driver.triggerKey(2055) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0150 + * @tc.name SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0150 + * @tc.desc + */ + it('SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0150'); + let driver = Driver.create(); + let textInput: Component = await driver.findComponent(ON.id('UIComponentTextInputSecurityKeyboardScroll0150')); + await Utils.sleep(500); + await textInput.inputText('1234566'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_TEXTINPUT_SECURITY_KEYBOARD_SCROLL_0150 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputTest/UIComponentTextInput.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputTest/UIComponentTextInput.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..dec6b5c02cb0759c4e5cf32264ef03b489a98a1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextInputTest/UIComponentTextInput.test.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 { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextInput0010() { + + describe('UIComponentTextInput0010', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_ANALYSE_UI_COMPONENT_TEXTINPUT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ANALYSE_UI_COMPONENT_TEXTINPUT_0010 start.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, () => { + }) + Settings.createWindow("testability/pages/UIComponentTextInput/UIComponentTextInput0010") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let ButtonCom2 = await driver.findComponent(ON.id('button2')) + await Utils.sleep(1000) + await ButtonCom2.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + let ButtonCom1 = await driver.findComponent(ON.id('button1')) + await Utils.sleep(1000) + await ButtonCom1.click() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextReverseAnalysisTest/UIComponentTextReverseAnalysis.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextReverseAnalysisTest/UIComponentTextReverseAnalysis.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe68e607db87e986a920e9fe84ff8a7a67aa43f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextReverseAnalysisTest/UIComponentTextReverseAnalysis.test.ets @@ -0,0 +1,331 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, Component, ON, MouseButton } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextReverseAnalysis() { + + describe('UIComponentTextReverseAnalysis', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_REVERSEANALYSIS_0200 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0200 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0200"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('insert')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0200 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0300 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0300 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0300"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0300_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0300 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0350 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0350 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0350"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0350_001')); + let point = await button.getBoundsCenter(); + await driver.mouseMoveTo({x: point.x, y: point.y}); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0350 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0480 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0480 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0480 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0480"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0480_001')); + await button.click(); + await Utils.sleep(2000); + await button.inputText('text'); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0480 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0490 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0490 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0490 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0490"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0490_001')); + await button.click(); + await Utils.sleep(2000); + await button.inputText('text'); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0490 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0500 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0500 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0500 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0500"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0500_001')); + await button.click(); + await Utils.sleep(2000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0500 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0510 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0510 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0510 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0510"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0510_001')); + await button.click(); + await Utils.sleep(2000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0510 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0390 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0390 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0390 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0390"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + await Utils.homeAndBack(driver); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0390_001')); + await button.click(); + await Utils.sleep(1000); + await button.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0390 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0420 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0420 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0420 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0420"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + await Utils.homeAndBack(driver); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0420_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0420 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0430 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0430 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0430 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0430"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + await Utils.homeAndBack(driver); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0430_001')); + await button.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0430 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0400 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0400 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0400 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0400"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0400_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0400 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0410 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0410 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0410 start.`); + Settings.createWindow("testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0410"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let button : Component = await driver.findComponent(ON.id('UIComponentTextReverseAnalysis0410_001')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_REVERSEANALYSIS_0410 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaActionTest/UIComponentTextTextAreaActionTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaActionTest/UIComponentTextTextAreaActionTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..54ea1251f5681688353c716fb269c75307365f7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaActionTest/UIComponentTextTextAreaActionTest.test.ets @@ -0,0 +1,314 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, Component, ON } from '@kit.TestKit'; +import { KeyCode } from '@kit.InputKit'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextAreaActionTest() { + + describe('UIComponentTextTextAreaActionTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_ACTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0010'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0010')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0020 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0020'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0020')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.longClick(point.x,point.y - 20); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0030 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0030'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0030')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await textArea.longClick() + await Utils.sleep(100); + await driver.pressBack(); + await Utils.sleep(100); + await driver.pressBack(); + await Utils.sleep(100); + await driver.pressBack(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0040 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0040'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0040')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let textArea1: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0040_1')); + await Utils.sleep(100); + await textArea1.click(); + await Utils.sleep(100); + await textArea.click() + await Utils.sleep(100); + await driver.triggerKey(2040) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0080 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0080'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0080')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(100); + let copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(100); + await copy.click(); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(100); + await paste.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0090 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0090'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0090')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + await driver.triggerKey(2040) + await Utils.sleep(2000); + await driver.triggerKey(2014); + await Utils.sleep(100); + await driver.triggerKey(2014); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0100 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0100'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0100')); + await Utils.sleep(100); + await textArea.doubleClick(); + await Utils.sleep(100); + let textArea1: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0100_1')); + await Utils.sleep(100); + await textArea1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0070 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0070'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaAction0070')); + await Utils.sleep(100); + await textArea.longClick(); + await driver.triggerKey(KeyCode.KEYCODE_H); + await driver.triggerKey(KeyCode.KEYCODE_E); + await driver.triggerKey(KeyCode.KEYCODE_L); + await driver.triggerKey(KeyCode.KEYCODE_L); + await driver.triggerKey(KeyCode.KEYCODE_O); + await Utils.sleep(100); + await textArea.longClick(); + let selectAll: Component = await driver.findComponent(ON.text('全选')); + await Utils.sleep(500); + await selectAll?.click(); + let point = await textArea.getBounds(); + await driver.click(point.left + 200, point.bottom + 100); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0110 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0110'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(1000); + let textArea: Component = await driver.findComponent(ON.id('TextTextAreaAction0110')); + let text: Component = await driver.findComponent(ON.id('TextTextAreaAction0110_1')); + await Utils.sleep(1000); + await textArea.inputText('textArea:测试getTextContentLineCount'); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(200); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(200); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ACTION_0110 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEnhancesTest/UIComponentTextTextAreaEnhancesTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEnhancesTest/UIComponentTextTextAreaEnhancesTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..48c5254847ce9fa2f980ab34f1bad9d72ed33988 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEnhancesTest/UIComponentTextTextAreaEnhancesTest.test.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, Component, ON } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextAreaEnhancesTest() { + + describe('UIComponentTextTextAreaEnhancesTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTARE_ENHANCES_0900 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_0900 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_0900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_0900 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances0900'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnhances0900')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_0900 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_2500 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_2500 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_2500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_2500 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances2500'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnhances2500')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1500); + windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTARE_ENHANCES_2500 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEnterkeyTypeTest/UIComponentTextTextAreaEnterkeyTypeTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEnterkeyTypeTest/UIComponentTextTextAreaEnterkeyTypeTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..75a5c0a9ba492ce01a43b8b71c6034dfd01bf3fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEnterkeyTypeTest/UIComponentTextTextAreaEnterkeyTypeTest.test.ets @@ -0,0 +1,442 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, Component, ON } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextAreaEnterkeyTypeTest() { + + describe('UIComponentTextTextAreaEnterkeyTypeTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0010 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0010 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0010'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0010')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0010')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0016 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0016 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0016', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0016 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0016'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0016')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0016')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0016 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0020 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0020 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0020'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0020')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0020')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0030 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0030 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0030'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0030')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0030')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0040 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0040 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0040'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0040')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0040')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0050 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0050 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0050 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0050'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0050')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0050')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0060 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0060 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0060'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0060')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0060')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0080 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0080 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0080'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0080')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0080')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0090 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0090 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0090'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0090')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0090')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0090_1')); + await Utils.sleep(100); + await btn1.click(); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0100 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0100 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0100'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0100')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0100')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0100_1')); + await Utils.sleep(100); + await btn1.click(); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0110 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0110 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0110'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0110')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0110')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0110_1')); + await Utils.sleep(100); + await btn1.click(); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0120 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0120 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0120'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0120')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0120')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0120_1')); + await Utils.sleep(100); + await btn1.click(); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0130 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0130 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0130'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0130')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0130')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0130_1')); + await Utils.sleep(100); + await btn1.click(); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0140 + * @tc.name SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0140 + * @tc.desc + */ + it('SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0140'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0140')); + await Utils.sleep(100); + await btn.click(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEnterkeyType0140')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaEnterkeyType0140_1')); + await Utils.sleep(100); + await btn1.click(); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(100); + await driver.triggerKey(2054); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_0OMPONENT_TEXT_TEXTAREA_ENTERKEYTYPE_0140 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEvaSaveInputMethodTest/UIComponentTextTextAreaEvaSaveInputMethodTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEvaSaveInputMethodTest/UIComponentTextTextAreaEvaSaveInputMethodTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9709e556c95dcc0826c771c2685357d0b40f0391 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaEvaSaveInputMethodTest/UIComponentTextTextAreaEvaSaveInputMethodTest.test.ets @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, 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, Component, ON, MouseButton, DisplayRotation } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTextAreaEvaSaveInputMethodTest() { + + describe('UIComponentTextTextAreaEvaSaveInputMethodTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_EVASIVEINPUTMETHOD_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0130 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0130"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEvaSaveInputMethod0130')); + await Utils.sleep(100); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(100); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(200); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(200); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0130 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0140 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0140"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEvaSaveInputMethod0140')); + await Utils.sleep(500); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0140 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0150 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0150"); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaEvaSaveInputMethod0150')); + await Utils.sleep(500); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(500); + await Settings.changeOrientation(); + await Utils.sleep(200); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_EVASIVEINPUTMETHOD_0150 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterActionTest/UIComponentTextTextAreaInterActionTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterActionTest/UIComponentTextTextAreaInterActionTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..674c53df073291a8565a7f8466437f6f96a9ad67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterActionTest/UIComponentTextTextAreaInterActionTest.test.ets @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, 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, Component, ON, MouseButton } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTextAreaInterActionTest() { + + describe('UIComponentTextTextAreaInterActionTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_INTERACTION_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0010 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0010"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterAction0010')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(500); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await driver.drag(point.x + 300, point.y, point.x - 20, point.y) + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0010 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0030"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterAction0030')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + await textArea.longClick(); + await Utils.sleep(500); + let copy: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(200); + await copy.click(); + await Utils.sleep(200); + await driver.triggerCombineKeys(2072, 2014); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0030 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0040 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0040"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterAction0040')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await driver.mouseDrag({ + x: point.x + 300, y: point.y, + }, { + x: point.x - 20, y: point.y + }) + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERACTION_0040 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterActiveTest/UIComponentTextTextAreaInterActiveTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterActiveTest/UIComponentTextTextAreaInterActiveTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9cfe4d9baad7c951eac5a24d05c997eec7600f0b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterActiveTest/UIComponentTextTextAreaInterActiveTest.test.ets @@ -0,0 +1,373 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, Component, ON, MouseButton } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTextAreaInterActiveTest() { + + describe('UIComponentTextTextAreaInterActiveTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0010 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0010 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0010"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0010')); + await Utils.sleep(100); + await textArea.inputText('123ab?_!A123'); + await Utils.sleep(1000); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(1000); + await driver.click(point.x, point.y + 100) + await Utils.sleep(1000); + await textArea.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0010 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0020 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0020 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0020"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0020')); + await Utils.sleep(100); + await textArea.inputText('123ab?_!A123'); + await Utils.sleep(100); + await driver.triggerKey(2014) + await Utils.sleep(100); + await textArea.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0020 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0030 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0030"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0030')); + await Utils.sleep(100); + await textArea.inputText('123ab?_!A123aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + await Utils.sleep(100); + await textArea.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0030 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0040 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0040 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0040"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0040')); + await Utils.sleep(100); + await textArea.inputText('123ab?_!A123aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + await Utils.sleep(100); + await textArea.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0040 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0050 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0050 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0050"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0050')); + await Utils.sleep(100); + await textArea.inputText('123ab?_!A123aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + await Utils.sleep(100); + await textArea.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0050 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0060 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0060 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0060"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0060')); + await Utils.sleep(100); + await textArea.inputText('123ab?_!A123') + await Utils.sleep(100); + let btn: Component = await driver.findComponent(ON.id('btnTextAreaUIComponentTextTextAreaInterActive0060')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(100); + await textArea.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0060 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0070 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0070 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0070"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0070')); + await Utils.sleep(100); + await textArea.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0070 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0300 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0300 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0300"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0300')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0300 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0320 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0320 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0320"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0320')); + await Utils.sleep(100); + await textArea.inputText('aaaaaa'); + await Utils.sleep(100); + await driver.triggerCombineKeys(2047, 2099); + await Utils.sleep(1001); + await driver.triggerKey(2070); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0320 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0330 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0330 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0330 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0330"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0330')); + await Utils.sleep(100); + await textArea.inputText('aahello worldaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0330 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0340 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0340 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0340 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0340"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0340')); + await Utils.sleep(100); + await textArea.inputText('aahellodaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0340 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0350 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0350 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0350"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0350')); + await Utils.sleep(100); + await textArea.inputText('aahe大家好llo worldaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0350 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0360 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0360 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0360 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0360"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0360')); + await Utils.sleep(100); + await textArea.inputText('aahe大家好大家好dllo worldaaaa'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0360 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0370 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0370 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0370"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0370')); + await Utils.sleep(100); + await textArea.inputText('abc_ABC@#*/?llo world'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0370 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0380 + * @tc.name : SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0380 + * @tc.desc : + */ + it('SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0380 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0380"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterActive0380')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CONPONENT_TEXT_TEXTAREA_INTERACTIVE_0380 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterfaceTest/UIComponentTextTextAreaInterfaceTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterfaceTest/UIComponentTextTextAreaInterfaceTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..98acdcff36078e3868cacb33bfb2b89e7261e979 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaInterfaceTest/UIComponentTextTextAreaInterfaceTest.test.ets @@ -0,0 +1,203 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextAreaInterfaceTest() { + + describe('UIComponentTextTextAreaInterfaceTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_INTERFACE_0670 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0670 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0670 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0670'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0670')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0670 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0680 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0680 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0680 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0680'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0680')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0680 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0690 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0690 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0690 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0690'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0690')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0690 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0700 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0700 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0700 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0700'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0700')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0700 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0710 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0710 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0710 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0710'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0710')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0710 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0720 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0720 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0720 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0720'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0720')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0720 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0730 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0730 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0730 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0730'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0730')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0730 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0740 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0740 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0740 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0740'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface0740')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_0740 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_1020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_1020 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_1020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_1020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface1020'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaInterface1020')); + await Utils.sleep(100); + await textArea.inputText('大家好_helloadada'); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_INTERFACE_1020 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaLayoutTest/UIComponentTextTextAreaLayoutTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaLayoutTest/UIComponentTextTextAreaLayoutTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b57db91e08c30ebde59b40463701a99c444af168 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaLayoutTest/UIComponentTextTextAreaLayoutTest.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 { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextAreaLayoutTest() { + + describe('UIComponentTextTextAreaLayoutTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_LAYOUT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0010'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaLayout0010')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0020 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0020'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaLayout0020')); + await Utils.sleep(100); + await textArea.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_LAYOUT_0020 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaOnEditChangeTest/UIComponentTextTextAreaOnEditChangeTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaOnEditChangeTest/UIComponentTextTextAreaOnEditChangeTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7093e5348d658c1f75ce3bb9198c3ede3938418 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaOnEditChangeTest/UIComponentTextTextAreaOnEditChangeTest.test.ets @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, 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, Component, ON } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTextAreaOnEditChangeTest() { + + describe('UIComponentTextTextAreaOnEditChangeTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_ONEDITCHANGE_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0100 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0100"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('UIComponentTextTextAreaOnEditChange0100_textArea')); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0090 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0090'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let text: Component = await driver.findComponent(ON.id('TextAreaOnEditChange0090')); + let textArea: Component = await driver.findComponent(ON.id('TextAreaOnEditChange0090_1')); + await Utils.sleep(1000); + await text.dragTo(textArea); + await Utils.sleep(1000); + await text.dragTo(textArea); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0130 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0130'); + await Utils.sleep(100); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + let textArea1: Component = await driver.findComponent(ON.id('TextAreaOnEditChange0130_1')); + let textArea2: Component = await driver.findComponent(ON.id('TextAreaOnEditChange0130_2')); + await Utils.sleep(1000); + await textArea1.dragTo(textArea2); + await Utils.sleep(1000); + await textArea1.dragTo(textArea2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_ONEDITCHANGE_0130 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaSelectionTest/UIComponentTextTextAreaSelectionTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaSelectionTest/UIComponentTextTextAreaSelectionTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0aaed0c1cffcb7f7005af217b2cbf3d2561e9b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaSelectionTest/UIComponentTextTextAreaSelectionTest.test.ets @@ -0,0 +1,523 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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, Component, ON, MouseButton } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTextAreaSelectionTest() { + + describe('UIComponentTextTextAreaSelectionTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_SELECTION_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0020 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0020"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0020')); + await Utils.sleep(1000); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0020')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0020 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0030"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0030')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0030')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0030 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0040 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0040"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0040')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0040')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0040 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0050 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0050"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0050')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa'); + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0050')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(500); + await driver.triggerKey(2055); + await Utils.sleep(100); + await textArea.inputText('bbbbbbbbbbbbbbbbbb'); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0050 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0060 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0060"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0060')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa'); + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0060')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(500); + let textArea1: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0060_1')); + await Utils.sleep(500); + await textArea1.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0060 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0070 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0070"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0070')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0070')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0070 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_1 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_1 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_1 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0090')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0090_1')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_1 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_2 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_2 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_2 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0090')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0090_2')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_2 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_3 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_3 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_3 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0090')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0090_3')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_3 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_4 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_4 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_4 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0090')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0090_4')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0090_4 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0100 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0100 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0100"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0100')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0100')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0100 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0110 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0110"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0110')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0110')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0110 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0120 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0120"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0120')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0120')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(500); + let btn1: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0120_1')); + await Utils.sleep(500); + await btn1.click() + await Utils.sleep(500); + await btn.click() + await Utils.sleep(500); + await btn1.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0120 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0130 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0130"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0130')); + await Utils.sleep(100); + await textArea.inputText('aaaaa'); + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0130')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(500); + await textArea.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 cut: Component = await driver.findComponent(ON.text('剪切')); + await Utils.sleep(500); + await cut.click(); + await Utils.sleep(500); + await textArea.longClick(); + await Utils.sleep(500); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500); + await paste.click(); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0130 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0140 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0140"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0140')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0140')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(500); + let point = await textArea.getBoundsCenter(); + await Utils.sleep(500); + await driver.mouseClick({ + x: point.x + 200, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0140 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0150 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0150"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0150')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0150')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(500); + await textArea.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 copy: Component = await driver.findComponent(ON.text('复制')); + await Utils.sleep(500); + await copy.click(); + await Utils.sleep(500); + await textArea.longClick(); + await Utils.sleep(500); + let paste: Component = await driver.findComponent(ON.text('粘贴')); + await Utils.sleep(500); + await paste.click(); + await Utils.sleep(500); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0150 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0160 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0160"); + await Utils.sleep(500); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaSelection0160')); + await Utils.sleep(100); + await textArea.inputText('aaaaaaaaa') + await Utils.sleep(500); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaSelection0160')); + await Utils.sleep(500); + await btn.click() + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0160 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaUxComsistencyTest/UIComponentTextTextAreaUxComsistencyTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaUxComsistencyTest/UIComponentTextTextAreaUxComsistencyTest.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7fc2cbde9f7142d283833085b880db8f08241d46 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextAreaUxComsistencyTest/UIComponentTextTextAreaUxComsistencyTest.test.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 { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextAreaUxComsistencyTest() { + + describe('UIComponentTextTextAreaUxComsistencyTest', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_TEXTAREA_UXCONSISTENCY_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_UXCONSISTENCY_0060 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_UXCONSISTENCY_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_UXCONSISTENCY_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextAreaUxComsistency/UIComponentTextTextAreaUxComsistency0060'); + let driver = Driver.create(); + let textArea: Component = await driver.findComponent(ON.id('TextAreaUIComponentTextTextAreaUxComsistency0060')); + await Utils.sleep(500); + await textArea.inputText('aaaaaaaaa'); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextAreaUxComsistency0060')); + await Utils.sleep(500); + await btn.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_UXCONSISTENCY_0060 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextEditableTest/UIComponentTextTextEditable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextEditableTest/UIComponentTextTextEditable.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8290d92ee84a6e8a44a8d58184f98c7fc4bb69d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextEditableTest/UIComponentTextTextEditable.test.ets @@ -0,0 +1,309 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextEditable() { + + describe('UIComponentTextTextEditable', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_EDITABLE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0140 + * @tc.desc Add test span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable014'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0140 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0150 + * @tc.desc Add test span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable015'); + let driver: Driver = Driver.create(); + let add: Component = await driver.findComponent(ON.id('add')); + await Utils.sleep(1000); + add.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0150 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0160 + * @tc.desc Add image span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable016'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0160 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0170 + * @tc.desc Add image span + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0170 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable017'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let add: Component = await driver.findComponent(ON.id('add')); + await Utils.sleep(1000); + add.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0170 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0180 + * @tc.desc Delete spans + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0180 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable018'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let deleteButton: Component = await driver.findComponent(ON.id('deleteButton')); + await Utils.sleep(1000); + deleteButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0180 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0190 + * @tc.desc Delete spans + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0190 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable019'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let deleteButton: Component = await driver.findComponent(ON.id('deleteButton')); + await Utils.sleep(1000); + deleteButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0190 end.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0200 + * @tc.desc Delete spans + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0200 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable020'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let deleteButton: Component = await driver.findComponent(ON.id('deleteButton')); + await Utils.sleep(1000); + deleteButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0200 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0210 + * @tc.desc Delete spans + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0210 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable021'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let deleteButton: Component = await driver.findComponent(ON.id('deleteButton')); + await Utils.sleep(1000); + deleteButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0210 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0220 + * @tc.desc Update span style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0220 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable022'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let updateButton: Component = await driver.findComponent(ON.id('updateButton')); + await Utils.sleep(1000); + updateButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0220 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0230 + * @tc.desc Update span style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0230 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable023'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let updateButton: Component = await driver.findComponent(ON.id('updateButton')); + await Utils.sleep(1000); + updateButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0230 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0240 + * @tc.desc Update span style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0240 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable024'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let updateButton: Component = await driver.findComponent(ON.id('updateButton')); + await Utils.sleep(1000); + updateButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0240 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0250 + * @tc.desc Update span style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0250 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable025'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let updateButton: Component = await driver.findComponent(ON.id('updateButton')); + await Utils.sleep(1000); + updateButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0250 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0260 + * @tc.desc Update span style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0260 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable026'); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let updateButton: Component = await driver.findComponent(ON.id('updateButton')); + await Utils.sleep(1000); + updateButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EDITABLE_0260 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextEvasiveInputMethodTest/UIComponentTextTextEvasiveInputMethod.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextEvasiveInputMethodTest/UIComponentTextTextEvasiveInputMethod.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..92e6ea406384d437e9708197e2cd4d6f7eb1cb81 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextEvasiveInputMethodTest/UIComponentTextTextEvasiveInputMethod.test.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. + */ +import { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { i18n } from '@kit.LocalizationKit'; +import { uiAppearance } from '@kit.ArkUI'; + +export default function UIComponentTextTextEvasiveInputMethod() { + + describe('UIComponentTextTextEvasiveInputMethod', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_EVASIVEINPUTMETHOD_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0010 + * @tc.desc 输入框底部贴近弹窗屏幕中部均分线 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput001'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput001_button')); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput001_input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0010 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0020 + * @tc.desc 输入框位于靠近弹窗底部 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput002'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput002_button')); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput002_input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0020 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0030 + * @tc.desc 输入框位于屏幕中部均分线偏下位置 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput003'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput003_button')); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput003_input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0030 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0040 + * @tc.desc 输入框位于屏幕靠近中部均分线位置 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput004'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput004_button')); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + let input: Component = await driver.findComponent(ON.id('UIComponentTextTextEvasiveInput004_input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_EVASIVEINPUTMETHOD_0040 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextGestureStyleTest/UIComponentTextTextGestureStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextGestureStyleTest/UIComponentTextTextGestureStyle.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c773356171bed5e635e7ffe928803cfd9c9c0c1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextGestureStyleTest/UIComponentTextTextGestureStyle.test.ets @@ -0,0 +1,1032 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, MouseButton, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextGestureStyle() { + + describe('UIComponentTextTextGestureStyle', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_GESTURESTYLE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0010 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0010 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle001'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle001')); + await Utils.sleep(1000); + let pointButtonCenter = await component.getBoundsCenter(); + await driver.click(pointButtonCenter.x, pointButtonCenter.y); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0020 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0020'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0020')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.click(pointButtonCenter.x, pointButtonCenter.y); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0020 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0030 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0030 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0030'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0030')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.click(pointButtonCenter.x + 50, pointButtonCenter.y); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0030 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0040 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0040 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0040'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0040')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseClick({ + x: pointButtonCenter.x + 50, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0040 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0050 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0050 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0050'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0050')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0050 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0060 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0060'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0060')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x + 50, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0070 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0070'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0070')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x + 50, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0080 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0080'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0080')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x + 50, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0230 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0230 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0230'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0230')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseClick({ + x: pointButtonCenter.x + 50, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await driver.mouseLongClick({ + x: pointButtonCenter.x, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0230 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_1 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_1 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0260'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0260')); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextGestureStyle0260_1')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(100); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x - 20, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await driver.mouseClick({ + x: pointButtonCenter.x, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_2 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_2 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0260'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0260')); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextGestureStyle0260_2')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(100); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x - 20, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await driver.mouseClick({ + x: pointButtonCenter.x, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_3 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_3 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_3 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0260'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0260')); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('btnUIComponentTextTextGestureStyle0260_3')); + await Utils.sleep(100); + await btn.click(); + await Utils.sleep(100); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x - 20, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(1000); + await driver.mouseClick({ + x: pointButtonCenter.x, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0260_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0270 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0270 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0270'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0270')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x - 20, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0270 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0280 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0280 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0280'); + const driver = Driver.create(); + await Utils.sleep(1000); + let text: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0280')); + await Utils.sleep(1000); + let pointButtonCenter = await text.getBoundsCenter(); + await driver.mouseLongClick({ + x: pointButtonCenter.x - 20, + y: pointButtonCenter.y, + }, MouseButton.MOUSE_BUTTON_RIGHT); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0280 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0090 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COIPONENT_TEXT_TEXT_GESTURESTYLE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle009'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle009')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0090 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0100 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle010'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle010')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0100 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0110 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle011'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0110 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0120 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle012'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle012')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0120 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0130 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle013'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle013')); + await Utils.sleep(1000); + component.click(); + await Utils.sleep(1000); + component.doubleClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0130 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0140 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle014'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle014')); + await Utils.sleep(1000); + await component.click(); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0140 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0160 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle016'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle016')); + await Utils.sleep(1000); + await component.click(); + await component.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0160 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0170 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0170 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle017'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle017')); + let updateAttribute: Component = await driver.findComponent(ON.id('updateAttribute')); + await Utils.sleep(1000); + updateAttribute.click(); + await Utils.sleep(1000); + await component.click(); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0170 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018'); + await Utils.sleep(500); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle018')); + let updateAttribute: Component = await driver.findComponent(ON.id('updateAttribute')); + await Utils.sleep(500); + await component.longClick(); + await Utils.sleep(500); + updateAttribute.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018'); + await Utils.sleep(500); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle018')); + await Utils.sleep(500); + await component.longClick(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_3 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018'); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_3 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_4 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018'); + await Utils.sleep(500); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle018')); + let updateAttribute: Component = await driver.findComponent(ON.id('updateAttribute')); + await Utils.sleep(500); + await component.longClick(); + await Utils.sleep(500); + updateAttribute.click(); + await Utils.sleep(500); + updateAttribute.click(); + await Utils.sleep(500); + await component.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0180_4 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190_1 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle019'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle019')); + let updateAttribute: Component = await driver.findComponent(ON.id('updateAttribute')); + await Utils.sleep(1000); + updateAttribute.click(); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190_1 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190_2 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle019'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle019')); + let updateAttribute: Component = await driver.findComponent(ON.id('updateAttribute')); + await Utils.sleep(1000); + updateAttribute.click(); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0190_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0200 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0200 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle020'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle020')); + await Utils.sleep(1000); + await component.click(); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0200 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0210 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0210 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0210'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0210')); + await Utils.sleep(1000); + let point = await component.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(point.x - 100, point.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0210 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0220 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0220 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0220'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0220')); + await Utils.sleep(1000); + let point = await component.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(point.x, point.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0220 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0250 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0250 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0250'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle0250')); + await Utils.sleep(1000); + let point = await component.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(point.x, point.y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0250 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0310 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0310 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle031'); + const driver = Driver.create(); + await Utils.sleep(1000); + let equals: Component = await driver.findComponent(ON.id('equals')); + await Utils.sleep(1000); + equals.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0310 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0330 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0330 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle033'); + const driver = Driver.create(); + await Utils.sleep(1000); + let replaceStyle: Component = await driver.findComponent(ON.id('replaceStyle')); + await Utils.sleep(1000); + replaceStyle.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0330 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0340 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0340 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle034'); + const driver = Driver.create(); + await Utils.sleep(1000); + let replaceStyle: Component = await driver.findComponent(ON.id('setStyle')); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle034')); + await Utils.sleep(1000); + replaceStyle.click(); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0340 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0350 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0350 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle035'); + const driver = Driver.create(); + await Utils.sleep(1000); + let removeStyle: Component = await driver.findComponent(ON.id('removeStyle')); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle035')); + await Utils.sleep(1000); + removeStyle.click(); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0350 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0360 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0360 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle036'); + const driver = Driver.create(); + await Utils.sleep(1000); + let removeStyles: Component = await driver.findComponent(ON.id('removeStyles')); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle036')); + await Utils.sleep(1000); + removeStyles.click(); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0360 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0370 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0370 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle037'); + const driver = Driver.create(); + await Utils.sleep(1000); + let insertString: Component = await driver.findComponent(ON.id('insertString')); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle037')); + await Utils.sleep(1000); + insertString.click(); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0370 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0150 + * @tc.desc Set click gesture + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle015'); + const driver = Driver.create(); + await Utils.sleep(1000) + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle015')); + await Utils.sleep(1000); + await component.click(); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0150 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0240 + * @tc.desc focusable=false + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0240 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle024'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle024')); + let changeButton: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle024_button')); + await Utils.sleep(1000); + await changeButton.click(); + await Utils.sleep(1000); + let rect = await component.getBounds(); + await driver.click(rect.left + 5, rect.top + 5) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0240 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0290 + * @tc.desc esubStyledstring获取属性字符串的子字符串 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0290 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle029'); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle029')); + await Utils.sleep(1000); + let rect = await component.getBounds(); + await driver.click(rect.left + 5, rect.top + 5) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0290 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0300 + * @tc.desc esubStyledstring获取属性字符串的子字符串 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0300 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle030'); + const driver = Driver.create(); + await Utils.sleep(1000); + let changeButton: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle030_button')); + await Utils.sleep(1000); + await changeButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0300 end.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0320 + * @tc.desc esubStyledstring获取属性字符串的子字符串 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0320 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle032'); + const driver = Driver.create(); + await Utils.sleep(1000); + let changeButton: Component = await driver.findComponent(ON.id('UIComponentTextTextGestureStyle032_button')); + await Utils.sleep(1000); + await changeButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_GESTURESTYLE_0320 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextImageSpanAltTest/UIComponentTextTextImageSpanAlt.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextImageSpanAltTest/UIComponentTextTextImageSpanAlt.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b822f860eade65a6c399ef8e2a0dcb33a0ff8363 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextImageSpanAltTest/UIComponentTextTextImageSpanAlt.test.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { i18n } from '@kit.LocalizationKit' +import { uiAppearance } from '@kit.ArkUI' + +export default function UIComponentTextTextImageSpanAlt() { + + describe('UIComponentTextTextImageSpanAlt', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_IMAGESPAN_ALT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0040 + * @tc.desc test imageSpan alt + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt004"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0050 + * @tc.desc test imageSpan alt + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt005"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0060 + * @tc.desc test imageSpan alt + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt006"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0070 + * @tc.desc test imageSpan alt + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt007"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0070 finish.`); + done(); + }) + }) + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInterfaceTest/UIComponentTextTextInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInterfaceTest/UIComponentTextTextInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4cdb0a75f9e9f19b6c6d4bfb316586b59d7a122f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextInterfaceTest/UIComponentTextTextInterface.test.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 { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { i18n } from '@kit.LocalizationKit'; +import { uiAppearance } from '@kit.ArkUI'; + +export default function UIComponentTextTextInterface() { + + describe('UIComponentTextTextInterface', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_INTERFACE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_0290 + * @tc.desc Resource type parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_0290 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface029'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_0290 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_1870 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_1870 + * @tc.desc Resource type parameter + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_1870', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_1870 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface187'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_1870 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_2020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_2020 + * @tc.desc Set fontWeight undefined + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_2020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_2020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface202'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_INTERFACE_2020 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextLongPressTest/UIComponentTextTextLongPress.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextLongPressTest/UIComponentTextTextLongPress.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5c2fd5e102d7b40be52f835ff721897070c60dec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextLongPressTest/UIComponentTextTextLongPress.test.ets @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { i18n } from '@kit.LocalizationKit'; +import { uiAppearance } from '@kit.ArkUI'; + +export default function UIComponentTextTextLongPress() { + + describe('UIComponentTextTextLongPress', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_LONGPRESS_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0100 + * @tc.desc Test long press + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress010'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextLongPress010')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0100 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0110 + * @tc.desc Test long press + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress011'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextLongPress011')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0110 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0120 + * @tc.desc Test long press + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress012'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextLongPress012')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0120 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0130 + * @tc.desc Test long press + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress013'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextLongPress013')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_LONGPRESS_0130 end.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextMarqueeTest/UIComponentTextTextMarquee.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextMarqueeTest/UIComponentTextTextMarquee.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4737b03cdcebab981137b7b29dab779b72c21043 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextMarqueeTest/UIComponentTextTextMarquee.test.ets @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI'; +import { i18n } from '@kit.LocalizationKit'; + +export default function UIComponentTextTextMarquee() { + + describe('UIComponentTextTextMarquee', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_MARQUEE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0020 + * @tc.desc Set the textOverflow of the Text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0020 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee002'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let setOverflow: Component = await driver.findComponent(ON.id('setOverflow')); + await Utils.sleep(1000); + setOverflow.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0050 + * @tc.desc Set the textOverflow of the Text component + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0050 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee005'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let setOverflow: Component = await driver.findComponent(ON.id('setOverflow')); + let setTextAlign: Component = await driver.findComponent(ON.id('setTextAlign')); + await Utils.sleep(1000); + setOverflow.click(); + await Utils.sleep(1000); + setTextAlign.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_MARQUEE_0050 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextPrivacyMaskTest/UIComponentTextTextPrivacyMask.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextPrivacyMaskTest/UIComponentTextTextPrivacyMask.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ea37027d9efe752209de43893dfd623d99a53b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextPrivacyMaskTest/UIComponentTextTextPrivacyMask.test.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 { afterEach, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { i18n } from '@kit.LocalizationKit'; +import { uiAppearance } from '@kit.ArkUI'; + +export default function UIComponentTextTextPrivacyMask() { + + describe('UIComponentTextTextPrivacyMask', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_PRIVACYMASK_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_PRIVACYMASK_0280 + * @tc.desc Test copy and paste + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_PRIVACYMASK_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_PRIVACYMASK_0280 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextPrivacyMask/UIComponentTextTextPrivacyMask028'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextPrivacyMask028')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_PRIVACYMASK_0280 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 100644 index 0000000000000000000000000000000000000000..0bc74a37a0d5947265e9bd385d79e9d933da0e9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextStringParagraphStyleTest/UIComponentTextTextStringParagraphStyle.test.ets @@ -0,0 +1,835 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, describe, it } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { i18n } from '@kit.LocalizationKit'; +import { uiAppearance } from '@kit.ArkUI'; + +export default function UIComponentTextTextStringParagraphStyle() { + + describe('UIComponentTextTextStringParagraphStyle', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0060 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0060 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle006'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextStringParagraphStyle006')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0060 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0070 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0070 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle007'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextStringParagraphStyle007')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0070 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0080 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle008'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let component: Component = await driver.findComponent(ON.id('UIComponentTextTextStringParagraphStyle008')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0080 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0090 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle009'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0090 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0100 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle010'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0100 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0110 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0110 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle011'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0110 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0120 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0120 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle012'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0120 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0130 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0130 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle013'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0130 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0140 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle014'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0140 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0150 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0150 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle015'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0150 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0160 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0160 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle016'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0160 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0170 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0170 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle017'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0170 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0180 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0180 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle018'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0180 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0190 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0190 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle019'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0190 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0200 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0200 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle020'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0200 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0210 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0210 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle021'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0210 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0220 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0220 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle022'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0220 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0230 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0230 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle023'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0230 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0240 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0240 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle024'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0240 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0250 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0250 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle025'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0250 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0260 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0260 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle026'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0260 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0270 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0270 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle027'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0270 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0280 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0280 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0280 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle028'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0280 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0290 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0290 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle029'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0290 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0300 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0300 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle030'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0300 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0310 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0310 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle031'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0310 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0320 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0320 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle032'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0320 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0330 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0330 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0320 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle033'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let changeSize: Component = await driver.findComponent(ON.id('changeSize')); + await Utils.sleep(1000); + changeSize.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0330 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0340 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0340 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle034'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0340 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0350 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0350 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle035'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0350 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0360 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0360 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle036'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0360 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0370 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0370 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle037'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0370 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0380 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0380 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle038'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0380 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0390 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0390 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0390 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle039'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0390 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0400 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0400 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle040'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0400 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0410 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0410 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0410 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle041'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0410 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0420 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0420 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0420 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle042'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0420 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0430 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0430 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0430 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle043'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0430 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0440 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0440 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0440 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle044'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0440 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0450 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0450 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0450 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle045'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0450 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0460 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0460 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0460 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle046'); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0460 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0470 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0470 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0470 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle047'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0470 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0480 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0480 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0480 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle048'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let getStyles: Component = await driver.findComponent(ON.id('getStyles')); + await Utils.sleep(1000); + await getStyles.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0480 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0490 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0490 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0490 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle049'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let getStyles: Component = await driver.findComponent(ON.id('getStyles')); + await Utils.sleep(1000); + await getStyles.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0490 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0500 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0500 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0500 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle050'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let getStyles: Component = await driver.findComponent(ON.id('getStyles')); + await Utils.sleep(1000); + await getStyles.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0500 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0510 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0510 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0510 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle051'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let getStyles: Component = await driver.findComponent(ON.id('getStyles')); + await Utils.sleep(1000); + await getStyles.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0510 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0520 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0520 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0520 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle052'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let getStyles: Component = await driver.findComponent(ON.id('getStyles')); + await Utils.sleep(1000); + await getStyles.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0520 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0530 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0530 + * @tc.desc Set paragraph style + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0530 start.`); + Settings.createWindow('testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle053'); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let getStyles: Component = await driver.findComponent(ON.id('getStyles')); + await Utils.sleep(1000); + await getStyles.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTSTRING_PARAGRAPHSTYLE_0530 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextSupportFontTest/UIComponentTextTextSupportFont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextSupportFontTest/UIComponentTextTextSupportFont.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..bdce765899696bc04349b9314a6908226a5c70c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextSupportFontTest/UIComponentTextTextSupportFont.test.ets @@ -0,0 +1,333 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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 } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTextSupportFont() { + + describe('UIComponentTextTextSupportFont', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_SUPPORTFONT_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0010 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0030"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0010 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0170 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0170"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0170 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0180 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0180 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0180"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0180 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0190 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0190 + * @tc.desc : + */ + + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0190"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0190 finish.`) + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0200 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0200 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0200"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0200 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0210 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0210 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0210"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0210 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0220 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0220 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0220"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0220 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0230 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0230 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0230"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0230 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0240 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0240 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0240"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0240 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0250 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0250 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0250"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0250 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0260 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0260 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0260"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0260 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0270 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0270"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0270 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0280 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0280 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0280"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0280 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0290 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0290 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0290 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0290"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0290 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0300 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0300 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0300"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0300 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0310 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0310 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0310"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0310 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0320 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0320 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0320 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0320"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0320 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0330 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0330 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0330 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0330"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0330 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 100644 index 0000000000000000000000000000000000000000..4bffc77bbd53a4030a70aacbde4043710647f4f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTransparencyTest/UIComponentTextTransparency.test.ets @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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 } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTransparency() { + + describe('UIComponentTextTransparency', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0030 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency003"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + await driver.drag(100, 100, 200, 200, 400) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0030 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0040 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0040"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + await driver.drag(100, 100, 200, 200, 400) + await Utils.sleep(100); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0040 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0050 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0050"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + await driver.drag(100, 100, 200, 200, 400) + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0050 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0060 + * @tc.desc : + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0060"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + await driver.drag(100, 100, 200, 200, 400) + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENTT_TEXT_TRANSPARENCY_0060 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets index daf797ea095d73d75a47ee5fe88209d0fec33dae..beec708453cb2c12fe8116a9038bf6d4f1e9ef04 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets @@ -13,13 +13,14 @@ * limitations under the License. */ -import { describe, afterEach, it } from '@ohos/hypium'; +import { describe, afterEach, it, beforeEach } from '@ohos/hypium'; import Settings from '../model/Settings'; import windowSnap from '../model/snapShot'; import Logger from '../model/Logger'; import Utils from '../model/Utils'; import uiAppearance from '@ohos.uiAppearance'; import { Driver ,ON } from '@ohos.UiTest' +import { i18n } from '@kit.LocalizationKit'; /* * UIComponentUISupportColor @@ -40,7 +41,36 @@ import { Driver ,ON } from '@ohos.UiTest' export default function UIComponentUISupportColor() { describe('UIComponentUISupportColor', () => { - + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_1010 @@ -390,5 +420,150 @@ export default function UIComponentUISupportColor() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0950 finish.`); done(); }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2040 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2040 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2040 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor204"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let lightButton = await driver.findComponent(ON.id('UIComponentUISupportColor204')); + await Utils.sleep(1000); + await lightButton.click(); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2040 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2050 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2050 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2050 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor205"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeButton = await driver.findComponent(ON.id('UIComponentUISupportColor205')); + await Utils.sleep(1000); + await changeButton.click(); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2050 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2060 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2060 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2060 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor206"); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeButton = await driver.findComponent(ON.id('UIComponentUISupportColor206')); + await Utils.sleep(1000); + await changeButton.click(); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2070 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2070 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2070 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor207"); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeButton = await driver.findComponent(ON.id('UIComponentUISupportColor207')); + await Utils.sleep(1000); + await changeButton.click(); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2070 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2080 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2080 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2080 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor208"); + await Utils.sleep(500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2080 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2090 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2090 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2090 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor209"); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2090 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2100 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2100 + * @tc.desc : Text component dynamically switches theme modes + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2100 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor210"); + await Utils.sleep(500); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT); + await Utils.sleep(500); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK); + await Utils.sleep(500); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_2100 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 100644 index 0000000000000000000000000000000000000000..3eb5ae42605cfc51424c782de9a817b09119a4d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement.test.ets @@ -0,0 +1,1592 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, beforeEach, 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' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UICustomTextShortCutKeyReplacement() { + + describe('UICustomTextShortCutKeyReplacement', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + 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_0150 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0150 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0150 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT,KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0150 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0160 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0160 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0160 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + for (let index = 0; index <= 3; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0160 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0170 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0170 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0170 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0170 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0180 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0180 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0180 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0180 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0190 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0190 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0190 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0190 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0200 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0200 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0200 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0200 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0210 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0210 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0210 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0210 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0220 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0220 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0220 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0220 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0230 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0230 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0230 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0230 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0240 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0240 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0240 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0240 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0250 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0250 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0250 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0250 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0260 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0260 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0260 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0260 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0270 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0270 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0270 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0270 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0280 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0280 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0280 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0280 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0290 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0290 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0300 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0300 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0310 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0310 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0310 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0310 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0320 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0320 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0320 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0320 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0330 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0330 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0330 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0330 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0340 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0340 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0340 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0340 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0350 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0350 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0350 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0350 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0360 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0360 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0360 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0360 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0370 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0370 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0370 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0370 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0380 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0380 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0380 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let changeText = await driver.findComponent(ON.id('changeText')); + await changeText.click(); + await Utils.sleep(1000); + for (let index = 0; index <= 20; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0380 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0410"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0400"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0400 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0410 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0410 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0410 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0410"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0410 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0420 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0420 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0420 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0420"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 2; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0420 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0430 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0430 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0430 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0430"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 8; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0430 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0440 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0440 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0440 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0440"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn3')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_UP); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0440 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0450 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0450 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0450 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0460"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_UP); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0450 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0460 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0460 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0460 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0460"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_UP); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0460 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0470 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0470 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0470 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0490"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + let btn3 = await driver.findComponent(ON.id('TextShortCutKey_btn3')); + await Utils.sleep(1000); + btn3.click(); + await Utils.sleep(1000); + btn.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_DOWN); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0470 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0480 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0480 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0480 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0490"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_DOWN); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0480 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0490 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0490 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0490 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0490"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_DOWN); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0490 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0500 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0500 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0500 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0500"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + await Utils.sleep(1000); + for (let index = 0; index < 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0500 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0510 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0510 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0510 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0510"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn4')); + let rich = await driver.findComponent(ON.id('TextShortCutKey_4')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + for (let index = 0; index < 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(1000); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0510 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0520 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0520 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0520 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn4')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + for (let index = 0; index < 10; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0520 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0550 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0550 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0550 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn3')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_DOWN); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0550 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0560 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0560 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0560 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let textInput = await driver.findComponent(ON.id('TextShortCutKey_2')); + await Utils.sleep(1000); + await text.dragTo(textInput); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(1000); + await text.dragTo(textInput); + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0560 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0570 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0570 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0570 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn2')); + let textInput = await driver.findComponent(ON.id('TextShortCutKey_2')); + let textInput2 = await driver.findComponent(ON.id('TextShortCutKey_3')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await text.dragTo(textInput); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_DOWN); + await Utils.sleep(1000); + await text.dragTo(textInput); + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(1000); + await textInput2.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0570 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0590 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0590 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0590 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0590 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0610 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0610 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0610 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0610 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_1 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_1 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_1 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0620"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn8')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_1 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0620"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn9')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0620"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0620_2 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_1 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_1 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_1 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let rich = await driver.findComponent(ON.id('TextShortCutKey_3')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn6')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(1000); + let copy = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(1000); + await rich.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_1 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_2 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_2 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_1 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn7')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0630_1 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_1 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_1 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_1 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn6')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_1 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_2 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_2 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_2 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn7')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0640_2 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_1 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_1 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_1 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn4')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_1 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_2 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_2 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_2 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn5')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0650_2 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_1 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_1 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_1 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn1')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_1 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_2 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_2 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_2 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn2')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_2 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_3 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_3 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_3 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let btn1 = await driver.findComponent(ON.id('TextShortCutKey_btn3')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0660_3 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0670 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0670 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0670 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0670"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0670 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0680 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0680 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0680 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let textInput = await driver.findComponent(ON.id('TextShortCutKey_2')); + await Utils.sleep(1000); + await text.longClick(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(1000); + await textInput.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0680 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0690 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0690 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0700 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + let point = await text.getBoundsCenter(); + await driver.longClick(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0690 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0700 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0700 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0700 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(1000); + let point = await text.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0700 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0710 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0710 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0710 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + let textInput = await driver.findComponent(ON.id('TextShortCutKey_2')); + await Utils.sleep(1000); + await text.dragTo(textInput); + await Utils.sleep(1000); + for (let index = 0; index < 5; index++) { + await driver.triggerCombineKeys(KeyCode.KEYCODE_SHIFT_LEFT, KeyCode.KEYCODE_DPAD_RIGHT); + await Utils.sleep(100); + } + await Utils.sleep(1000); + await text.dragTo(textInput); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0710 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0720 + * @tc.name : SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0720 + * @tc.desc : Text + */ + it('SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0720 start.`); + Settings.createWindow("testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0720"); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(1000); + let text = await driver.findComponent(ON.id('TextShortCutKey_1')); + await Utils.sleep(1000); + let point = await text.getBoundsCenter(); + for (let index = 0; index < 2; index++) { + await driver.click(point.x, point.y); + await Utils.sleep(100); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_CUSTOM_TEXT_SHORTCUT_KEY_0720 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 c74ae272407cbf707ddcfaaacf42c1e132d5452d..07d1bbd86550255ba5ba7f960dc4ebeded31496f 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 7f06aa4d872061e0682441fd8f47b33730bc78c1..a72ee624db4eaee1ae0b91d9b71177cbbeae3a2b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -14,6 +14,9 @@ */ import {Driver , ON} from '@ohos.UiTest' +import { BusinessError, screenLock } from '@kit.BasicServicesKit'; +import Settings from './Settings'; +import { KeyCode } from '@kit.InputKit'; export default class Utils { @@ -39,6 +42,45 @@ export default class Utils { } + /** + * The app breathes and then lights up the screen + * + * @param driver + */ + static async lockAndUnlock(driver: Driver) { + await screenLock.lock((err: BusinessError, data: Boolean) => { + if (err) { + console.error(`Failed to lock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded in locking the screen. result: ${data}`); + }); + await Utils.sleep(2000); + await screenLock.unlock((err: BusinessError) => { + if (err) { + console.error(`Failed to unlock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded unlocking the screen.`); + }); + await driver.drag(100, 900, 100, 1, 1000); + } + + /** + * The application switches to the desktop and back to the application + * + * @param driver + */ + static async homeAndBack(driver: Driver) { + let currentWindow = await Settings.windowClass; + if (currentWindow) { + await currentWindow.hide(); + await driver.triggerKey(KeyCode.KEYCODE_HOME); + await Utils.sleep(2000); + await currentWindow.showWindow(); + } + } + } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..1e0a88915a2ed72159cd0b703d07b4de6d564a42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150.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 UICustomTextShortCutKeyReplacement0150 { + @State msg: string = 'HH测试223% U测72试#'; + @State start: number = 0 + @State end: number = 0 + build() { + Text(this.msg) + .width('100%') + .height(60) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b3297dd1c9c2d04c6ef603b9b3a11774d9c1426 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160.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 UICustomTextShortCutKeyReplacement0160 { + @State msg: string = 'HH测试223% U测72试#'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Text(this.msg) + .width('100%') + .height(60) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=1) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..02ff1187993515cdbd45d44fa3d25e3715689fc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170.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 UICustomTextShortCutKeyReplacement0170 { + @State msg: string = 'HH测试223% U测72试# 1/2 @&*ئاھ چوڭ \uD83D\uDE00'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Text(this.msg) + .width('100%') + .height(60) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=1) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d4b70bcec92203a56c4f2276d54ce5f92f24ba4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180.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 UICustomTextShortCutKeyReplacement0180 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试XXX2!'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=-1) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..324983114d0ac69e6e070863a14934308c34c4dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190.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 UICustomTextShortCutKeyReplacement0190 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..d663a25d6388838842e3b2268f240c7a9dfa7cd8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200.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 UICustomTextShortCutKeyReplacement0200 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..5545ddb2c8ca2e802fcbdf41dfec23b0525c5878 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210.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 UICustomTextShortCutKeyReplacement0210 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..6713c6bd51c5781fe79b3056a18e693fcbf35385 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220.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 UICustomTextShortCutKeyReplacement0220 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ddf46fe359ced1a09ae4e20d37536b399ca85ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230.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 UICustomTextShortCutKeyReplacement0230 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..6faa65631bf44f4155a342b34ced4113e2ea1051 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240.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 UICustomTextShortCutKeyReplacement0240 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..72d300fe02c37a7cb3a42cca9f47c52f91d5a16b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250.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 UICustomTextShortCutKeyReplacement0250 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 10; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ae850c6c627214687de1d33e10b76d04d0567e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260.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 UICustomTextShortCutKeyReplacement0260 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 10; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f6eaac819941d51db4f7c26b331db13b29fdb26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270.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 UICustomTextShortCutKeyReplacement0270 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..319067ee443cb41c7cabec8297c036e75706f904 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280.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 UICustomTextShortCutKeyReplacement0280 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b8a66b159325cad43e3a5330f6c5c22ce15ad63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300.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 UICustomTextShortCutKeyReplacement0300 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae4ce8845351e929a9b6986154bbf079153f6244 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310.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 UICustomTextShortCutKeyReplacement0310 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..d998c5ff307517770417632875e0da54bcb543ad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320.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 UICustomTextShortCutKeyReplacement0320 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..5bbc5d856ca301466c9c4453fb562611c8a41b9d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330.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 UICustomTextShortCutKeyReplacement0330 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..eaf5dd10420120e7cdfc1e90c625a95f821d4a66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340.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 UICustomTextShortCutKeyReplacement0340 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..851d4d630e8aebc108c1417e369ff10fa47b6fcb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350.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 UICustomTextShortCutKeyReplacement0350 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c71867c4fee6f34a7a69992f3a7815361f38e2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360.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 UICustomTextShortCutKeyReplacement0360 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..bfd428d2307b94a69fed5266420dde1c6088e4d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370.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 UICustomTextShortCutKeyReplacement0370 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..e147dbce219ebb3bed84c4e2a94d7510253a4cf4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380.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 UICustomTextShortCutKeyReplacement0380 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/StatusManagerBelievable/StatusManagerBelievable0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/StatusManagerBelievable/StatusManagerBelievable0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..df83f48773e6de065690f4b94c97577719d9e576 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/StatusManagerBelievable/StatusManagerBelievable0010.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. + */ + +@Builder +function MyBuilder(value: string, size: number) { + Column() { + Text(value) + .fontSize(size) + }.backgroundColor(Color.Gray) +} + +let globalBuilder: WrappedBuilder<[string, number]> = wrapBuilder(MyBuilder); + +@Entry +@Component +struct StatusManagerBelievable0010 { + @State message: string = 'Test wrapBuilder'; + + build() { + Row() { + Column() { + globalBuilder.builder(this.message, 50) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree032.ets new file mode 100644 index 0000000000000000000000000000000000000000..4687a38fb478ec921d5b9eef55f6d2a912235f88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree032.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 UIAttributesStateStylesInterfaceEditableTextThree032 { + 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: this.inputValue }) + .id('inputComponent') + .customKeyboard(this.CustomKeyboardBuilder()).margin(10).border({ width: 1 }).height('48vp') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree061.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree061.ets new file mode 100644 index 0000000000000000000000000000000000000000..7062775b24d56dd29ee544de9ded6ae3dafd8985 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree061.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 UIAttributesStateStylesInterfaceEditableTextThree061 { + controller: TextAreaController = new TextAreaController(); + @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() { + TextArea({ controller: this.controller, text: this.inputValue}) + .id('textAreaComponent') + .customKeyboard(this.CustomKeyboardBuilder()).margin(10).border({ width: 1 }) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree075.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree075.ets new file mode 100644 index 0000000000000000000000000000000000000000..7953294671dc2b15768ca3de632a838f3d1acf88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree075.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIAttributesStateStylesInterfaceEditableTextThree075 { + controller: SearchController = new SearchController() + @State inputValue: string = ""; + @State isEditChange: 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() { + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .customKeyboard(this.CustomKeyboardBuilder()) + .margin(10) + .border({ width: 1 }) + .onEditChange((bool) => { + this.isEditChange = 'textInputOne onEditChange:' + bool + }) + .focusable(true) + + Text(this.isEditChange) + .margin({ bottom: 20 }) + + Button('clearFocus') + .id('clearFocus') + .width(200) + .height(50) + .fontColor(Color.White) + .backgroundColor(Color.Blue) + .onClick(() => { + this.getUIContext().getFocusController().clearFocus() + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree090.ets new file mode 100644 index 0000000000000000000000000000000000000000..b91278d64df7c148ed3020a42bf02e769603a84b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree090.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 UIAttributesStateStylesInterfaceEditableTextThree090 { + controller: SearchController = new SearchController() + @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() { + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .customKeyboard(this.CustomKeyboardBuilder()) + .margin(10) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree092.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree092.ets new file mode 100644 index 0000000000000000000000000000000000000000..e78de7b97a4dea0f9ea5691cc984d81e077a8563 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree092.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 UIAttributesStateStylesInterfaceEditableTextThree092 { + controller: SearchController = new SearchController(); + @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() { + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .customKeyboard(this.CustomKeyboardBuilder()) + .margin(10) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree101.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree101.ets new file mode 100644 index 0000000000000000000000000000000000000000..e935b316696ae02e6ac3ef71f08a66b3b64c4e00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree101.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 UIAttributesStateStylesInterfaceEditableTextThree101 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .enableKeyboardOnFocus(true) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree103.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree103.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1bd79ffca85c4d9214ec9d68324c187ef1775f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree103.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 UIAttributesStateStylesInterfaceEditableTextThree103 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .enableKeyboardOnFocus(true) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree104.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree104.ets new file mode 100644 index 0000000000000000000000000000000000000000..024e905eb9cbf3fdeac58aa9266603a721f07b0d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree104.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIAttributesStateStylesInterfaceEditableTextThree104 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .enableKeyboardOnFocus(true) + .copyOptions(CopyOptions.LocalDevice) + .onCopy((event:CopyEvent) => { + promptAction.showToast({ message: 'onCopy功能生效' }) + }) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree105.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree105.ets new file mode 100644 index 0000000000000000000000000000000000000000..17749925e8b6c9feb3dae6c5c3ba25a9d701ba9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree105.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIAttributesStateStylesInterfaceEditableTextThree105 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .onEditingChange((isEditing: boolean) => { + promptAction.showToast({ message: "Current Editing Status:" + isEditing }) + }) + .border({ width: 1 }) + .margin({ bottom: 20 }) + + Button('clearFocus') + .id('clearFocus') + .width(200) + .height(50) + .fontColor(Color.White) + .backgroundColor(Color.Blue) + .onClick(() => { + this.getUIContext().getFocusController().clearFocus(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree106.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree106.ets new file mode 100644 index 0000000000000000000000000000000000000000..465356d3bbfd19385411f3f4e27d5a69f187254e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree106.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIAttributesStateStylesInterfaceEditableTextThree106 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .onEditingChange((isEditing: boolean) => { + promptAction.showToast({ message: 'Current Editing Status:' + isEditing }) + }) + .border({ width: 1 }) + .margin({ bottom: 20 }) + + Button('clearFocus') + .id('clearFocus') + .width(200) + .height(50) + .fontColor(Color.White) + .backgroundColor(Color.Blue) + .onClick(() => { + this.getUIContext().getFocusController().clearFocus(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree113.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree113.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc35e2e2b62087d61f704dfc7937032218cca81e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree113.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIAttributesStateStylesInterfaceEditableTextThree113 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .border({ width: 1 }) + .margin({ bottom: 20 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree117.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree117.ets new file mode 100644 index 0000000000000000000000000000000000000000..aa85ec1efa03fd97d24754899b044db8b0e1e096 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree117.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 UIAttributesStateStylesInterfaceEditableTextThree117 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State inputValue: string = ""; + + @Builder + CustomKeyboardBuilder() { + Column() { + Button('x') + .id('closeButton') + .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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .border({ width: 1 }) + .margin({ bottom: 20 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree120.ets new file mode 100644 index 0000000000000000000000000000000000000000..caeede1f7330a40067a782e29f6379d83edf68f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree120.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 UIAttributesStateStylesInterfaceEditableTextThree120 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State inputValue: string = ""; + + @Builder + CustomKeyboardBuilder() { + Column() { + Button('x') + .id('closeButton') + .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() { + RichEditor(this.options) + .customKeyboard(this.CustomKeyboardBuilder()) + .id('richEditorComponent') + .border({ width: 1 }) + .margin({ bottom: 20 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage001.ets new file mode 100644 index 0000000000000000000000000000000000000000..963fc13f45d3f2276459c3bfe9ac8d8fc54a3a0e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage001.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage001 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: StyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.controller.setStyledString(this.styleString) + } + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage002.ets new file mode 100644 index 0000000000000000000000000000000000000000..b2cdba76f0ed281cf4a1600910489b2876bcdf5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage002.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; + + +@Entry +@Component +struct UIComponentAttributeImage002 { + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + controller3: TextController = new TextController(); + controller4: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString1: StyledString | undefined = undefined; + styleString2: StyledString | undefined = undefined; + styleString3: StyledString | undefined = undefined; + styleString4: StyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString1 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: '10px', height: '10px' }, + })); + this.controller1.setStyledString(this.styleString1); + + this.styleString2 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: '10vp', height: '10vp' }, + })); + this.controller2.setStyledString(this.styleString2); + + this.styleString3 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: '10lpx', height: '10lpx' }, + })); + this.controller3.setStyledString(this.styleString3); + + this.styleString4 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: '10%', height: '10%' }, + })); + this.controller4.setStyledString(this.styleString4); + } + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .margin({ bottom: 10 }) + Text(undefined, { controller: this.controller2 }) + .margin({ bottom: 10 }) + Text(undefined, { controller: this.controller3 }) + .margin({ bottom: 10 }) + Text(undefined, { controller: this.controller4 }) + .margin({ bottom: 10 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage003.ets new file mode 100644 index 0000000000000000000000000000000000000000..b98eafc1300ae5848722e407665d7c9545e33234 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage003.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage003 { + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + controller3: TextController = new TextController(); + controller4: TextController = new TextController(); + controller5: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString1: MutableStyledString | undefined = undefined; + styleString2: MutableStyledString | undefined = undefined; + styleString3: MutableStyledString | undefined = undefined; + styleString4: MutableStyledString | undefined = undefined; + styleString5: MutableStyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + let paragraphStyledStr: MutableStyledString = new MutableStyledString("这是一个文本信息"); + this.styleString1 = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + verticalAlign: ImageSpanAlignment.TOP, + })) + this.styleString1.appendStyledString(paragraphStyledStr); + this.controller1.setStyledString(this.styleString1); + + this.styleString2 = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + verticalAlign: ImageSpanAlignment.CENTER, + })) + this.styleString2.appendStyledString(paragraphStyledStr); + this.controller2.setStyledString(this.styleString2); + + this.styleString3 = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + verticalAlign: ImageSpanAlignment.BOTTOM, + })) + this.styleString3.appendStyledString(paragraphStyledStr); + this.controller3.setStyledString(this.styleString3); + + this.styleString4 = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + verticalAlign: ImageSpanAlignment.BASELINE, + })) + this.styleString4.appendStyledString(paragraphStyledStr); + this.controller4.setStyledString(this.styleString4); + + this.styleString5 = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + verticalAlign: undefined, + })) + this.styleString5.appendStyledString(paragraphStyledStr); + this.controller5.setStyledString(this.styleString5); + } + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) { + } + .margin({ bottom: 10 }) + + Text(undefined, { controller: this.controller2 }) { + } + .margin({ bottom: 10 }) + + Text(undefined, { controller: this.controller3 }) { + } + .margin({ bottom: 10 }) + + Text(undefined, { controller: this.controller4 }) { + } + .margin({ bottom: 10 }) + + Text(undefined, { controller: this.controller5 }) { + } + .margin({ bottom: 10 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage004.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae7be008d1c1ea25bc22766da9f6e8fcd15220fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage004.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage004 { + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + controller3: TextController = new TextController(); + controller4: TextController = new TextController(); + controller5: TextController = new TextController(); + controller6: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString1: StyledString | undefined = undefined; + styleString2: StyledString | undefined = undefined; + styleString3: StyledString | undefined = undefined; + styleString4: StyledString | undefined = undefined; + styleString5: StyledString | undefined = undefined; + styleString6: StyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString1 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + objectFit: ImageFit.Contain + })); + this.controller1.setStyledString(this.styleString1); + + this.styleString2 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + objectFit: ImageFit.Cover + })); + this.controller2.setStyledString(this.styleString2); + + this.styleString3 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + objectFit: ImageFit.Auto + })); + this.controller3.setStyledString(this.styleString3); + + this.styleString4 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + objectFit: ImageFit.Fill + })); + this.controller4.setStyledString(this.styleString4); + + this.styleString5 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + objectFit: ImageFit.ScaleDown + })); + this.controller5.setStyledString(this.styleString5); + + this.styleString6 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + objectFit: ImageFit.None + })); + this.controller6.setStyledString(this.styleString6); + } + } + + build() { + Row() { + Column() { + Row() { + Text(undefined, { controller: this.controller1 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller2 }) + .margin({ bottom: 10 }) + .border({ width: 1, color: Color.Red }) + } + + Row() { + Text(undefined, { controller: this.controller3 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller4 }) + .margin({ bottom: 10 }) + .border({ width: 1, color: Color.Red }) + } + + Row() { + Text(undefined, { controller: this.controller5 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller6 }) + .margin({ bottom: 10 }) + .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/UIComponentAttributeImage/UIComponentAttributeImage005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage005.ets new file mode 100644 index 0000000000000000000000000000000000000000..89a49261583fc210c61823a542b475f417c51924 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage005.ets @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; +import { LengthUnit } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentAttributeImage005 { + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + controller3: TextController = new TextController(); + controller4: TextController = new TextController(); + controller5: TextController = new TextController(); + controller6: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString1: StyledString | undefined = undefined; + styleString2: StyledString | undefined = undefined; + styleString3: StyledString | undefined = undefined; + styleString4: StyledString | undefined = undefined; + styleString5: StyledString | undefined = undefined; + styleString6: StyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString1 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + margin: { + value: 10, + unit: LengthUnit.PX + } + } + })); + this.controller1.setStyledString(this.styleString1); + + this.styleString2 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + margin: { + value: 10, + unit: LengthUnit.VP + } + } + })); + this.controller2.setStyledString(this.styleString2); + + this.styleString3 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + margin: { + value: 10, + unit: LengthUnit.FP + } + } + })); + this.controller3.setStyledString(this.styleString3); + + this.styleString4 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + margin: { + value: 10, + unit: LengthUnit.LPX + } + } + })); + this.controller4.setStyledString(this.styleString4); + + this.styleString5 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + margin: { + value: 10, + unit: LengthUnit.PERCENT + } + } + })); + this.controller5.setStyledString(this.styleString5); + + this.styleString6 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + margin: { + right: '10abc', + left: '10abc', + top: '10abc', + bottom: '10abc' + } + } + })); + this.controller6.setStyledString(this.styleString6); + } + } + + build() { + Row() { + Column() { + Row() { + Text(undefined, { controller: this.controller1 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller2 }) + .margin({ bottom: 10 }) + .border({ width: 1, color: Color.Red }) + } + + Row() { + Text(undefined, { controller: this.controller3 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller4 }) + .margin({ bottom: 10 }) + .border({ width: 1, color: Color.Red }) + } + + Row() { + Text(undefined, { controller: this.controller5 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller6 }) + .margin({ bottom: 10 }) + .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/UIComponentAttributeImage/UIComponentAttributeImage006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage006.ets new file mode 100644 index 0000000000000000000000000000000000000000..91a128735b1809aa288265004de045d8a1f7ded0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage006.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage006 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: StyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + layoutStyle: { + margin: { + bottom: '20vp', + top: '10vp', + left: '10vp', + right: '20vp' + } + } + })); + this.controller.setStyledString(this.styleString) + } + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .border({ width: 1 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage007.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c7d19c2d6aa227f1ce4775a9d525f973b9bd7bf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage007.ets @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; +import { LengthUnit } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentAttributeImage007 { + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + controller3: TextController = new TextController(); + controller4: TextController = new TextController(); + controller5: TextController = new TextController(); + controller6: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString1: StyledString | undefined = undefined; + styleString2: StyledString | undefined = undefined; + styleString3: StyledString | undefined = undefined; + styleString4: StyledString | undefined = undefined; + styleString5: StyledString | undefined = undefined; + styleString6: StyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString1 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + padding: { + value: 10, + unit: LengthUnit.PX + } + } + })); + this.controller1.setStyledString(this.styleString1); + + this.styleString2 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + padding: { + value: 10, + unit: LengthUnit.VP + } + } + })); + this.controller2.setStyledString(this.styleString2); + + this.styleString3 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + padding: { + value: 10, + unit: LengthUnit.FP + } + } + })); + this.controller3.setStyledString(this.styleString3); + + this.styleString4 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + padding: { + value: 10, + unit: LengthUnit.LPX + } + } + })); + this.controller4.setStyledString(this.styleString4); + + this.styleString5 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + padding: { + value: 10, + unit: LengthUnit.PERCENT + } + } + })); + this.controller5.setStyledString(this.styleString5); + + this.styleString6 = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 200, height: 200 }, + layoutStyle: { + padding: { + left: '10abc', + right: '10abc', + bottom: '10abc', + top: '10abc' + } + } + })); + this.controller6.setStyledString(this.styleString6); + } + } + + build() { + Row() { + Column() { + Row() { + Text(undefined, { controller: this.controller1 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller2 }) + .margin({ bottom: 10 }) + .border({ width: 1, color: Color.Red }) + } + + Row() { + Text(undefined, { controller: this.controller3 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller4 }) + .margin({ bottom: 10 }) + .border({ width: 1, color: Color.Red }) + } + + Row() { + Text(undefined, { controller: this.controller5 }) + .margin({ right: 10, bottom: 10 }) + .border({ width: 1, color: Color.Red }) + Text(undefined, { controller: this.controller6 }) + .margin({ bottom: 10 }) + .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/UIComponentAttributeImage/UIComponentAttributeImage008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage008.ets new file mode 100644 index 0000000000000000000000000000000000000000..32035af4d453fd71bcba1b16ef9ddae2e48d101b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage008.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage008 { + @State controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: StyledString | undefined = undefined; + @State stringValue: string = ''; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.controller.setStyledString(this.styleString); + this.stringValue = 'String value:' + this.styleString.getString(); + } + } + + build() { + Row() { + Column() { + Text(this.stringValue).fontSize(26).fontColor(Color.Red); + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage009.ets new file mode 100644 index 0000000000000000000000000000000000000000..4710d6c7840d77d63eced372754acc82778b209c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage009.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage009 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: StyledString | undefined = undefined; + @State lengthValue: number = 0; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.controller.setStyledString(this.styleString); + this.lengthValue = this.styleString.length; + } + } + + build() { + Row() { + Column() { + Text('Length:' + this.lengthValue).fontSize(26).fontColor(Color.Red) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage010.ets new file mode 100644 index 0000000000000000000000000000000000000000..b2eef476db1e0055a9a3d0ba3b09cbcdfe9e784f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage010.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage010 { + controller: TextController = new TextController(); + controller2: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: StyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.controller.setStyledString(this.styleString); + let styleString2 = this.styleString.subStyledString(0, 1); + this.controller2.setStyledString(styleString2); + } + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller2 }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage011.ets new file mode 100644 index 0000000000000000000000000000000000000000..1bb255e6b8aaaa49d9980f82c0739fbdf55df3a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage011.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage011 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('Remove picture') + .id('UIComponentAttributeImage011') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + this.styleString.removeString(0, 1); + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage012.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a4cff006ce53e76487ae0d1b289fac12d7d2621 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage012.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage012 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertString(0,'hello') + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('Remove string') + .id('UIComponentAttributeImage012') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + this.styleString.removeString(0, 5); + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage013.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5ec15f506320c72e17ad5a244d5d64e69a447c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage013.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage013 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertString(1, "hello world"); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('Replace style') + .id('UIComponentAttributeImage013') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + this.styleString.replaceStyle({ + start: 0, + length: 1, + styledKey: StyledStringKey.IMAGE, + styledValue: new ImageAttachment({ + value: null, + size: { width: 100, height: 100 }, + }) + }); + + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage014.ets new file mode 100644 index 0000000000000000000000000000000000000000..e84ec103d1bf9cb019ba12efc96b2573a78c5a62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage014.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage014 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertString(1, "hello"); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('Replace style') + .id('UIComponentAttributeImage014') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + let replace = new StyledString(''); + this.styleString.replaceStyledString(0, this.styleString.length, replace); + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage015.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f0f59bb60d9fa80af545b3dafd8f66a7e3617c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage015.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage015 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertString(1, "hello"); + this.styleString.replaceStyle({ + start: 1, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: this.fontStyleAttr1 + }); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('clearStyles') + .id('UIComponentAttributeImage015') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + this.styleString.clearStyles(); + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage016.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3375222ed5fd67aa7127b437c14bf516f889029 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage016.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage016 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + replaceImagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + this.replaceImagePixelMap = await this.getPixmapFromMedia($r('app.media.img')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertString(1, "hello"); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('Replace image') + .id('UIComponentAttributeImage016') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString && this.replaceImagePixelMap) { + let replace = new MutableStyledString(new ImageAttachment({ + value: this.replaceImagePixelMap, + size: { width: 100, height: 100 }, + })); + + this.styleString.replaceStyledString(0, 6, replace); + + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage017.ets new file mode 100644 index 0000000000000000000000000000000000000000..530247538b583f55f8977b8c9f03e20ea65a1941 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage017.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage017 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + insertImagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + this.insertImagePixelMap = await this.getPixmapFromMedia($r('app.media.img')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertString(1, "hello"); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('insert image') + .id('UIComponentAttributeImage017') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString && this.insertImagePixelMap) { + let insert = new MutableStyledString(new ImageAttachment({ + value: this.insertImagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertStyledString(1, insert); + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage018.ets new file mode 100644 index 0000000000000000000000000000000000000000..0551e5fa9a7426f3ec7de07188088eda0006eca8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeImage/UIComponentAttributeImage018.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentAttributeImage018 { + controller: TextController = new TextController(); + imagePixelMap: image.PixelMap | undefined = undefined; + insertImagePixelMap: image.PixelMap | undefined = undefined; + styleString: MutableStyledString | undefined = undefined; + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + this.insertImagePixelMap = await this.getPixmapFromMedia($r('app.media.img')).then(); + if (this.imagePixelMap !== undefined) { + this.styleString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.insertString(1, "hello"); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Row() { + Column() { + Button('append image') + .id('UIComponentAttributeImage018') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString && this.insertImagePixelMap) { + let insert = new MutableStyledString(new ImageAttachment({ + value: this.insertImagePixelMap, + size: { width: 100, height: 100 }, + })); + this.styleString.appendStyledString(insert); + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..bfcb79bf61b80a7c90de3fd4c7cc902ab6fc9372 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle0120.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 UIComponentAttributeStringModifyingStyle0120 { + controller: TextController = new TextController(); + mutableStyledString: MutableStyledString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue, }), + }, { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red, }), + }]); + @State msg: string = ''; + + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('SetStlye') + .id('insert') + .margin({ bottom: 20 }) + .onClick(() => { + try { + this.mutableStyledString.setStyle({start:0, length:-1, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({ fontColor: Color.Green })}); + } catch (err) { + this.msg = err.code; + } + }) + + Text(undefined, { controller: this.controller }) { + } + Text('错误码:' + this.msg) + .fontSize(20) + .fontColor(Color.Red) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle015.ets new file mode 100644 index 0000000000000000000000000000000000000000..c66e75fd62b213f0bdd91e198782ba01fa9b9cf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle015.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 UIComponentAttributeStringModifyingStyle015 { + controller: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('remove Style') + .id('UIComponentAttributeStringModifyingStyle015') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.mutableStyledString) { + this.mutableStyledString.removeStyle(2, 4, StyledStringKey.FONT); + this.controller.setStyledString(this.mutableStyledString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle016.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b0364a52e11cfedd1bacd259a75646e24949fe6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle016.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 UIComponentAttributeStringModifyingStyle016 { + controller: TextController = new TextController(); + controller1: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + styleString1: MutableStyledString | undefined = undefined; + getStyle: Array = []; + + async onPageShow() { + this.styleString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Row() { + Column() { + Button('get Style') + .id('UIComponentAttributeStringModifyingStyle016') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + this.styleString.removeStyle(0, 4, StyledStringKey.FONT); + this.controller.setStyledString(this.styleString); + this.getStyle = this.styleString.getStyles(0, 8, StyledStringKey.FONT) + this.styleString1 = new MutableStyledString('这是获取的返回样式', this.getStyle); + this.controller.setStyledString(this.styleString); + this.controller1.setStyledString(this.styleString1); + } + }) + Text(undefined, { controller: this.controller }) { + } + + Text(undefined, { controller: this.controller1 }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle022.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec5d1920445c0a4b8a3e021563fe666177a4ae8d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle022.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 UIComponentAttributeStringModifyingStyle022 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + + async onPageShow() { + this.styleString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Row() { + Column() { + Button('Clear specified style') + .id('UIComponentAttributeStringModifyingStyle022') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + this.styleString.removeStyles(2, 4); + this.controller.setStyledString(this.styleString); + } + }) + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle023.ets new file mode 100644 index 0000000000000000000000000000000000000000..a3dceb685509a850241cd6100e21cbaf164e44c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle023.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 UIComponentAttributeStringModifyingStyle023 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + @State styles: string| undefined = undefined; + getStyle: Array = []; + + async onPageShow() { + this.styleString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Row() { + Column() { + Button('Remove styles then get styles') + .id('UIComponentAttributeStringModifyingStyle023') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.styleString) { + this.styleString.removeStyles(0, 8); + this.controller.setStyledString(this.styleString); + this.getStyle = this.styleString.getStyles(0, 8, StyledStringKey.FONT); + this.styles = '清除样式后获取到的样式:' + JSON.stringify(this.getStyle); + } + }) + Text(undefined, { controller: this.controller }) { + } + + Text(this.styles) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..797dc66c5eed65fec2e2a9ebef7eb27e34352650 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0090.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 UIComponentAttributeStringModifyingStyleText0090 { + controller: TextController = new TextController(); + mutableStyledString: MutableStyledString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue, }), + }, { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red, }), + }]); + @State msg: string = ''; + + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('Insert string') + .id('insert') + .margin({ bottom: 20 }) + .onClick(() => { + try { + let mutableStyledString = new MutableStyledString('输入框', [{ + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green }) + }]); + this.mutableStyledString.insertStyledString(-1, mutableStyledString); + } catch (err) { + this.msg = err.code; + } + }) + + Text(undefined, { controller: this.controller }) { + } + Text('错误码:' + this.msg) + .fontSize(20) + .fontColor(Color.Red) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..01e4c80cfec845d27c1c3dff68a6748bc46ba861 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0100.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 UIComponentAttributeStringModifyingStyleText0100 { + controller: TextController = new TextController(); + mutableStyledString: MutableStyledString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue, }), + }, { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red, }), + }]); + @State msg: string = ''; + + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('Insert string') + .id('insert') + .margin({ bottom: 20 }) + .onClick(() => { + try { + let mutableStyledString = new MutableStyledString('输入框', [{ + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green }) + }]); + this.mutableStyledString.insertStyledString(10, mutableStyledString); + } catch (err) { + this.msg = err.code; + } + }) + + Text(undefined, { controller: this.controller }) { + } + Text('错误码:' + this.msg) + .fontSize(20) + .fontColor(Color.Red) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText011.ets new file mode 100644 index 0000000000000000000000000000000000000000..54b8f2561196358397ee63f1e6e6b6f8dd5a78cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText011.ets @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { JSON } from '@kit.ArkTS'; + +@Entry +@Component +struct UIComponentAttributeStringModifyingStyleText011 { + controller: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + @State text1: string = ''; + @State text2: string = ''; + @State text3: string = ''; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('这是一段测试文字', [ + { + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + } + ]); + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('Insert string') + .id('insert') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.mutableStyledString) { + this.mutableStyledString.insertStyledString(4, new StyledString('输入框', [{ + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green }) + }])) + this.controller.setStyledString(this.mutableStyledString); + } + }) + + Button('getString') + .id('getString') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.mutableStyledString) { + this.text1 = this.mutableStyledString.getString(); + } + }) + + Button('getLength') + .id('getLength') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.mutableStyledString) { + this.text2 = this.mutableStyledString.length + ''; + } + }) + + Button('getStyles') + .id('getStyles') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.mutableStyledString) { + this.text3 = JSON.stringify(this.mutableStyledString.getStyles(0, 11, StyledStringKey.FONT)); + console.log('StyleText011:: ' + JSON.stringify(new TextStyle({ fontColor: Color.Red }))); + } + }) + + Text(undefined, { controller: this.controller }) { + } + + Text(this.text1).fontSize(24) + Text(this.text2).fontSize(24).margin(10) + Text(this.text3).fontSize(24) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText023.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc40e1b8ec8341d0e9fe48ac14dae6a08a37a1ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText023.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 UIComponentAttributeStringModifyingStyleText023 { + controller: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('这是一段测试文字', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]); + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('Insert string') + .id('insert') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.mutableStyledString) { + this.mutableStyledString.insertString(0, "1"); + this.controller.setStyledString(this.mutableStyledString); + } + }) + + Button('remove string') + .id('delete') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.mutableStyledString) { + this.mutableStyledString.removeString(0, 1); + this.controller.setStyledString(this.mutableStyledString); + } + }) + + Text(undefined, { controller: this.controller }) { + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeUserData/UIComponentAttributeUserData0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeUserData/UIComponentAttributeUserData0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..73ec85b7566501174d853a9a665497763357c8c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAttributeUserData/UIComponentAttributeUserData0030.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. + */ +class AtSpan extends UserDataSpan { + constructor(name: string, age: number) { + super() + this.name = name + this.age = age + } + + private name: string + private age: number +} + +@Entry +@Component +struct UIComponentAttributeUserData0030 { + controller: TextController = new TextController(); + styledString3: MutableStyledString = new MutableStyledString('styledString3', [{ + start: 0, + length: 2, + styledKey: StyledStringKey.USER_DATA, + styledValue: new AtSpan('hello', 30), + }]); + @State msg: string = ''; + @State msg1: string = ''; + @State msg2: string = ''; + @State msg3: string = ''; + + async onPageShow() { + this.controller.setStyledString(this.styledString3); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller }) { + } + + Row() { + Button('getStlye') + .id('getStlye') + .margin({ bottom: 20 }) + .onClick(() => { + try { + this.styledString3.getStyles(10, 7); + } catch (err) { + this.msg = err.code; + } + }) + Button('getStlye1') + .id('getStlye1') + .margin({ bottom: 20 }) + .onClick(() => { + try { + this.msg1 = JSON.stringify(this.styledString3.getStyles(0, 2)); + } catch (err) { + this.msg = err.code; + } + }) + Button('getStlye2') + .id('getStlye2') + .margin({ bottom: 20 }) + .onClick(() => { + try { + this.msg2 = JSON.stringify(this.styledString3.getStyles(2, 2)); + } catch (err) { + this.msg = err.code; + } + }) + } + + Button('getStlye3') + .id('getStlye3') + .margin({ bottom: 20 }) + .onClick(() => { + try { + this.msg3 = JSON.stringify(this.styledString3.getStyles(0, 12)); + } catch (err) { + this.msg = err.code; + } + }) + + Text(this.msg1) + .fontSize(20) + .fontColor(Color.Red) + Text(this.msg2) + .fontSize(20) + .fontColor(Color.Red) + Text(this.msg3) + .fontSize(20) + .fontColor(Color.Red) + Text('错误码:' + this.msg) + .fontSize(20) + .fontColor(Color.Red) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..b07e37e69d07118580309b14806cfffddb8797a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor001.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 UIComponentCreateColor001 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + TextInput({ controller: this.controller, text: this.inputValue }) + .id('inputComponent') + .margin(10) + .border({ width: 1 }) + .height('48vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor002.ets new file mode 100644 index 0000000000000000000000000000000000000000..8990f3934c25a5d7c25d2d98a0d56a62f0a50504 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor002.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 UIComponentCreateColor002 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State selectedBackgroundColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the selected background color to red') + .id('redBackground') + .margin({ bottom: 20 }) + .onClick(() => { + this.selectedBackgroundColor = Color.Red; + }) + + Button('Change the selected background color to green') + .id('greenBackground') + .margin({ bottom: 20 }) + .onClick(() => { + this.selectedBackgroundColor = Color.Green; + }) + + TextInput({ controller: this.controller, text: this.inputValue }) + .id('inputComponent') + .margin(10) + .border({ width: 1 }) + .height('48vp') + .selectedBackgroundColor(this.selectedBackgroundColor) + .copyOption(CopyOptions.LocalDevice) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor003.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba29dadac018af26b069ebc841c9ffb03f43ce66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor003.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 UIComponentCreateColor003 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + @State opacityNumber: number = 1; + + build() { + Column() { + Button('caretColor') + .id('caretColor') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = " rgba(255,0,0,0.5)"; + }) + + Button('opacity') + .id('opacity') + .margin({ bottom: 20 }) + .onClick(() => { + this.opacityNumber = 0.2; + }) + + TextInput({ controller: this.controller, text: this.inputValue }) + .id('inputComponent') + .margin(10) + .border({ width: 1 }) + .height('48vp') + .opacity(this.opacityNumber) + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor004.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ca2138489eb8162fe571e96d9a34e72e0882d17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor004.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 UIComponentCreateColor004 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + @State selectedBackgroundColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Set caretColor to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Set caretColor to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + Button('Set selectedBackgroundColor to red') + .id('redBackgroundColor') + .margin({ bottom: 20 }) + .onClick(() => { + this.selectedBackgroundColor = Color.Red; + }) + + Button('Set selectedBackgroundColor to green') + .id('greenBackgroundColor') + .margin({ bottom: 20 }) + .onClick(() => { + this.selectedBackgroundColor = Color.Green; + }) + + TextInput({ controller: this.controller, text: this.inputValue }) + .id('inputComponent') + .margin(10) + .border({ width: 1 }) + .height('48vp') + .caretColor(this.caretColor) + .selectedBackgroundColor(this.selectedBackgroundColor) + .copyOption(CopyOptions.LocalDevice) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_1.ets new file mode 100644 index 0000000000000000000000000000000000000000..12c1bfae3f017aa3b12ab5e483a9ad0b89eb1875 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_1.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 UIComponentCreateColor006_1 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Row() { + Text('Normal') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0060') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.Normal) + } + + Row() { + Text('Password') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0061') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.Password) + } + + Row() { + Text('Email') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0062') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.Email) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_2.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_2.ets new file mode 100644 index 0000000000000000000000000000000000000000..cf02e28bc86c0b30fe98afd2273ba7a96c47efa9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_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. + */ + +@Entry +@Component +struct UIComponentCreateColor006_2 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Set caretColor to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Row() { + Text('Number') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0063') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.Number) + } + + Row() { + Text('PhoneNumber') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0064') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.PhoneNumber) + } + + Row() { + Text('USER_NAME') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0065') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.USER_NAME) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_3.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_3.ets new file mode 100644 index 0000000000000000000000000000000000000000..fafc203ff0f5d070bfe58a003c9fb0863748039a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor006_3.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 UIComponentCreateColor006_3 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Set caretColor to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + Row() { + Text('NEW_PASSWORD') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0066') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.NEW_PASSWORD) + } + + Row() { + Text('NUMBER_PASSWORD') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0067') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.NUMBER_PASSWORD) + } + + Row() { + Text('NUMBER_DECIMAL') + TextInput({ controller: this.controller, text: this.inputValue }) + .id('UIComponentCreateColor0068') + .margin(5) + .border({ width: 1 }) + .height('35vp') + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + .type(InputType.NUMBER_DECIMAL) + } + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor007.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b00a34f84f2b10122168e8225f807551b8da37a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor007.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 UIComponentCreateColor007 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + TextInput({ controller: this.controller, text: this.inputValue }) + .id('inputComponent') + .margin(10) + .border({ width: 1 }) + .height('48vp') + .style(TextContentStyle.INLINE) + .caretColor(this.caretColor) + .copyOption(CopyOptions.LocalDevice) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor008.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbd9e114e6aef8f6d6121b9bb8990851b60c3261 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor008.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 UIComponentCreateColor008 { + controller: TextAreaController = new TextAreaController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + TextArea({ controller: this.controller, text: this.inputValue}) + .id('textAreaComponent') + .caretColor(this.caretColor) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor009.ets new file mode 100644 index 0000000000000000000000000000000000000000..4564984b96d54fe4a147e934754429bd8c9513a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor009.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 UIComponentCreateColor009 { + controller: TextAreaController = new TextAreaController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + @State opacityNumber: number = 1; + + build() { + Column() { + Button('caretColor') + .id('caretColor') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = " rgba(255,0,0,0.5)"; + }) + + Button('opacity') + .id('opacity') + .margin({ bottom: 20 }) + .onClick(() => { + this.opacityNumber = 0.2; + }) + + TextArea({ controller: this.controller, text: this.inputValue}) + .id('textAreaComponent') + .caretColor(this.caretColor) + .height(200) + .opacity(this.opacityNumber) + .copyOption(CopyOptions.LocalDevice) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor011.ets new file mode 100644 index 0000000000000000000000000000000000000000..67450e6f31da54d3c39230e4d5ad19caf5b0c23e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor011.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 UIComponentCreateColor011 { + controller: TextAreaController = new TextAreaController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + @State opacityNumber: number = 1; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + TextArea({ controller: this.controller, text: this.inputValue }) + .id('textAreaComponent') + .caretColor(this.caretColor) + .height(200) + .opacity(this.opacityNumber) + .copyOption(CopyOptions.LocalDevice) + .style(TextContentStyle.INLINE) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..77d0abf84622aeb1b6e407ff247c20aeae57a76e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0120.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 UIComponentCreateColor0120 { + controller: TextAreaController = new TextAreaController(); + @State inputValue: string = "123333445454545451212"; + @State typeNormal: TextAreaType = TextAreaType.NORMAL; + + build() { + Column() { + TextArea({ controller: this.controller, text: this.inputValue }) + .id('textAreaComponent') + .type(this.typeNormal) + .width('50%') + .height(50) + .margin(2) + Button('切换输入框类型为email') + .id('changeButton1') + .margin(2) + .onClick(() => { + this.typeNormal = TextAreaType.EMAIL; + }) + Button('切换输入框类型为NUMBER') + .id('changeButton2') + .margin(2) + .onClick(() => { + this.typeNormal = TextAreaType.NUMBER; + }) + Button('切换输入框类型为PHONE_NUMBER') + .id('changeButton3') + .margin(2) + .onClick(() => { + this.typeNormal = TextAreaType.PHONE_NUMBER; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..981168393a3a57e9cd30cb123c7afb29f2c86c57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0130.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 UIComponentCreateColor0130 { + controller: SearchController = new SearchController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .caretStyle({ + width: '1.5vp', + color: this.caretColor + }) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..8ef19d3824526e2d7115265beb968ed42dc3f342 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0140.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 UIComponentCreateColor0140 { + controller: SearchController = new SearchController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + Button('setTextSelection') + .id('setTextSelection') + .margin({ bottom: 20 }) + .onClick(() => { + this.controller.setTextSelection(0, 5); + }) + + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .caretStyle({ + width: '1.5vp', + color: this.caretColor + }) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..51f0a64b765859165b8b2add0a5abdeaa3347995 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0150.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 UIComponentCreateColor0150 { + controller: SearchController = new SearchController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to rgba(255,0,0,0.5)') + .id('btnCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = 'rgba(255,0,0,0.5)'; + }) + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .caretStyle({ + width: '1.5vp', + color: this.caretColor + }) + .opacity(0.2) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..234ae91ce772515be0d4b1f5353c6d2d9212207b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0160.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 UIComponentCreateColor0160 { + controller: SearchController = new SearchController(); + @State inputValue: string = "123333445454545451212"; + @State typeNormal: SearchType = SearchType.NORMAL; + + build() { + Column() { + Search({ controller: this.controller, value: this.inputValue }) + .id('textAreaComponent') + .type(this.typeNormal) + .width('50%') + .height(50) + .margin(2) + Button('切换输入框类型为email') + .id('changeButton1') + .margin(2) + .onClick(() => { + this.typeNormal = SearchType.EMAIL; + }) + Button('切换输入框类型为NUMBER') + .id('changeButton2') + .margin(2) + .onClick(() => { + this.typeNormal = SearchType.NUMBER; + }) + Button('切换输入框类型为PHONE_NUMBER') + .id('changeButton3') + .margin(2) + .onClick(() => { + this.typeNormal = SearchType.PHONE_NUMBER; + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f5e9c4558548160e8dfb21c6eeee3e90dfead69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0170.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 UIComponentCreateColor0170 { + controller: SearchController = new SearchController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .caretStyle({ + width: '1.5vp', + color: this.caretColor + }) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..f69004faf9b88cf768c84dba4ebce876cb7efa17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0180.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 UIComponentCreateColor0180 { + controller: SearchController = new SearchController(); + @State inputValue: string = ''; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .caretStyle({ + width: '5vp', + color: this.caretColor + }) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..b5c72f22118aae5f92a6c3100f96f39d984454c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0200.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 UIComponentCreateColor0200 { + controller: TextAreaController = new TextAreaController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + TextArea({ controller: this.controller, text: this.inputValue }) + .id('textAreaComponent') + .caretStyle({ + width: '1.5vp', + color: this.caretColor + }) + .selectedBackgroundColor(this.caretColor) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..746dc4e94140c7a970b5a6c9bcdac8f6fd434d18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCreateColor/UIComponentCreateColor0210.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 UIComponentCreateColor0210 { + controller: SearchController = new SearchController(); + @State inputValue: string = ""; + @State caretColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('Change the caret color to red') + .id('redCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Red; + }) + + Button('Change the caret color to green') + .id('greenCaret') + .margin({ bottom: 20 }) + .onClick(() => { + this.caretColor = Color.Green; + }) + + Search({ controller: this.controller, value: this.inputValue }) + .id('searchComponent') + .caretStyle({ + width: '1.5vp', + color: this.caretColor + }) + .selectedBackgroundColor(this.caretColor) + .height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..bfe0d4b40df6abeebd9991a43f4aea1a8faa1180 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0010.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 { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0010 { + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + TextInput() + .width('20%') + .margin({ + top:500 + }) + TextArea() + .width('20%') + .id('UIComponentInputKeyboardAvoidMode0010_001') + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..1382762afeb12166f29dc982a7c6889727d720a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0020.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 { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0020 { + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + TextInput() + .width('20%') + .style(TextInputStyle.Inline) + .margin({ + top:500 + }) + TextArea() + .width('20%') + .style(TextContentStyle.INLINE) + .id('UIComponentInputKeyboardAvoidMode0020_001') + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..de81dab5c0161f7e4cf077854d3a4009d3acd89a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0030.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 { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0030 { + @State inputMode: TextInputStyle = TextInputStyle.Inline; + @State areaMode: TextContentStyle = TextContentStyle.INLINE; + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + Button('切换') + .id('UIComponentInputKeyboardAvoidMode0030_002') + .onClick(() => { + this.inputMode = this.inputMode == TextInputStyle.Inline ? TextInputStyle.Default : TextInputStyle.Inline; + this.areaMode = this.areaMode == TextContentStyle.INLINE ? TextContentStyle.DEFAULT : TextContentStyle.INLINE; + }) + .margin({ + top: 500 + }) + TextInput() + .width('20%') + .style(this.inputMode) + TextArea() + .width('20%') + .style(this.areaMode) + .id('UIComponentInputKeyboardAvoidMode0030_001') + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6f833b40125157ad6b03c7e442a13f901fe339c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0040.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. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0040 { + controller: TextInputController = new TextInputController() + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + Button('button') + .id('UIComponentInputKeyboardAvoidMode0040_002') + .onClick(() => { + this.controller.caretPosition(1); + }) + .margin({ + top: 500 + }) + TextInput({ text: 'text', controller: this.controller }) + .id('UIComponentInputKeyboardAvoidMode0040_001') + .width('20%') + TextArea() + .width('20%') + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..5fada81ff3bd082c1258fb395aa20d88a5695af9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0050.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. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0050 { + @State sizeText: number = 15; + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + Button('button') + .id('UIComponentInputKeyboardAvoidMode0050_002') + .onClick(()=>{ + this.sizeText = 30; + }) + .margin({ + top:500 + }) + TextInput() + .width('20%') + TextArea({text: '这是一段测试中文断行的文字'}) + .width('20%') + .id('UIComponentInputKeyboardAvoidMode0050_001') + .fontSize(this.sizeText) + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..d426f0d5c80edfb90254b3c56569ace176e92f03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0060.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0060 { + @State letterSpacing: number = 0; + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + Button('button') + .id('UIComponentInputKeyboardAvoidMode0060_002') + .onClick(() => { + this.letterSpacing = 25; + }) + .margin({ + top: 500 + }) + TextInput() + .width('20%') + TextArea({ text: '这是一段测试中文断行的文字' }) + .width('20%') + .id('UIComponentInputKeyboardAvoidMode0060_001') + .letterSpacing(this.letterSpacing) + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4eec9677bd3bff124aa903a66e04e31f528d1a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0070.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. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0070 { + @State inputWidth: number = 200; + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + Button('button') + .id('UIComponentInputKeyboardAvoidMode0070_002') + .onClick(()=>{ + this.inputWidth = 100; + }) + .margin({ + top:500 + }) + TextInput() + .width('20%') + TextArea({text: '这是一段测试中文断行的文字'}) + .width(this.inputWidth) + .id('UIComponentInputKeyboardAvoidMode0070_001') + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c0288b6e89dc1ff794217cee4a6194e5ce28b8f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0080.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. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; +import TestAbility from '../../TestAbility'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0080 { + @State alignment: TextAlign = TextAlign.Center; + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + Button('button') + .id('UIComponentInputKeyboardAvoidMode0080_002') + .onClick(() => { + this.alignment = TextAlign.End; + }) + .margin({ + top: 500 + }) + TextInput() + .width('20%') + TextArea({ text: '测试文字' }) + .width('40%') + .id('UIComponentInputKeyboardAvoidMode0080_001') + .textAlign(this.alignment) + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e845e0fc95c3c6a7ee644c0bf021eb0ca4b2a9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0090.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 { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0090 { + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + Scroll(){ + TextArea() + .width('20%') + .id('UIComponentInputKeyboardAvoidMode0090_001') + } + .margin({ + top:500 + }) + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b4e8e0c910102b8576893beb1a9db7be6f8b7f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0100.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 { KeyboardAvoidMode } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0100 { + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET); + } + + build() { + Column() { + Button() + .id('UIComponentInputKeyboardAvoidMode0100_002') + .onClick(() => { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE_WITH_CARET); + }) + .margin({ + top: 500 + }) + TextInput() + .width('20%') + TextArea({ text: '这是一段测试中文断行的文字' }) + .width('40%') + .id('UIComponentInputKeyboardAvoidMode0100_001') + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..77fe8ff77075dd4c1fc4274fca0cfd52f2188e5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0110.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. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; +import TestAbility from '../../TestAbility'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0110 { + @State alignment: TextAlign = TextAlign.Center; + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + TextInput() + .margin({ + top: 500 + }) + .width('20%') + TextArea({ text: '这是一段测试中文断行的文字' }) + .width('40%') + .id('UIComponentInputKeyboardAvoidMode0110_001') + .textAlign(this.alignment) + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..abb03524f2ad171cd94dc29f057658ea3c715886 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0120.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. + */ +import { KeyboardAvoidMode } from '@kit.ArkUI'; +import TestAbility from '../../TestAbility'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0120 { + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + TextInput() + .id('UIComponentInputKeyboardAvoidMode0120_002') + .width('30%') + .height('30%') + .draggable(true) + .margin({ + top: 200 + }) + TextArea({ text: '这是一段测试中文断行的文字' }) + .width('20%') + .id('UIComponentInputKeyboardAvoidMode0120_001') + .draggable(true) + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..8df2dfc8605e4f4cc763aa1969fadf3c31dddf64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0130.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 { KeyboardAvoidMode } from '@kit.ArkUI'; +import TestAbility from '../../TestAbility'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0130 { + @State alignment: TextAlign = TextAlign.Center; + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + TextInput() + .margin({ + top: 500 + }) + .width('20%') + TextArea({ text: '这是一段测试中文断行的文字,这是一段测试中文断行的文字' }) + .width('20%') + .height(75) + .id('UIComponentInputKeyboardAvoidMode0130_001') + .textAlign(this.alignment) + Search() + } + .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/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a5660ef53b5254995c950d436dd6218b266013e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0150.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 { KeyboardAvoidMode } from '@kit.ArkUI'; +import TestAbility from '../../TestAbility'; + +@Entry +@Component +struct UIComponentInputKeyboardAvoidMode0150 { + @State alignment: TextAlign = TextAlign.Center; + + onPageShow(): void { + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET_WITH_CARET / KeyboardAvoidMode.RESIZE_WITH_CARET); + } + + build() { + Column() { + TextInput() + .margin({ + top: 500 + }) + .width('20%') + TextArea({ text: '这是一段测试中文断行的文字,这是一段测试中文断行的文字' }) + .width('20%') + .height(75) + .id('UIComponentInputKeyboardAvoidMode0150_001') + .textAlign(this.alignment) + Search() + } + .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/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..eaf43b5cebf21a2a6cd64c01b8c0d685788c21d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0430.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 UIComponentScrollSwiperInterfacemix0430 { + @State oneTextInputColor: Color = Color.Gray; + + build() { + Row() { + Column() { + TextInput({ placeholder: 'enter your password...' }) + .type(InputType.Password) + .id('TextInput0430') + .width(350) + .height(80) + .passwordIcon({ onIconSrc: "offIcon.png", offIconSrc: "onIcon.png" }) + .backgroundColor(this.oneTextInputColor) + .defaultFocus(true) + .onFocus(() => { + this.oneTextInputColor = Color.Green; + }) + .onBlur(() => { + this.oneTextInputColor = Color.Gray; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..779b6e4427eef5b4d578db6a0a65147b871b1fbd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0440.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 UIComponentScrollSwiperInterfacemix0440 { + @State TextInputColor: Color = Color.Gray; + + build() { + Row() { + Column() { + TextInput({ placeholder: 'enter your password...' }) + .type(InputType.NUMBER_PASSWORD) + .id('TextInput0440') + .width(350) + .height(80) + .passwordIcon({ onIconSrc: "offIcon.png", offIconSrc: "onIcon.png" }) + .backgroundColor(this.TextInputColor) + .defaultFocus(true) + .onFocus(() => { + this.TextInputColor = Color.Green; + }) + .onBlur(() => { + this.TextInputColor = Color.Gray; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..354326c26b5c73cc08d48bad0b8431391465212e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0450.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. + */ +import { uiAppearance } from '@kit.ArkUI' + + +@Entry +@Component +struct UIComponentScrollSwiperInterfacemix0450 { + @State TextInputColor: Color = Color.Gray; + + build() { + Row() { + Column() { + TextInput({ placeholder: 'enter your password...' }) + .type(InputType.SCREEN_LOCK_PASSWORD) + .id('TextInput0450') + .width(350) + .height(80) + .passwordIcon({ onIconSrc: "offIcon.png", offIconSrc: "onIcon.png" }) + .backgroundColor(this.TextInputColor) + .defaultFocus(true) + .onFocus(() => { + this.TextInputColor = Color.Green; + }) + .onBlur(() => { + this.TextInputColor = Color.Gray; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..e8a43c33bf0892c73349c41ede14929beb0ace69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0460.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 UIComponentScrollSwiperInterfacemix0460 { + @State TextInputColor: Color = Color.Gray; + + build() { + Row() { + Column() { + TextInput({ placeholder: 'enter your password...' }) + .type(InputType.NEW_PASSWORD) + .id('TextInput0460') + .width(350) + .height(80) + .passwordIcon({ onIconSrc: "offIcon.png", offIconSrc: "onIcon.png" }) + .backgroundColor(this.TextInputColor) + .defaultFocus(true) + .onFocus(() => { + this.TextInputColor = Color.Green; + }) + .onBlur(() => { + this.TextInputColor = Color.Gray; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..7bf6863c49fc9ddea24f39905c8ef826645a1780 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0470.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 UIComponentScrollSwiperInterfacemix0470 { + @State TextInputColor: Color = Color.Gray; + + build() { + Row() { + Column() { + TextInput({ placeholder: 'enter your password...' }) + .id('TextInput0470') + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + size: 45, + src: "offIcon.png", + color: Color.Blue + } + }) + .width(350) + .height(80) + .passwordIcon({ onIconSrc: "offIcon.png", offIconSrc: "onIcon.png" }) + .backgroundColor(this.TextInputColor) + .defaultFocus(true) + .onFocus(() => { + this.TextInputColor = Color.Green; + }) + .onBlur(() => { + this.TextInputColor = Color.Gray; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0890.ets new file mode 100644 index 0000000000000000000000000000000000000000..e8d17b995c2e144821e30014bb0485392ac997db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0890.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 UIComponentScrollSwiperInterfacemix0890 { + + build() { + Row() { + Column() { + TextInput() + .id('TextInput0890') + .width(500) + .cancelButton({ + style: CancelButtonStyle.CONSTANT + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1120.ets new file mode 100644 index 0000000000000000000000000000000000000000..4bcb11b737ac689c298df0edb9d04c16c36234e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1120.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 UIComponentScrollSwiperInterfacemix1120 { + @State message: string = + '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' + + build() { + Row() { + Column() { + TextInput({ text: this.message }) + .width(380) + .height(300) + .id('textinput1120') + .maxLength(110) + .showCounter(true, { thresholdPercentage: 100, highlightBorder: true }) + .defaultFocus(true) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1140.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb6e3461a7bbcfd3389278e12957081803c31e4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1140.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 UIComponentScrollSwiperInterfacemix1140 { + + build() { + Row() { + Column() { + TextInput({ placeholder: 'enter your password...' }) + .id('TextInput1140') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1150.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f63de0c0a712e70d71e253afbe21266685b6e7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1150.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 UIComponentScrollSwiperInterfacemix1150 { + @State TextInputColor: Color = Color.Gray; + + build() { + Row() { + Column() { + TextInput() + .width(380) + .height(60) + .id('TextInput1150') + .defaultFocus(true) + .backgroundColor(this.TextInputColor) + .onFocus(() => { + this.TextInputColor = Color.Green; + }) + .onBlur(() => { + this.TextInputColor = Color.Gray; + }) + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + size: 45, + src: "icon.png", + color: Color.Blue + } + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1160.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3c5ba2e769e3794996ce23b8e1807630cd13bcc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1160.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 UIComponentScrollSwiperInterfacemix1160 { + @State TextInputColor: Color = Color.Gray; + + build() { + Row() { + Column() { + TextInput() + .width(380) + .height(60) + .id('TextInput1160') + .defaultFocus(false) + .backgroundColor(this.TextInputColor) + .focusable(false) + .onFocus(() => { + this.TextInputColor = Color.Green; + }) + .onBlur(() => { + this.TextInputColor = Color.Gray; + }) + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + size: 45, + src: "icon.png", + color: Color.Blue + } + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1170.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8556515125c8bc5f0f717fc339e31f5ba4fa56d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1170.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 UIComponentScrollSwiperInterfacemix1170 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + TextInput({ text: 'hello word drow olleh' }) + .type(InputType.Normal) + .width(380) + .height(60) + .inputFilter('hello word') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1180.ets new file mode 100644 index 0000000000000000000000000000000000000000..1776d70a585545ab5fe1b1d618ba6bfe80bc4d8d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1180.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. + */ +import { uiAppearance } from '@kit.ArkUI' + + +@Entry +@Component +struct UIComponentScrollSwiperInterfacemix1180 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + TextInput({ text: 'hello word drow olleh' }) + .type(InputType.Normal) + .width(380) + .height(60) + .inputFilter('hello') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1190.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a9b38df4fc51452a8b7d08d6a8507d251b93a7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1190.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 UIComponentScrollSwiperInterfacemix1190 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + TextInput({ text: 'hello word 大家好 大家 drow olleh' }) + .type(InputType.Normal) + .width(380) + .height(60) + .inputFilter('大家好') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1200.ets new file mode 100644 index 0000000000000000000000000000000000000000..ecfa5ae092603cb3f1b4e93e98ed0b4820f6bd79 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1200.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 UIComponentScrollSwiperInterfacemix1200 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + TextInput({ text: '大家好 大家好 你好' }) + .type(InputType.Normal) + .width(380) + .height(60) + .inputFilter('大家好') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1220.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a5fa08a150fe4551dec9fa692cc00d4721801c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1220.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 UIComponentScrollSwiperInterfacemix1220 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + TextInput({ text: '大家好_hello, 大家 drow olleh' }) + .type(InputType.Normal) + .width(380) + .height(60) + .inputFilter('大家好_hello') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..25a9c6896dca92d1920d8f60de49c8e1129dbecf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0010.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 UIComponentTextAttribute0010 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(TextOverflow.None) + .width('100%') + .id('UIComponentTextAttribute0010') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..5edb4a0e2746444eb597ca23ddb50bdcb247b0ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0020.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 UIComponentTextAttribute0020 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(TextOverflow.Clip) + .width('100%') + .id('UIComponentTextAttribute0020') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..b15403b1e48759ceef7872f4432487d0913494f7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0030.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 UIComponentTextAttribute0030 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(TextOverflow.Ellipsis) + .width('100%') + .id('UIComponentTextAttribute0030') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb12537f66605365f09499366f05959710edf886 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0040.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 UIComponentTextAttribute0040 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(TextOverflow.MARQUEE) + .width('100%') + .id('UIComponentTextAttribute0040') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..107b486cba61090c34f7cb5aab6a067c34515670 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0050.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 UIComponentTextAttribute0050 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(undefined) + .width('100%') + .id('UIComponentTextAttribute0050') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..0db88cdcc15906e1ba29c67627795aa0879c8100 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0060.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 UIComponentTextAttribute0060 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(null) + .width('100%') + .id('UIComponentTextAttribute0060') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..9336460e530d106eb6b7b20f5736951085b99bf5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0080.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 UIComponentTextAttribute0080 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(this.overFlow) + .width('100%') + .id('UIComponentTextAttribute0080') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d5fff0b71c8d403a3bea5377140661810bb5c94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0090.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 UIComponentTextAttribute0090 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Default) + .maxLines(2) + .textOverflow(this.overFlow) + .width('100%') + .id('UIComponentTextAttribute0090') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f16d39ef615e3cff349cea8bfa5e61111d7831b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0100.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 UIComponentTextAttribute0100 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .wordBreak(WordBreak.NORMAL) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0100') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..16c0e07ecce9d57c13bddc84a1d0877d7204abb6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0110.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 UIComponentTextAttribute0110 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Default) + .maxLines(2) + .wordBreak(WordBreak.BREAK_ALL) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0110') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a3058e0d791049260f6dad1990a074aa9eccf6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0120.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 UIComponentTextAttribute0120 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .wordBreak(WordBreak.BREAK_WORD) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0120') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..a5dab20782b9dfe079bc9e8f4d6732f803127909 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0130.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextAttribute0130 { + @State overFlow : TextOverflow = TextOverflow.None; + @State type : InputType = InputType.Normal; + build() { + Column() { + Button('tp1') + .id('tp1') + .width(100) + .height(60) + .onClick(()=>{ + this.type = InputType.Number; + }) + Button('tp2') + .id('tp2') + .width(100) + .height(60) + .onClick(()=>{ + this.type = InputType.NUMBER_DECIMAL; + }) + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .type(this.type) + .maxLines(2) + .wordBreak(WordBreak.BREAK_WORD) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0130') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..c9ecd1889aaeb7ef1bd6312ae0361edbbba2ef85 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0140.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 UIComponentTextAttribute0140 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0140') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..c12dd303d2a2d6414d30be6e4b603d8f00df0230 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0150.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 UIComponentTextAttribute0150 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .style(TextInputStyle.Inline) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0150') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..c21c328b958f0d0648ecc5edfacfa5a9d28b20c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0160.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 UIComponentTextAttribute0160 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.koauauotamateaturipukakapikimaungahoronukupo' + }) + .style(TextInputStyle.Inline) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0160') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3ad0254d5daed4a779ed75e06936bfcc02153eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0170.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 UIComponentTextAttribute0170 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({ + placeholder: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0170') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9c30b6a70af9be34a92ddb64c915d706a3c673e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0180.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 UIComponentTextAttribute0180 { + @State textIndent : Dimension = 0.1; + + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15vp'; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '50%'; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .textIndent(this.textIndent) + .id('UIComponentTextAttribute0180') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb0decffa089dbf0861f79429358e3120b93d9f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0190.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 UIComponentTextAttribute0190 { + @State textIndent : Dimension = 0.1; + + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15vp'; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '50%'; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .textIndent(this.textIndent) + .style(TextInputStyle.Inline) + .id('UIComponentTextAttribute0190') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ad11b0ac1e334ddc268561e910ccb318c8c2700 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0200.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 UIComponentTextAttribute0200 { + @State textIndent: Dimension = 0.1; + @State type: InputType = InputType.Normal; + + build() { + Column() { + Row() { + Button('tp1') + .id('tp1') + .width(100) + .height(60) + .onClick(() => { + this.type = InputType.Number; + }) + Button('tp2') + .id('tp2') + .width(100) + .height(60) + .onClick(() => { + this.type = InputType.NUMBER_DECIMAL; + }) + }.width('100%') + + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15vp'; + }) + }.width('100%') + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '50%'; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .type(this.type) + .textIndent(this.textIndent) + .style(TextInputStyle.Inline) + .id('UIComponentTextAttribute0200') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..ddcf3b724a521bbdef04b328dcda4d46a8a7ab5c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0210.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 UIComponentTextAttribute0210 { + @State textIndent: Dimension = 0.1; + @State type: InputType = InputType.Normal; + + build() { + Column() { + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15vp'; + }) + }.width('100%') + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '50%'; + }) + TextInput({ + placeholder: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .type(this.type) + .textIndent(this.textIndent) + .style(TextInputStyle.Inline) + .id('UIComponentTextAttribute0210') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..dab278d90c4092e7f660e25e31cec375237d8c15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0220.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 UIComponentTextAttribute0220 { + @State textIndent: Dimension = 0.1; + @State type: InputType = InputType.Normal; + + build() { + Column() { + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15vp'; + }) + }.width('100%') + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '50%'; + }) + TextInput({ + text: '' + }) + .type(this.type) + .padding({ top: 0, left: 5, bottom: 10}) + .textIndent(this.textIndent) + .style(TextInputStyle.Inline) + .id('UIComponentTextAttribute0220') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..17dac1ae3287cc4bb1e5819d1683f3ae8808f17d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0230.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextAttribute0230 { + @State overFlow : TextOverflow = TextOverflow.None; + @State textWidth : number = 200; + build() { + Column() { + Row(){ + Button('addWidth') + .id('addWidth') + .width(100) + .height(60) + .onClick(()=>{ + this.textWidth = 300; + }) + Button('changeWidth') + .id('changeWidth') + .width(100) + .height(60) + .onClick(()=>{ + this.textWidth = 100; + }) + } + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoau.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .width(this.textWidth) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0230') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6ec177451e169ba7b379c18befd08a855707197 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0240.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextAttribute0240 { + @State overFlow : TextOverflow = TextOverflow.None; + @State letter : number = 10; + build() { + Column() { + Row(){ + Button('addWidth') + .id('addWidth') + .width(100) + .height(60) + .onClick(()=>{ + this.letter = 20; + }) + Button('changeWidth') + .id('changeWidth') + .width(100) + .height(60) + .onClick(()=>{ + this.letter = 5; + }) + } + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text Taumatawhakatangihangakoau.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .letterSpacing(this.letter) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0240') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1a21342c98cdc3e85798438059ec80b0cfbfb8b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0250.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 UIComponentTextAttribute0250 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text Taumatawhakatangihangakoau.' + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .clip(false) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0250') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..31643902cc3e122b939a9f4f29973cca46cd06ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0260.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 UIComponentTextAttribute0260 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .style(TextInputStyle.Inline) + .maxLines(2) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0260') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..2fa167c1a2e1bd873f5d76cf68ba49f56f893074 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0270.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 UIComponentTextAttribute0270 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .style(TextInputStyle.Inline) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0270') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..99e4f54a1c2fd17ecce9732cb18e152952554788 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0280.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 UIComponentTextAttribute0280 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .style(TextInputStyle.Inline) + .textOverflow(this.overFlow) + .maxLines(2) + .id('UIComponentTextAttribute0280') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..84e2c35c5aaff9f717695a542254e89085aff72b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0290.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 UIComponentTextAttribute0290 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThiset wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThi is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .style(TextInputStyle.Inline) + .textOverflow(this.overFlow) + .id('UIComponentTextAttribute0290') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..3d7c6c19f45138516e452e88d3ed570c0934e397 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0300.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 UIComponentTextAttribute0300 { + @State overFlow : TextOverflow = TextOverflow.None; + controller: TextInputController = new TextInputController() + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + this.controller.stopEditing(); + }) + TextInput({controller: this.controller, + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThiset wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThi is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .style(TextInputStyle.Inline) + .textOverflow(this.overFlow) + .maxLines(2) + .id('UIComponentTextAttribute0300') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..c9cc454df462c4247ad0431db6d5d27ac7e4426d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0310.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 UIComponentTextAttribute0310 { + @State overFlow : TextOverflow = TextOverflow.None; + controller: TextInputController = new TextInputController() + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextInput({controller: this.controller, + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThiset wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThi is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .style(TextInputStyle.Inline) + .textOverflow(this.overFlow) + .maxLines(2) + .wordBreak(WordBreak.NORMAL) + .id('UIComponentTextAttribute0310') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..cf94e8db7e862d4d5716dc8b774011fb3408a3be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0320.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 UIComponentTextAttribute0320 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextArea({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThiset wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThi is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .textOverflow(this.overFlow) + .maxLines(2) + .style(TextContentStyle.INLINE) + .wordBreak(WordBreak.BREAK_ALL) + .id('UIComponentTextAttribute0320') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..064a7232dc37b3204c18e6c02b280d1c8c9e5f0c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0330.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 UIComponentTextAttribute0330 { + @State overFlow : TextOverflow = TextOverflow.None; + build() { + Column() { + Row(){ + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.MARQUEE; + }) + } + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.overFlow = TextOverflow.Ellipsis; + }) + TextArea({ + text: 'This is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThiset wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThi is set wordBreak to WordBreak text Taumatawhakatangihangakoau.'+'\n'+'我爱你中国' + + }) + .textOverflow(this.overFlow) + .maxLines(2) + .style(TextContentStyle.INLINE) + .wordBreak(WordBreak.BREAK_WORD) + .id('UIComponentTextAttribute0330') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ede68687bf6ffecf83833b2169d98fb3ce1bae7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0340.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextAttribute0340 { + @State overFlow: TextOverflow = TextOverflow.None; + @State type: InputType = InputType.Email; + + build() { + Column() { + Row() { + Button('tp1') + .id('tp1') + .width(100) + .height(60) + .onClick(() => { + this.type = InputType.Number; + }) + Button('tp2') + .id('tp2') + .width(100) + .height(60) + .onClick(() => { + this.type = InputType.NUMBER_DECIMAL; + }) + } + + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.MARQUEE; + }) + } + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.Ellipsis; + }) + TextArea({ + text: '18091823333This is set wordBreak to18091823333@163.com WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThiset wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThi is set wordBreak to WordBreak text Taumatawhakatangihangakoau.' + + '\n' + '我爱你中国' + + }) + .textOverflow(this.overFlow) + .style(TextContentStyle.INLINE) + .maxLines(2) + .id('UIComponentTextAttribute0340') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9c46a8f7a54157a9b51341a52ffd869e9edd124 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0350.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 UIComponentTextAttribute0350 { + @State overFlow: TextOverflow = TextOverflow.None; + + build() { + Column() { + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.Clip; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.None; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.MARQUEE; + }) + } + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.overFlow = TextOverflow.Ellipsis; + }) + TextArea({ + placeholder: '18091823333This issetwordBreakto18091823333@163.comWordBreaktextTaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauThiset wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThiet wordBreak to WordBreak text TaumatawhakatangihangakoauThi is set wordBreak to WordBreak text Taumatawhakatangihangakoau.' + }) + .textOverflow(this.overFlow) + .style(TextContentStyle.INLINE) + .maxLines(2) + .id('UIComponentTextAttribute0350') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..7bad3c2baf392d7c936eddb00e16166cbf59121e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0360.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 UIComponentTextAttribute0360 { + @State textIndent : Dimension = 0.1; + + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15vp'; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '50%'; + }) + TextArea({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .textIndent(this.textIndent) + .id('UIComponentTextAttribute0360') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..d6997e9fb5b840197e5bc2a0e8efd4105525a9a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0370.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextAttribute0370 { + @State textIndent: Dimension = 0.1; + @State type: InputType = InputType.Normal; + + build() { + Column() { + Row() { + Button('tp1') + .id('tp1') + .width(100) + .height(60) + .onClick(() => { + this.type = InputType.Number; + }) + Button('tp2') + .id('tp2') + .width(100) + .height(60) + .onClick(() => { + this.type = InputType.NUMBER_DECIMAL; + }) + }.width('100%') + + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15vp'; + }) + }.width('100%') + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '50%'; + }) + TextInput({ + text: 'This18091823333 is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .type(this.type) + .textIndent(this.textIndent) + .id('UIComponentTextAttribute0370') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..3bdb23c3fa1686728cb865c6d0ce2459f5ffef23 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0380.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 UIComponentTextAttribute0380 { + @State textIndent : Dimension = 0.1; + + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15vp'; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '50%'; + }) + TextArea({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.akoauauotamateaturipukakapikimaungahoronukupokaiwhenuaki' + }) + .style(TextContentStyle.INLINE) + .textIndent(this.textIndent) + .id('UIComponentTextAttribute0380') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..a3d42b750ccbf0ce3180b9bb2d3ab9bf3a701980 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0390.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 UIComponentTextAttribute0390 { + @State textIndent : Dimension = 0.1; + + build() { + Column() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15vp'; + }) + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(()=>{ + this.textIndent = '50%'; + }) + TextArea({ + placeholder: 'ThisissetwordBreaktoWordBreaktextTaumatawhakatangiha' + }) + .textIndent(this.textIndent) + .id('UIComponentTextAttribute0390') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1286156b09e008627e5b4066ea145bc2bd4eff6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0400.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. + */ + +@Entry +@Component +struct UIComponentTextAttribute0400 { + @State textIndent: Dimension = 0.1; + + build() { + Column() { + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = -10; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = 10; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15vp'; + }) + }.width('100%') + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '15px'; + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(() => { + this.textIndent = '50%'; + }) + TextArea({ + text: '' + }) + .padding({ top: 0, left: 5, bottom: 10}) + .textIndent(this.textIndent) + .id('UIComponentTextAttribute0400') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..25d663a0a4ac88c0d3cb808a48a08cc6313ab4c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0410.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextAttribute0410 { + @State seColor: Color | string = Color.Green; + + build() { + Column() { + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.seColor = '0xfff00'; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.seColor = '#FFb6c1'; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.seColor = -12; + }) + }.width('100%') + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.seColor = getContext().resourceManager.getColorSync($r('app.color.colorRed')); + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(() => { + this.seColor = 'null'; + }) + TextArea({ + text: 'abcde' + }) + .selectedBackgroundColor(this.seColor) + .id('UIComponentTextAttribute0410') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f3d83037de1a083524959a578ae6c0afe9f8a50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0420.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 UIComponentTextAttribute0420 { + controller: TextAreaController = new TextAreaController() + build() { + Column() { + Button('select') + .id('select') + .width(100) + .height(60) + .onClick(()=>{ + this.controller.setTextSelection(0,5); + }) + TextArea({controller: this.controller, + text: 'abcde' + }) + .selectedBackgroundColor(Color.Green) + .id('UIComponentTextAttribute0420') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..f9d7716a55927ba4fc5a27be84ff3b9bcaf92341 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0430.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 UIComponentTextAttribute0430 { + + build() { + Column() { + TextArea({ + text: 'abcde' + }) + .selectedBackgroundColor(Color.Green) + .caretColor(Color.Red) + .id('UIComponentTextAttribute0430') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c4879c1b2797387d1c120545e19f6179f6c1d49 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0440.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 UIComponentTextAttribute0440 { + + build() { + Column() { + TextArea({ + text: 'abcde' + }) + .selectedBackgroundColor(Color.Green) + .caretColor(Color.Red) + .type(TextAreaType.NORMAL) + .id('UIComponentTextAttribute0440_01') + TextArea({ + text: '123456,18091823333' + }) + .selectedBackgroundColor(Color.Green) + .caretColor(Color.Red) + .type(TextAreaType.NUMBER | TextAreaType.PHONE_NUMBER) + .id('UIComponentTextAttribute0440_02') + TextArea({ + text: '18091823333@163.com' + }) + .selectedBackgroundColor(Color.Green) + .caretColor(Color.Red) + .type(TextAreaType.EMAIL) + .id('UIComponentTextAttribute0440_03') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7bb8d84e661c2f40d468bdb87807386b188333b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0450.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 UIComponentTextAttribute0450 { + @State style: TextContentStyle = TextContentStyle.DEFAULT; + + build() { + Column() { + Button('change') + .id('change') + .width(100) + .height(60) + .onClick(()=>{ + this.style = TextContentStyle.INLINE; + }) + TextArea({ + text: 'abcde' + }) + .selectedBackgroundColor(Color.Green) + .caretColor(Color.Red) + .style(this.style) + .id('UIComponentTextAttribute0450') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..32c26c066d730a8e6c05970c3e13dcd6f12b370c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0460.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 UIComponentTextAttribute0460 { + @State style: TextContentStyle = TextContentStyle.DEFAULT; + @State caretStyle: string | number = '10vp'; + + build() { + Column() { + Button('change') + .id('change') + .width(100) + .height(60) + .onClick(() => { + if (this.caretStyle = '10vp') { + this.caretStyle = '50px' + } else { + this.caretStyle = 16 + } + }) + TextArea({ + text: 'abcde' + }) + .caretStyle({ + width: this.caretStyle + }) + .id('UIComponentTextAttribute0460') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..c50f543d923dfcdaf28c339b2effb343bcd55d5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0470.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 UIComponentTextAttribute0470 { + build() { + Column() { + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(0.1) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(-10) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(10) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('15vp') + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('15px') + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0480.ets new file mode 100644 index 0000000000000000000000000000000000000000..82670c3f2ce671b79180a8231d5a2629716c7553 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0480.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 UIComponentTextAttribute0480 { + build() { + Column() { + Search({ + placeholder: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(0.1) + Search({ + placeholder: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(-10) + Search({ + placeholder: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(10) + Search({ + placeholder: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('15vp') + Search({ + placeholder: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('15px') + Search({ + placeholder: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0490.ets new file mode 100644 index 0000000000000000000000000000000000000000..cce99822df014ea02cb8ef7822beda9818ccba5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0490.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 UIComponentTextAttribute0490 { + build() { + Column() { + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(0.1) + .padding({top:0,left:5,right:10}) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(-10) + .padding({top:0,left:5,right:10}) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent(10) + .padding({top:0,left:5,right:10}) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('15vp') + .padding({top:0,left:5,right:10}) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('15px') + .padding({top:0,left:5,right:10}) + Search({ + value: 'abcdeThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text TaumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuThis is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu' + }) + .textIndent('50%') + .padding({top:0,left:5,right:10}) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..c09d1fcbe2ae357e9c48f3713e08d6421ec6703a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0500.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextAttribute0500 { + @State seColor: Color | string = Color.Green; + + build() { + Column() { + Row() { + Button('ch1') + .id('ch1') + .width(100) + .height(60) + .onClick(() => { + this.seColor = '0xfff00'; + }) + Button('ch2') + .id('ch2') + .width(100) + .height(60) + .onClick(() => { + this.seColor = '#FFb6c1'; + }) + Button('ch3') + .id('ch3') + .width(100) + .height(60) + .onClick(() => { + this.seColor = -12; + }) + }.width('100%') + + Button('ch4') + .id('ch4') + .width(100) + .height(60) + .onClick(() => { + this.seColor = getContext().resourceManager.getColorSync($r('app.color.colorRed')); + }) + Button('ch5') + .id('ch5') + .width(100) + .height(60) + .onClick(() => { + this.seColor = 'null'; + }) + Search({ + value: 'abcde' + }) + .selectedBackgroundColor(this.seColor) + .id('UIComponentTextAttribute0500') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..3183ece939cbbaa236b2388da16bbea7d246ece6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0510.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 UIComponentTextAttribute0510 { + controller: TextAreaController = new TextAreaController() + build() { + Column() { + Button('select') + .id('select') + .width(100) + .height(60) + .onClick(()=>{ + this.controller.setTextSelection(0,5); + }) + Search({controller: this.controller, + value: 'abcde' + }) + .selectedBackgroundColor(Color.Green) + .id('UIComponentTextAttribute0510') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..c6300b5de7439bcf48fec8865f7f25f5192b22f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0520.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 UIComponentTextAttribute0520 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Search({ + controller: this.controller, + value: 'abcde' + }) + .selectedBackgroundColor(Color.Green) + .id('UIComponentTextAttribute0520') + .caretStyle({ + color: Color.Red + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..a5aac7f91655148aaa4059ecb25bb1d4711d5ab2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0530.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 UIComponentTextAttribute0530 { + + build() { + Column() { + Search({ + value: 'abcde' + }) + .selectedBackgroundColor(Color.Green) + .caretStyle({ + color: Color.Red + }) + .type(SearchType.NORMAL) + .id('UIComponentTextAttribute0530_01') + Search({ + value: '123456,18091823333' + }) + .selectedBackgroundColor(Color.Green) + .caretStyle({ + color: Color.Red + }) + .type(SearchType.NUMBER | SearchType.PHONE_NUMBER) + .id('UIComponentTextAttribute0530_02') + Search({ + value: '18091823333@163.com' + }) + .selectedBackgroundColor(Color.Green) + .caretStyle({ + color: Color.Red + }) + .type(SearchType.EMAIL) + .id('UIComponentTextAttribute0530_03') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..14bd054e872301b752e92a79508b1c57887861aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0540.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 UIComponentTextAttribute0540 { + + build() { + Column() { + Search({ + value: 'abcde123中国' + }) + .id('UIComponentTextAttribute0540') + Search({ + value: 'axc' + }) + .id('UIComponentTextAttribute0540_01') + .inputFilter('[a-z]', (val) => { + console.error('TextArea example : ' + val); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0550.ets new file mode 100644 index 0000000000000000000000000000000000000000..50b57c3388d32e3080c34532c4d3fe6d1ef22bf0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0550.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 UIComponentTextAttribute0550 { + + build() { + Column() { + Search({ + value: 'abcde456中国' + }) + .id('UIComponentTextAttribute0550') + Search({ + value: '123' + }) + .id('UIComponentTextAttribute0550_01') + .inputFilter('[0-9]', (val) => { + console.error('TextArea example : ' + val); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..74c6f805e7294a46d8c1d828fea2468a03dbb2ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0560.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 UIComponentTextAttribute0560 { + build() { + Column() { + Search() + .selectedBackgroundColor(Color.Green) + .id('UIComponentTextAttribute0560') + .inputFilter(null, (error) => { + console.log(JSON.stringify(error)) + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0570.ets new file mode 100644 index 0000000000000000000000000000000000000000..088f77bf3d3f6f0eff2d2f78615ba5fbbdced946 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0570.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 UIComponentTextAttribute0570 { + @State type: SearchType = SearchType.NORMAL; + + build() { + Column() { + Button('change1') + .id('change1') + .width(100) + .height(60) + .onClick(() => { + this.type = SearchType.EMAIL; + }) + Button('change2') + .id('change2') + .width(100) + .height(60) + .onClick(() => { + this.type = SearchType.NUMBER; + }) + Button('change3') + .id('change3') + .width(100) + .height(60) + .onClick(() => { + this.type = SearchType.PHONE_NUMBER; + }) + Search({ + value: '18710810407,10.32' + }) + .id('UIComponentTextAttribute0570') + Search({ + value: '123.12' + }) + .id('UIComponentTextAttribute0570_01') + .type(this.type) + .inputFilter('[0,9]', (val) => { + console.error('TextArea example : ' + val); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0600.ets new file mode 100644 index 0000000000000000000000000000000000000000..69fa4a7bdd2cc8745a1cbd367567df5da271d9dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0600.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 UIComponentTextAttribute0600 { + @State text: string = ''; + + build() { + Column() { + Search() + .id('SearchUIComponentTextAttribute0600') + .width('100%') + .onEditChange((info) => { + this.text = JSON.stringify(info) + }) + Text(this.text) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0640.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c090144c80f7d6761f69575134f76876151fe39 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0640.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 UIComponentTextAttribute0640 { + @State text: string = ''; + + build() { + Column() { + Search() + .id('SearchUIComponentTextAttribute0640') + .width('100%') + .onEditChange((info) => { + this.text = JSON.stringify(info) + }) + Text(this.text) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..81a2717c7b027cbc89e31ec5f9188a057f7bbad2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0220.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 UIComponentTextAttributeStringConstructs0220 { + @State errorMessage: string = ''; + controller: TextController = new TextController(); + StyledString: StyledString = new StyledString("这是一段测试文字", [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]) + + async onPageShow() { + this.controller.setStyledString(this.StyledString) + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) + .id('TextUIComponentTextAttributeStringConstructs0220') + .copyOption(CopyOptions.InApp) + .draggable(true) + Button('getStyles') + .id('btnUIComponentTextAttributeStringConstructs0220') + .onClick(() => { + try { + let styles = this.StyledString.getStyles(4, 6, StyledStringKey.FONT); + if (styles.length == 2) { + for (let i = 0; i < styles.length; i++) { + console.info('StyledString style object start:' + styles[i].start) + console.info('StyledString style object length:' + styles[i].length) + console.info('StyledString style object key:' + styles[i].styledKey) + } + } + } catch (e) { + this.errorMessage = JSON.stringify(e); + } + }) + Text(this.errorMessage) + .fontSize(30) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b22dde8ae71b1c8325b0eba3c19711bb333bedc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0320.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 UIComponentTextAttributeStringConstructs0320 { + @State errorMessage: string = ''; + controller: TextController = new TextController(); + StyledString: StyledString = new StyledString("这是一段测试文字", [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]) + + async onPageShow() { + this.controller.setStyledString(this.StyledString) + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) + .id('TextUIComponentTextAttributeStringConstructs0320') + .copyOption(CopyOptions.InApp) + .draggable(true) + Button('getStyles') + .id('btnUIComponentTextAttributeStringConstructs0320') + .onClick(() => { + try { + let styles = this.StyledString.subStyledString(-1, 3); + if (styles.length == 2) { + for (let i = 0; i < styles.length; i++) { + console.info('StyledString style object start:' + styles[i].start) + console.info('StyledString style object length:' + styles[i].length) + console.info('StyledString style object key:' + styles[i].styledKey) + } + } + } catch (e) { + this.errorMessage = JSON.stringify(e); + } + }) + Text(this.errorMessage) + .fontSize(30) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3ebf37736f48b9d0d36b9ea9de4eb6aa8b9181b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0330.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 UIComponentTextAttributeStringConstructs0330 { + @State errorMessage: string = ''; + controller: TextController = new TextController(); + StyledString: StyledString = new StyledString("这是一段测试文字", [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]) + + async onPageShow() { + this.controller.setStyledString(this.StyledString) + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) + .id('TextUIComponentTextAttributeStringConstructs0330') + .copyOption(CopyOptions.InApp) + .draggable(true) + Button('getStyles') + .id('btnUIComponentTextAttributeStringConstructs0330') + .onClick(() => { + try { + let styles = this.StyledString.subStyledString(20, 3); + if (styles.length == 2) { + for (let i = 0; i < styles.length; i++) { + console.info('StyledString style object start:' + styles[i].start) + console.info('StyledString style object length:' + styles[i].length) + console.info('StyledString style object key:' + styles[i].styledKey) + } + } + } catch (e) { + this.errorMessage = JSON.stringify(e); + } + }) + Text(this.errorMessage) + .fontSize(30) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..b26ca5b9de52031dc1b5abbeea96f8736e8a2d54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0340.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 UIComponentTextAttributeStringConstructs0340 { + @State errorMessage: string = ''; + controller: TextController = new TextController(); + StyledString: StyledString = new StyledString("这是一段测试文字", [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]) + + async onPageShow() { + this.controller.setStyledString(this.StyledString) + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) + .id('TextUIComponentTextAttributeStringConstructs0340') + .copyOption(CopyOptions.InApp) + .draggable(true) + Button('getStyles') + .id('btnUIComponentTextAttributeStringConstructs0340') + .onClick(() => { + try { + let styles = this.StyledString.subStyledString(0, -3); + if (styles.length == 2) { + for (let i = 0; i < styles.length; i++) { + console.info('StyledString style object start:' + styles[i].start) + console.info('StyledString style object length:' + styles[i].length) + console.info('StyledString style object key:' + styles[i].styledKey) + } + } + } catch (e) { + this.errorMessage = JSON.stringify(e); + } + }) + Text(this.errorMessage) + .fontSize(30) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..653659e0f97ce783c4d7f029719585f29aa6188b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0350.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 UIComponentTextAttributeStringConstructs0350 { + @State errorMessage: string = ''; + controller: TextController = new TextController(); + StyledString: StyledString = new StyledString("这是一段测试文字", [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]) + + async onPageShow() { + this.controller.setStyledString(this.StyledString) + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) + .id('TextUIComponentTextAttributeStringConstructs0350') + .copyOption(CopyOptions.InApp) + .draggable(true) + Button('getStyles') + .id('btnUIComponentTextAttributeStringConstructs0350') + .onClick(() => { + try { + let styles = this.StyledString.subStyledString(0, 10); + if (styles.length == 2) { + for (let i = 0; i < styles.length; i++) { + console.info('StyledString style object start:' + styles[i].start) + console.info('StyledString style object length:' + styles[i].length) + console.info('StyledString style object key:' + styles[i].styledKey) + } + } + } catch (e) { + this.errorMessage = JSON.stringify(e); + } + }) + Text(this.errorMessage) + .fontSize(30) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..5fbf56edc17fb5371d1edfb112f30fadf09c0452 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0360.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 UIComponentTextAttributeStringConstructs0360 { + @State errorMessage: string = ''; + controller: TextController = new TextController(); + StyledString: StyledString = new StyledString("这是一段测试文字", [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]) + + async onPageShow() { + this.controller.setStyledString(this.StyledString) + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) + .id('TextUIComponentTextAttributeStringConstructs0360') + .copyOption(CopyOptions.InApp) + .draggable(true) + Button('getStyles') + .id('btnUIComponentTextAttributeStringConstructs0360') + .onClick(() => { + try { + let styles = this.StyledString.subStyledString(6, 4); + if (styles.length == 2) { + for (let i = 0; i < styles.length; i++) { + console.info('StyledString style object start:' + styles[i].start) + console.info('StyledString style object length:' + styles[i].length) + console.info('StyledString style object key:' + styles[i].styledKey) + } + } + } catch (e) { + this.errorMessage = JSON.stringify(e); + } + }) + Text(this.errorMessage) + .fontSize(30) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f72d762093ef73ef253795b55bbcd92e0f19968 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0460.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 UIComponentTextAttributeStringConstructs0460 { + controller: TextController = new TextController(); + StyledString: StyledString = new StyledString("这是一段测试文字", [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]) + + async onPageShow() { + this.controller.setStyledString(this.StyledString) + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) + .id('TextUIComponentTextAttributeStringConstructs0460') + .copyOption(CopyOptions.InApp) + .draggable(true) + TextArea() + .id('TextAreaUIComponentTextAttributeStringConstructs0460') + .copyOption(CopyOptions.InApp) + .draggable(true) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b05bef61dabe7dfc0bcbef4f1b724a7e5cd021a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0010.ets @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0010 { + @State widthSize: string = ''; + @State heightSize: string = ''; + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then() + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0010') + .copyOption(CopyOptions.InApp) + .draggable(true) + .width(this.widthSize) + .height(this.heightSize) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0010') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .width(this.widthSize) + .height(this.heightSize) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0010') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .width(this.widthSize) + .height(this.heightSize) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0010') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .width(this.widthSize) + .height(this.heightSize) + Button('设置组件宽高') + .id('btnUIComponentTextCommonCopyOptionDraggable0010') + .onClick(() => { + this.widthSize = '60%'; + this.heightSize = '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/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..57cc09672cd0cf7152f07d58cf21aec2430318b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0020.ets @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0020 { + @State widthSize: string = ''; + @State heightSize: string = ''; + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0020') + .copyOption(CopyOptions.InApp) + .draggable(true) + .width(this.widthSize) + .height(this.heightSize) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0020') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .width(this.widthSize) + .height(this.heightSize) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0020') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .width(this.widthSize) + .height(this.heightSize) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0020') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .width(this.widthSize) + .height(this.heightSize) + Button('设置组件宽高') + .id('btnUIComponentTextCommonCopyOptionDraggable0020') + .onClick(() => { + this.widthSize = '60%'; + this.heightSize = '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/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..b98027876d8dee42b0ba3d0688dac6d24f4f7614 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0030.ets @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0030 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0030') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0030') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0030') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0030') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b806222c95e800cf334529ae1683b8e8105916a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0040.ets @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0040 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0040') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0040') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0040') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0040') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..5341fcb6a9f0f87f83180ca3203ce9045780d6be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0050.ets @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = 'drawing'; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0050 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan('Hello', 200, 100); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString('aaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0050') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0050') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0050') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0050') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b07f54bfe67e3be5ecadf3a37ba2f09ed29a680 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0060.ets @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0060 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0060') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0060') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0060') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0060') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..b13edf2060d90c21d3d5f1fa24351196a8c9d7ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0070.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. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0070 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + @State textInputType: number | undefined = undefined; + @State searchType: number | undefined = undefined; + @State textAreaType: number | undefined = undefined; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0070') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0070') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0070') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(this.textAreaType) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0070') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(this.textInputType) + Button('change type') + .id('btnUIComponentTextCommonCopyOptionDraggable0070') + .onClick(() => { + this.textInputType = InputType.NUMBER_PASSWORD; + this.searchType = SearchType.NUMBER; + this.textAreaType = TextAreaType.URL; + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..5caf8d106bb8491d8a0639a1f1e7475e61227973 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0080.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. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0080 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + @State textInputType: number | undefined = undefined; + @State searchType: number | undefined = undefined; + @State textAreaType: number | undefined = undefined; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0080') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0080') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0080') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(this.textAreaType) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0080') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(this.textInputType) + Button('change type') + .id('btnUIComponentTextCommonCopyOptionDraggable0080') + .onClick(() => { + this.textInputType = InputType.NUMBER_PASSWORD; + this.searchType = SearchType.NUMBER; + this.textAreaType = TextAreaType.URL; + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..a656691a4783c50dcd6fa04905c246a00e08b444 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0090.ets @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0090 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0090') + .copyOption(CopyOptions.InApp) + .draggable(true) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0090') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .style(TextContentStyle.INLINE) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0090') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .style(TextInputStyle.Inline) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ee38259b378f371ddfc0dd5acc4817422c63e1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0100.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 { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0100 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0100') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0100') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0100') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0100') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..74438b9acde3790550551c43ced86ccc00e4051e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0110.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 { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0110 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0110') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0110') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0110') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0110') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..686d9c0ab49e00f9769af564a436606d8fd1dd05 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0120.ets @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0120 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + @State onChangeNum: number = 0; + @State onPasteNum: number = 0; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(`onchange触发次数:${this.onChangeNum},onPaste触发次数:${this.onPasteNum}`) + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0120') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0120') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + .onChange(() => { + this.onChangeNum += 1; + }) + .onPaste(() => { + this.onPasteNum += 1; + }) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0120') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + .onChange(() => { + this.onChangeNum += 1; + }) + .onPaste(() => { + this.onPasteNum += 1; + }) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0120') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + .onChange(() => { + this.onChangeNum += 1; + }) + .onPaste(() => { + this.onPasteNum += 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/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..b87d9eafb1c2728870753defbc05b7370a5e9fed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0130.ets @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0130 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + @State onChangeNum: number = 0; + @State onPasteNum: number = 0; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(`onchange触发次数:${this.onChangeNum},onPaste触发次数:${this.onPasteNum}`) + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0130') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0130') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + .onChange(() => { + this.onChangeNum += 1; + }) + .onPaste(() => { + this.onPasteNum += 1; + }) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0130') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + .onChange(() => { + this.onChangeNum += 1; + }) + .onPaste(() => { + this.onPasteNum += 1; + }) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0130') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + .onChange(() => { + this.onChangeNum += 1; + }) + .onPaste(() => { + this.onPasteNum += 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/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..184ea8cb27e459d990062b829cd71c9a672dd3cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0140.ets @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0140 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0140') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search({ + placeholder: '请输入文本内容' + }) + .id('SearchUIComponentTextCommonCopyOptionDraggable0140') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + TextArea({ + placeholder: '请输入文本内容' + }) + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0140') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + TextInput({ + placeholder: '请输入文本内容' + }) + .id('TextInputUIComponentTextCommonCopyOptionDraggable0140') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ed3da08340229f01cb2b5371282db4729e54682 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0150.ets @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0150 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0150') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search({ + placeholder: '请输入文本内容' + }) + .id('SearchUIComponentTextCommonCopyOptionDraggable0150') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + TextArea({ + placeholder: '请输入文本内容' + }) + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0150') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + TextInput({ + placeholder: '请输入文本内容' + }) + .id('TextInputUIComponentTextCommonCopyOptionDraggable0150') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..0302e6b3c8aa755abb78a86b2d856c62bc54041b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0160.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 { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0160 { + textController: TextController = new TextController(); + textAreaController: TextAreaController = new TextAreaController(); + inputController: TextInputController = new TextInputController(); + searController: SearchController = new SearchController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0160') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search({ + controller: this.searController + }) + .id('SearchUIComponentTextCommonCopyOptionDraggable0160') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + TextArea({ + controller: this.textAreaController + }) + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0160') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + TextInput({ + controller: this.inputController + }) + .id('TextInputUIComponentTextCommonCopyOptionDraggable0160') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + Button('选中文本') + .id('btnUIComponentTextCommonCopyOptionDraggable0160') + .onClick(() => { + this.inputController.setTextSelection(0, 5); + this.searController.setTextSelection(0, 5); + this.textAreaController.setTextSelection(0, 5); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c470ed502334b65755e78e8a2128dc010ad7881 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0170.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 { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; + +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = "drawing"; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0170 { + textController: TextController = new TextController(); + textAreaController: TextAreaController = new TextAreaController(); + inputController: TextInputController = new TextInputController(); + searController: SearchController = new SearchController(); + customSpan: MyCustomSpan = new MyCustomSpan("Hello", 80, 10); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString("aaa123", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0170') + .copyOption(CopyOptions.InApp) + .draggable(true) + Search({ + controller: this.searController + }) + .id('SearchUIComponentTextCommonCopyOptionDraggable0170') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(SearchType.NUMBER) + .fontColor(Color.Green) + .textFont({ + size: 30 + }) + TextArea({ + controller: this.textAreaController + }) + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0170') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(TextAreaType.NORMAL) + .fontColor(Color.Red) + TextInput({ + controller: this.inputController + }) + .id('TextInputUIComponentTextCommonCopyOptionDraggable0170') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + .type(InputType.Normal) + .fontColor(Color.Orange) + Button('选中文本') + .id('btnUIComponentTextCommonCopyOptionDraggable0170') + .onClick(() => { + this.inputController.setTextSelection(0, 10); + this.searController.setTextSelection(0, 10); + this.textAreaController.setTextSelection(0, 10); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..7bcc2f5a1baed8806db5d8f426d1626fda510375 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0180.ets @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D' +import { image } from '@kit.ImageKit' +import { LengthMetrics } from '@kit.ArkUI' +import { KeyboardAvoidMode } from '@kit.ArkUI'; +class MyCustomSpan extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 160; + word: string = 'drawing'; + height: number = 10; +} + +@Entry +@Component +struct UIComponentTextCommonCopyOptionDraggable0180 { + textController: TextController = new TextController(); + customSpan: MyCustomSpan = new MyCustomSpan('Hello', 200, 50); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan); + imagePixelMap: image.PixelMap | undefined = undefined; + isPageShow: boolean = true; + + 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, + desiredSize: { width: 50, height: 50 } + }); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + if (!this.isPageShow) { + return + } + this.isPageShow = false; + this.mutableStyledString.appendStyledString(new StyledString(this.customSpan)) + this.mutableStyledString.appendStyledString(new StyledString('aaaaaaaaaaaaaaaaaaaaaaaa0', [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green, fontSize: LengthMetrics.px(50) }) + }])) + this.textController.setStyledString(this.mutableStyledString) + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')).then(); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); + } + + build() { + Column() { + Search() + .id('SearchUIComponentTextCommonCopyOptionDraggable0180') + .copyOption(CopyOptions.InApp) + .draggable(true) + TextArea() + .id('TextAreaUIComponentTextCommonCopyOptionDraggable0180') + .copyOption(CopyOptions.InApp) + .draggable(true) + .margin(10) + TextInput() + .id('TextInputUIComponentTextCommonCopyOptionDraggable0180') + .copyOption(CopyOptions.InApp) + .draggable(true) + Text(undefined, { controller: this.textController }) + .id('TextUIComponentTextCommonCopyOptionDraggable0180') + .copyOption(CopyOptions.InApp) + .draggable(true) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan001.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f78c40852903c9ee48c6a898932423bf5089967 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan001.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. + */ + +class MyCustomSpan extends CustomSpan { + constructor(width: number) { + super(); + this.width = width; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width }; + } + + setWidth(width: number){ + this.width = width; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + } + + width: number = 0; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan001 { + @State customSpan1: MyCustomSpan = new MyCustomSpan(80); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + textController: TextController = new TextController(); + + async onPageShow() { + this.textController.setStyledString(this.style1); + } + + build() { + Row() { + Column() { + Button('改变width') + .id('UIComponentTextCommonCustomDrawingSpan001') + .margin({ bottom: 20 }) + .onClick(() => { + this.customSpan1.setWidth(20); + this.textController.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .border({ width: 1 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan002.ets new file mode 100644 index 0000000000000000000000000000000000000000..ace3d991d6370424b7611a24d8983eda76174929 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan002.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. + */ + +class MyCustomSpan2 extends CustomSpan { + constructor(width: number) { + super(); + this.width = width; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + } + + setWidth(width: number){ + this.width = width; + } + + width: number = 0; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan002 { + customSpan1: MyCustomSpan2 = new MyCustomSpan2(80); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + textController: TextController = new TextController(); + + async onPageShow() { + this.textController.setStyledString(this.style1) + } + + build() { + Row() { + Column() { + Button('改变width为-10') + .id('UIComponentTextCommonCustomDrawingSpan002') + .margin({ bottom: 20 }) + .onClick(() => { + this.customSpan1.setWidth(-10); + this.textController.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .border({ width: 1 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan004.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f8f5b86c40433c283c1f063dd650190de4dce83 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan004.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. + */ + +class MyCustomSpan4 extends CustomSpan { + constructor(width: number, height: number) { + super(); + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + } + + setHeight(height: number){ + this.height = height; + } + + width: number = 0; + height: number = 0; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan004 { + customSpan1: MyCustomSpan4 = new MyCustomSpan4(10, 80); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + textController: TextController = new TextController(); + + async onPageShow() { + this.textController.setStyledString(this.style1) + } + + build() { + Row() { + Column() { + Button('改变height') + .id('UIComponentTextCommonCustomDrawingSpan004') + .margin({ bottom: 20 }) + .onClick(() => { + this.customSpan1.setHeight(20); + this.textController.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .border({ width: 1 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan005.ets new file mode 100644 index 0000000000000000000000000000000000000000..e67e024b6493652efb74f08cd40492e910a99f11 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan005.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. + */ + +class MyCustomSpan5 extends CustomSpan { + constructor(width: number, height: number) { + super(); + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + } + + setHeight(height: number){ + this.height = height; + } + + width: number = 0; + height: number = 0; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan005 { + customSpan1: MyCustomSpan5 = new MyCustomSpan5(10, 80); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + textController: TextController = new TextController(); + + async onPageShow() { + this.textController.setStyledString(this.style1) + } + + build() { + Row() { + Column() { + Button('设置height为-10') + .id('UIComponentTextCommonCustomDrawingSpan005') + .margin({ bottom: 20 }) + .onClick(() => { + this.customSpan1.setHeight(-10); + this.textController.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .border({ width: 1 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan007.ets new file mode 100644 index 0000000000000000000000000000000000000000..b154de464a6f344cf5e9c4b1dc0ee5c3e5622c2a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan007.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan7 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('hello', font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + width: number = 200; + height: number = 200; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan007 { + customSpan1: MyCustomSpan7 = new MyCustomSpan7(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + textController: TextController = new TextController(); + + async onPageShow() { + this.textController.setStyledString(this.style1) + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .border({ width: 1 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan008.ets new file mode 100644 index 0000000000000000000000000000000000000000..ceb593b9f5c648301cf614895fcb4599c367db42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan008.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan8 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('hello', font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + width: number = 200; + height: number = 200; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan008 { + customSpan1: MyCustomSpan8 = new MyCustomSpan8(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + textController: TextController = new TextController(); + + async onPageShow() { + this.textController.setStyledString(this.style1) + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .border({ width: 1 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan009.ets new file mode 100644 index 0000000000000000000000000000000000000000..9be1686df5c885376a97c2a817abd35094930ab3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan009.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. + */ + +class MyCustomSpan9 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + + } + + width: number = 200; + height: number = 200; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan009 { + customSpan1: MyCustomSpan9 = new MyCustomSpan9(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + textController: TextController = new TextController(); + + async onPageShow() { + this.textController.setStyledString(this.style1) + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .fontSize(20) + .border({ width: 1 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan010.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac222835f0ade519127f9e497dddc3c6a0338828 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan010.ets @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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'; + +class MyCustomSpan12 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello World', font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, options.lineBottom); + canvas.detachBrush(); + } + + width: number = 100; + height: number = 100; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan010 { + controller: TextController = new TextController(); + options: TextOptions = { controller: this.controller }; + customSpan1: MyCustomSpan12 = new MyCustomSpan12(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + + async onPageShow() { + this.controller.setStyledString(this.style1) + } + + build() { + Column() { + Column() { + Text(undefined, this.options) { + Span('Hello World') + } + .id('UIComponentTextCommonCustomDrawingSpan010') + .copyOption(CopyOptions.InApp) + .selection(0, 6) + .bindSelectionMenu(3, this.LongClickTextCustomMenu, TextResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width(200) + .height(100) + } + .width('100%') + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Start) + .padding(25) + } + .height('100%') + } + + @Builder + LongClickTextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ content: 'Long Click Menu 1', labelInfo: '' }) + .onClick((event) => { + this.controller.closeSelectionMenu(); + }) + MenuItem({ content: 'Long Click Menu 2', labelInfo: '' }) + MenuItem({ content: 'Long Click Menu 3', labelInfo: '' }) + } + } + .MenuStyles() + } + } +} + +@Extend(Menu) +function MenuStyles() { + .clip(true) + .backgroundColor('#F0F0F0') +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan011.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a83031267ce3c81469b13a3583dd3e3a798d81c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan011.ets @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan12 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello World', font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, options.lineBottom); + canvas.detachBrush(); + } + + width: number = 100; + height: number = 100; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan011 { + controller: TextController = new TextController(); + options: TextOptions = { controller: this.controller }; + customSpan1: MyCustomSpan12 = new MyCustomSpan12(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + + async onPageShow() { + this.controller.setStyledString(this.style1) + } + + build() { + Column() { + Column() { + Text(undefined, this.options) { + Span('Hello World') + } + .id('UIComponentTextCommonCustomDrawingSpan011') + .copyOption(CopyOptions.InApp) + .selection(0, 6) + .borderWidth(1) + .borderColor(Color.Red) + .width(200) + .height(100) + + TextArea() + .id('TextAreaUIComponentTextCommonCustomDrawingSpan011') + .copyOption(CopyOptions.InApp) + .draggable(true) + } + .width('100%') + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Start) + .padding(25) + } + .height('100%') + } + + @Builder + LongClickTextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ content: 'Long Click Menu 1', labelInfo: '' }) + .onClick((event) => { + this.controller.closeSelectionMenu(); + }) + MenuItem({ content: 'Long Click Menu 2', labelInfo: '' }) + MenuItem({ content: 'Long Click Menu 3', labelInfo: '' }) + } + } + .MenuStyles() + } + } +} + +@Extend(Menu) +function MenuStyles() { + .clip(true) + .backgroundColor('#F0F0F0') +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan012.ets new file mode 100644 index 0000000000000000000000000000000000000000..cfd8dc7326927ea88c2939afa1cadebf02b2d37a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan012.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan12 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello World', font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, options.lineBottom); + canvas.detachBrush(); + } + + width: number = 100; + height: number = 100; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan012 { + controller: TextController = new TextController(); + options: TextOptions = { controller: this.controller }; + customSpan1: MyCustomSpan12 = new MyCustomSpan12(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + + async onPageShow() { + this.controller.setStyledString(this.style1) + } + + build() { + Column() { + Column() { + Text(undefined, this.options) { + Span('Hello World') + } + .id('UIComponentTextCommonCustomDrawingSpan012') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(3, this.LongClickTextCustomMenu, TextResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width(200) + .height(100) + } + .width('100%') + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Start) + .padding(25) + } + .height('100%') + } + + @Builder + LongClickTextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ content: "Long Click Menu 1", labelInfo: "" }) + .onClick((event) => { + this.controller.closeSelectionMenu(); + }) + MenuItem({ content: "Long Click Menu 2", labelInfo: "" }) + MenuItem({ content: "Long Click Menu 3", labelInfo: "" }) + } + } + .MenuStyles() + } + } +} + +@Extend(Menu) +function MenuStyles() { + .clip(true) + .backgroundColor('#F0F0F0') +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan013.ets new file mode 100644 index 0000000000000000000000000000000000000000..076c3a5e41bc4374ece0e05a6922527dfa70f900 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan013.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { LengthMetrics } from '@kit.ArkUI'; + +class MyCustomSpan12 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString( + 'Hello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello ', + font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, 120); + canvas.detachBrush(); + } + + width: number = 200; + height: number = 200; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan013 { + controller: TextController = new TextController(); + options: TextOptions = { controller: this.controller }; + customSpan1: MyCustomSpan12 = new MyCustomSpan12(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + + async onPageShow() { + } + + build() { + Column() { + Column() { + Text(undefined, this.options) { + Span('Hello World') + } + .textOverflow({ + overflow: TextOverflow.MARQUEE + }) + .id('UIComponentTextCommonCustomDrawingSpan013') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(3, this.LongClickTextCustomMenu, TextResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width(200) + .height(200) + + Button('MutableStyledString') + .id('UIComponentTextCommonCustomDrawingSpan013_btn1') + .onClick(() => { + this.controller.setStyledString(this.style1); + }) + } + .width('100%') + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Start) + .padding(25) + } + .height('100%') + } + + @Builder + LongClickTextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ content: 'Long Click Menu 1', labelInfo: '' }) + .onClick((event) => { + this.controller.closeSelectionMenu(); + }) + MenuItem({ content: 'Long Click Menu 2', labelInfo: '' }) + MenuItem({ content: 'Long Click Menu 3', labelInfo: '' }) + } + } + .MenuStyles() + } + } +} + +@Extend(Menu) +function MenuStyles() { + .clip(true) + .backgroundColor('#F0F0F0') +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan014.ets new file mode 100644 index 0000000000000000000000000000000000000000..63457a960b5b37e41d858023c4b4f64164e18fda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan014.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { LengthMetrics, LengthUnit } from '@kit.ArkUI'; + +class MyCustomSpan12 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString( + 'Hello World', + font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, 120); + canvas.detachBrush(); + } + + width: number = 200; + height: number = 200; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan014 { + controller: TextController = new TextController(); + options: TextOptions = { controller: this.controller }; + customSpan1: MyCustomSpan12 = new MyCustomSpan12(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + + async onPageShow() { + } + + build() { + Column() { + Column() { + Button('MutableStyledString') + .id('UIComponentTextCommonCustomDrawingSpan014_btn1') + .onClick(() => { + this.controller.setStyledString(this.style1); + }) + + Button('letterSpacing') + .id('UIComponentTextCommonCustomDrawingSpan014_btn2') + .onClick(() => { + this.style1.appendStyledString(new StyledString('Hello World', + [{ + start: 0, + length: 15, + styledKey: StyledStringKey.LETTER_SPACING, + styledValue: new LetterSpacingStyle(new LengthMetrics(10, LengthUnit.VP)) + }] + )) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, this.options) { + Span('Hello World') + } + .id('UIComponentTextCommonCustomDrawingSpan014') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(3, this.LongClickTextCustomMenu, TextResponseType.LONG_PRESS) + .borderWidth(1) + .borderColor(Color.Red) + .width(200) + .height(200) + } + .width('100%') + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Start) + .padding(25) + } + .height('100%') + } + + @Builder + LongClickTextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ content: 'Long Click Menu 1', labelInfo: '' }) + .onClick((event) => { + this.controller.closeSelectionMenu(); + }) + MenuItem({ content: 'Long Click Menu 2', labelInfo: '' }) + MenuItem({ content: 'Long Click Menu 3', labelInfo: '' }) + } + } + .MenuStyles() + } + } +} + +@Extend(Menu) +function MenuStyles() { + .clip(true) + .backgroundColor('#F0F0F0') +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan015.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1951f9e05409bdef156478f53b71096992cd842 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan015.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. + */ + +class MyCustomSpan15 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + } + + width: number = 50; + height: number = 50; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan015 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan15 = new MyCustomSpan15(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State getString: string = ''; + + async onPageShow() { + this.controller.setStyledString(this.style1) + } + + build() { + Column() { + Column() { + Button('get string') + .id('UIComponentTextCommonCustomDrawingSpan015') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.style1) { + this.getString = 'getString value: ' + this.style1.getString(); + this.controller.setStyledString(this.style1); + } + }) + Text(undefined, { controller: this.controller }) { + } + + Text(this.getString) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan016.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc4c77560ffba54516bda3b9d4a6275289dab864 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan016.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. + */ + +class MyCustomSpan16 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + } + + width: number = 50; + height: number = 50; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan016 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan16 = new MyCustomSpan16(); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State getLength: string = ''; + + async onPageShow() { + this.controller.setStyledString(this.style1) + } + + build() { + Column() { + Column() { + Button('get length') + .id('UIComponentTextCommonCustomDrawingSpan016') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.style1) { + this.getLength = 'getLength value: ' + this.style1.length; + this.controller.setStyledString(this.style1); + } + }) + Text(undefined, { controller: this.controller }) { + } + + Text(this.getLength) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan017.ets new file mode 100644 index 0000000000000000000000000000000000000000..0730dd9fb877e16be654153823809e1d9733effc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan017.ets @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { LengthMetrics } from '@kit.ArkUI'; + +class MyCustomSpan12 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString( + 'Hello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello ', + font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, 120); + canvas.detachBrush(); + } + + width: number = 200; + height: number = 200; +} + +class MyCustomSpan17 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString( + 'Test Test Test Test Test Test Test Test Test ', + font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 0, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, 60); + canvas.detachBrush(); + } + + width: number = 100; + height: number = 100; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan017 { + controller1: TextController = new TextController(); + options1: TextOptions = { controller: this.controller1 }; + customSpan1: MyCustomSpan12 = new MyCustomSpan12(); + customSpan3: MyCustomSpan12 = new MyCustomSpan17(); + style1: StyledString = new StyledString(this.customSpan1); + style2: StyledString = new StyledString(this.customSpan1); + style3: StyledString = new StyledString(this.customSpan3); + @State letterSpacing: number = 10; + @State equals1: string = ''; + @State equals2: string = ''; + + async onPageShow() { + this.controller1.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Text(undefined, this.options1) { + Span('Hello World') + } + .id('UIComponentTextCommonCustomDrawingSpan017') + .copyOption(CopyOptions.InApp) + .bindSelectionMenu(3, this.LongClickTextCustomMenu, TextResponseType.LONG_PRESS) + .letterSpacing(this.letterSpacing) + .borderWidth(1) + .borderColor(Color.Red) + .width(200) + .height(200) + + Button('get 按钮') + .id('UIComponentTextCommonCustomDrawingSpan017_btn1') + .margin(10) + .onClick(() => { + this.style2 = new StyledString(this.customSpan1); + }) + + Button('相等的两个custom span判断相同') + .id('UIComponentTextCommonCustomDrawingSpan017_btn2') + .margin(10) + .onClick(() => { + this.equals1 = '相等的两个custom span判断相同, 返回值: ' + this.style1.equals(this.style2); + }) + + Button('不相等的两个custom span判断不相同') + .id('UIComponentTextCommonCustomDrawingSpan017_btn3') + .margin(10) + .onClick(() => { + this.equals2 = '不相等的两个custom span判断不相同, 返回值: ' + this.style1.equals(this.style3); + }) + + Text(this.equals1).fontSize(30) + .margin(10) + Text(this.equals2).fontSize(30) + .margin(10) + } + .width('100%') + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Start) + .padding(25) + } + .height('100%') + } + + @Builder + LongClickTextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ content: 'Long Click Menu 1', labelInfo: '' }) + .onClick((event) => { + this.controller1.closeSelectionMenu(); + }) + MenuItem({ content: 'Long Click Menu 2', labelInfo: '' }) + MenuItem({ content: 'Long Click Menu 3', labelInfo: '' }) + } + } + .MenuStyles() + } + } +} + +@Extend(Menu) +function MenuStyles() { + .clip(true) + .backgroundColor('#F0F0F0') +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan019.ets new file mode 100644 index 0000000000000000000000000000000000000000..7af87c543ea98bb67007c9f9c3cdc2adbfb073fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan019.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { LengthMetrics } from '@kit.ArkUI'; + +class MyCustomSpan12 extends CustomSpan { + constructor() { + super(); + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString( + 'Hello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello ', + font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x, 120); + canvas.detachBrush(); + } + + width: number = 200; + height: number = 200; +} + + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan019 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan12 = new MyCustomSpan12(); + mutableStyledString: MutableStyledString | undefined = undefined; + @State letterSpacing: number = 10; + @State spanStyle: SpanStyle[] | null = null; + @State spanStr: string = ''; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('这是一段测试文字', [ + { + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }, + { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + } + ]); + this.controller.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextCommonCustomDrawingSpan019') + .copyOption(CopyOptions.InApp) + .letterSpacing(this.letterSpacing) + .borderWidth(1) + .borderColor(Color.Red) + .width(200) + .height(200) + + Button('get 按钮') + .id('UIComponentTextCommonCustomDrawingSpan019_btn1') + .margin(10) + .onClick(() => { + if (this.mutableStyledString) { + this.spanStyle = this.mutableStyledString.getStyles( + 0, this.mutableStyledString.length, StyledStringKey.FONT + ); + this.spanStr = JSON.stringify(this.spanStyle); + } + }) + + Text(this.spanStr).fontSize(30) + .margin(10) + } + .width('100%') + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Start) + .padding(25) + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan020.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9ee2e3b76beb55f72a68eae6ced0119413bc76a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan020.ets @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { image } from '@kit.ImageKit'; + +class MyCustomSpan20 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 0, green: 74, blue: 175 }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ alpha: 255, red: 23, green: 169, blue: 141 }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan020 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan20 = new MyCustomSpan20("Hello world", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State deleteLength: number = 0; + insertImagePixelMap: image.PixelMap | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + + async onPageShow() { + this.insertImagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if(this.insertImagePixelMap !== undefined) { + let insert = new MutableStyledString(new ImageAttachment({ + value: this.insertImagePixelMap, + size: { width: 100, height: 100 }, + })); + this.style1.insertStyledString(0, insert); + } + this.style1.insertString(1, 'ha'); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 3') + .id('startButton') + .margin({ bottom: 20 }) + .onClick(() => { + this.startIndex = 3; + }) + + Button('Modify and delete length to 1') + .id('length') + .margin({ bottom: 20 }) + .onClick(() => { + this.deleteLength = 1; + }) + + Button('remove span') + .id('removeButton') + .margin({ bottom: 20 }) + .onClick(() => { + if (this.style1) { + this.style1.removeString(this.startIndex, this.deleteLength); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan021.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c2cf1afbb03636aa835aef5fa515c60e158f0fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan021.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2124 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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'; + +class MyCustomSpan21 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 0, green: 74, blue: 175 }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ alpha: 255, red: 23, green: 169, blue: 141 }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 21, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 210; + height: number = 210; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan021 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan21 = new MyCustomSpan21("Hello world", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State deleteLength: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1) + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.deleteLength = 1; + }) + + Button('remove span') + .id('removeButton') + .margin({ bottom: 21 }) + .onClick(() => { + if (this.style1) { + this.style1.removeString(this.startIndex, this.deleteLength); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan022.ets new file mode 100644 index 0000000000000000000000000000000000000000..80bc1d15f8315a00a73f57485746ce2b2f1b3f0c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan022.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 { drawing } from '@kit.ArkGraphics2D'; +import { image } from '@kit.ImageKit'; + +class MyCustomSpan22 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan022 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan22 = new MyCustomSpan22("Hello world", 300, 300); + customSpan2: MyCustomSpan22 = new MyCustomSpan22("hahaha", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + + async onPageShow() { + this.style1.insertString(0,'sss') + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 3') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 3; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('Replace with span') + .id('UIComponentTextCommonCustomDrawingSpan022') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.replaceStyle({ + start: this.startIndex, + length: this.length, + styledKey: StyledStringKey.CUSTOM_SPAN, + styledValue: this.customSpan2 + }) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan023.ets new file mode 100644 index 0000000000000000000000000000000000000000..d091e4e427e3cd7aa0640a3fc6fce386963c8933 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan023.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan23 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan023 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan23 = new MyCustomSpan23("Hello world", 100, 100); + customSpan2: MyCustomSpan23 = new MyCustomSpan23("hahaha", 100, 100); + customSpan3: MyCustomSpan23 = new MyCustomSpan23("hhhhh", 100, 100); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('Replace with span') + .id('UIComponentTextCommonCustomDrawingSpan023') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.replaceStyle({ + start: this.startIndex, + length: this.length, + styledKey: StyledStringKey.CUSTOM_SPAN, + styledValue: this.customSpan3 + }) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan024.ets new file mode 100644 index 0000000000000000000000000000000000000000..e1ea07537955d1d7fb3aafcc894ded6bf17c442f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan024.ets @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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'; + +class MyCustomSpan24 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = 'drawing'; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan024 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan24 = new MyCustomSpan24('Hello world', 100, 100); + customSpan2: MyCustomSpan24 = new MyCustomSpan24('hahaha', 100, 100); + customSpan3: MyCustomSpan24 = new MyCustomSpan24('hhhhh', 100, 100); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.style1.appendStyledString(new StyledString(this.customSpan1)) + this.style1.appendStyledString(new StyledString(this.customSpan3)) + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('Replace with span') + .id('UIComponentTextCommonCustomDrawingSpan024') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.replaceStyle({ + start: this.startIndex, + length: this.length, + styledKey: StyledStringKey.CUSTOM_SPAN, + styledValue: this.customSpan3 + }) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..4063d552e0fceae506afd5ba5633d4d8cc5d09bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0250.ets @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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'; + +class CrashSpan extends CustomSpan { + constructor(word: string, width: number, height: number, fontSize: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + this.fontSize = fontSize; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(this.fontSize); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + fontSize: number = 25; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan0250 { + controller: TextController = new TextController(); + customSpan1: CrashSpan = new CrashSpan("Hello world", 200, 200, 30); + customSpan: CrashSpan = new CrashSpan("hahaha", 300, 300, 80); + style1: MutableStyledString = new MutableStyledString(this.customSpan); + @State startIndex: number = 0; + @State length: number = 0; + @State msg: string = ''; + + async onPageShow() { + this.style1.insertString(0, 'sss') + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 3') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = -1; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('setStyle') + .id('UIComponentTextCommonCustomDrawingSpan0250') + .margin({ bottom: 20 }) + .onClick(() => { + try { + this.style1.replaceStyle( + { + start: this.startIndex, + length: this.length, + styledKey: StyledStringKey.CUSTOM_SPAN, + styledValue: this.customSpan1 + } + ); + this.controller.setStyledString(this.style1); + } catch (err) { + this.msg = err.code; + } + } + ) + + Text(undefined, { controller: this.controller }) { + } + + Text('错误码:' + this.msg) + .fontSize(20) + .fontColor(Color.Red) + + } + } + + .height + ('100%' + ) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan027.ets new file mode 100644 index 0000000000000000000000000000000000000000..a5505fc1ad931154a5b78ad98acbf1231c9f50c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan027.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan27 extends CustomSpan { + constructor(word: string, width: number, height: number, fontSize: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + this.fontSize = fontSize; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(this.fontSize); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + fontSize: number = 25; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan027 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan27 = new MyCustomSpan27("Hello world", 200, 200, 30); + customSpan2: MyCustomSpan27 = new MyCustomSpan27("hahaha", 300, 300, 80); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.insertString(0, 'sss') + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 3') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 3; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('setStyle') + .id('UIComponentTextCommonCustomDrawingSpan027') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.setStyle({ + start: this.startIndex, + length: this.length, + styledKey: StyledStringKey.CUSTOM_SPAN, + styledValue: this.customSpan2 + }) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan028.ets new file mode 100644 index 0000000000000000000000000000000000000000..e1ca8de056450b831f1787f27711f160ccf1335b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan028.ets @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common2D, drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan28 extends CustomSpan { + constructor(word: string, width: number, height: number, color: common2D.Color) { + super(); + this.word = word; + this.width = width; + this.height = height; + this.color = color; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor(this.color); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 28, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + color: common2D.Color = { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan028 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan28 = new MyCustomSpan28("Hello world", 100, 100, { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + customSpan2: MyCustomSpan28 = new MyCustomSpan28("hahaha", 100, 100, { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + customSpan3: MyCustomSpan28 = new MyCustomSpan28("new style", 100, 100, { + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('setStyle') + .id('UIComponentTextCommonCustomDrawingSpan028') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.setStyle({ + start: this.startIndex, + length: this.length, + styledKey: StyledStringKey.CUSTOM_SPAN, + styledValue: this.customSpan3 + }) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..1bc9ca21315421e16e75c10a253f70c6ce29e852 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0290.ets @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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'; + +class CrashSpan1 extends CustomSpan { + constructor(word: string, width: number, height: number, fontSize: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + this.fontSize = fontSize; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(this.fontSize); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + fontSize: number = 25; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan0290 { + controller: TextController = new TextController(); + customSpan1: CrashSpan1 = new CrashSpan1("Hello world", 200, 200, 30); + customSpan: CrashSpan1 = new CrashSpan1("hahaha", 300, 300, 80); + style1: MutableStyledString = new MutableStyledString(this.customSpan); + @State startIndex: number = 0; + @State length: number = 0; + @State msg: string = ''; + + async onPageShow() { + this.style1.insertString(0, 'sss') + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 3') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 1; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length =20; + }) + Button('setStyle') + .id('UIComponentTextCommonCustomDrawingSpan0290') + .margin({ bottom: 20 }) + .onClick(() => { + try { + this.style1.setStyle( + { + start: this.startIndex, + length: this.length, + styledKey: StyledStringKey.CUSTOM_SPAN, + styledValue: this.customSpan1 + } + ); + this.controller.setStyledString(this.style1); + } catch (err) { + this.msg = err.code; + } + } + ) + + Text(undefined, { controller: this.controller }) { + } + + Text('错误码:' + this.msg) + .fontSize(20) + .fontColor(Color.Red) + + } + } + + .height + ('100%' + ) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan032.ets new file mode 100644 index 0000000000000000000000000000000000000000..e37cd52ea1f63b0dc47ac660104f8a8b53c2a34b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan032.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common2D, drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan32 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 32, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + color: common2D.Color = { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan032 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan32 = new MyCustomSpan32("Hello world", 150, 150); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.insertString(0, 'hi'); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 2') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 2; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('remove style') + .id('UIComponentTextCommonCustomDrawingSpan032') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan033.ets new file mode 100644 index 0000000000000000000000000000000000000000..fcc5e44069b5dbc73ab184f5e8a05dfd0fbcc55c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan033.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common2D, drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan33 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 33, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + color: common2D.Color = { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan033 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan33 = new MyCustomSpan33("Hello world", 150, 150); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.insertString(1, 'hi'); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('remove style') + .id('UIComponentTextCommonCustomDrawingSpan033') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan034.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb3b9b239d446f086a046413e4c12e0143dff0a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan034.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common2D, drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan34 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 34, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + color: common2D.Color = { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan034 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan34 = new MyCustomSpan34("Hello world", 150, 150); + customSpan2: MyCustomSpan34 = new MyCustomSpan34("hi", 150, 150); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 2') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 2; + }) + Button('remove style') + .id('UIComponentTextCommonCustomDrawingSpan034') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan035.ets new file mode 100644 index 0000000000000000000000000000000000000000..48b9e3aac15a9c9cd9cea0f9a9cfa598e486865b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan035.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common2D, drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan34 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 34, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + color: common2D.Color = { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan035 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan34 = new MyCustomSpan34("Hello world", 150, 150); + customSpan2: MyCustomSpan34 = new MyCustomSpan34("hi", 150, 150); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 2') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 2; + }) + Button('remove style') + .id('UIComponentTextCommonCustomDrawingSpan035') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan036.ets new file mode 100644 index 0000000000000000000000000000000000000000..37bc3ca26bb6596a657b342430ae3b0fb1e02824 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan036.ets @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { image } from '@kit.ImageKit'; + +class MyCustomSpan36 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 36, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan036 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan36 = new MyCustomSpan36("Hello world", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + insertImagePixelMap: image.PixelMap | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.insertImagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.insertImagePixelMap !== undefined) { + let insert = new MutableStyledString(new ImageAttachment({ + value: this.insertImagePixelMap, + size: { width: 100, height: 100 }, + })); + this.style1.insertStyledString(0, insert); + } + + let mutableStyledString = new MutableStyledString('测试文字', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Blue }) + }]); + this.style1.insertStyledString(1, mutableStyledString); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 36 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 6') + .id('length') + .margin({ bottom: 36 }) + .onClick(() => { + this.length = 6; + }) + + Button('remove style') + .id('removeButton') + .margin({ bottom: 36 }) + .onClick(() => { + if (this.style1) { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan037.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan037.ets new file mode 100644 index 0000000000000000000000000000000000000000..1854458470e54e712e36c68755acb9b60e0020b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan037.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common2D, drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan37 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 255, + green: 255, + blue: 0 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 37, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + color: common2D.Color = { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan037 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan37 = new MyCustomSpan37("Hello world", 150, 150); + customSpan2: MyCustomSpan37 = new MyCustomSpan37("hi", 150, 150); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 1; + }) + Button('remove style') + .id('removeButton') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + .id("UIComponentTextCommonCustomDrawingSpan037") + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan038.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan038.ets new file mode 100644 index 0000000000000000000000000000000000000000..565c20bd713c52718eaeb60a2487e5b7bafdb3db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan038.ets @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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'; + +class MyCustomSpan38 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 255, + green: 255, + blue: 0 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 38, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; + color: common2D.Color = { + alpha: 255, + red: 0, + green: 74, + blue: 175 + }; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan038 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan38 = new MyCustomSpan38("Hello world", 150, 150); + customSpan2: MyCustomSpan38 = new MyCustomSpan38("hi", 150, 150); + customSpan3: MyCustomSpan38 = new MyCustomSpan38("hey", 150, 150); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.style1.appendStyledString(new StyledString(this.customSpan3)) + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 21 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify length to 3') + .id('length') + .margin({ bottom: 21 }) + .onClick(() => { + this.length = 3; + }) + Button('remove style') + .id('removeButton') + .margin({ bottom: 20 }) + .onClick(() => { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + .id("UIComponentTextCommonCustomDrawingSpan038") + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan039.ets new file mode 100644 index 0000000000000000000000000000000000000000..70c7ba37b07e276b7b1f097c878beb78e10b0f66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan039.ets @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { image } from '@kit.ImageKit'; + +class MyCustomSpan39 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 39, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan039 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan39 = new MyCustomSpan39("Hello world", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + insertImagePixelMap: image.PixelMap | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.insertImagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.insertImagePixelMap !== undefined) { + let insert = new MutableStyledString(new ImageAttachment({ + value: this.insertImagePixelMap, + size: { width: 100, height: 100 }, + })); + this.style1.insertStyledString(0, insert); + } + + let mutableStyledString = new MutableStyledString('字', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.style1.insertStyledString(2, mutableStyledString); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 39 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 1') + .id('length') + .margin({ bottom: 39 }) + .onClick(() => { + this.length = 1; + }) + + Button('remove style') + .id('removeButton') + .margin({ bottom: 39 }) + .onClick(() => { + if (this.style1) { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.IMAGE); + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN); + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.FONT); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan040.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd291307d99c1fdb8a244adff6ee5b747d2013ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan040.ets @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { image } from '@kit.ImageKit'; + +class MyCustomSpan40 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 40, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan040 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan40 = new MyCustomSpan40("Hello world", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + mutableStyledString: MutableStyledString | undefined = undefined; + @State startIndex: number = 0; + @State length: number = 0; + @State styledStringLength: number = 0; + insertImagePixelMap: image.PixelMap | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.insertImagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.insertImagePixelMap !== undefined) { + let insert = new MutableStyledString(new ImageAttachment({ + value: this.insertImagePixelMap, + size: { width: 100, height: 100 }, + })); + this.style1.insertStyledString(1, insert); + } + + this.mutableStyledString = new MutableStyledString('测试文字', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.styledStringLength = this.mutableStyledString.length; + this.style1.insertStyledString(2, this.mutableStyledString); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 1') + .id('length') + .margin({ bottom: 40 }) + .onClick(() => { + this.length = 1; + }) + + Button('remove style') + .id('removeButton') + .margin({ bottom: 40 }) + .onClick(() => { + if (this.style1) { + this.style1.removeStyle(this.startIndex, this.length, StyledStringKey.CUSTOM_SPAN); + this.controller.setStyledString(this.style1); + if(this.mutableStyledString) { + this.styledStringLength = this.mutableStyledString.length; + } + } + }) + + Text(undefined, { controller: this.controller }) { + } + + Text('属性字符串的长度为:'+ this.styledStringLength.toString()) { + } + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan041.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f4ae85abddbba052215ef4111e196b974eaf640 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan041.ets @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { image } from '@kit.ImageKit'; + +class MyCustomSpan41 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 41, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan041 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan41 = new MyCustomSpan41("Hello world", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + mutableStyledString: MutableStyledString | undefined = undefined; + @State startIndex: number = 0; + insertImagePixelMap: image.PixelMap | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.insertImagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.insertImagePixelMap !== undefined) { + let insert = new MutableStyledString(new ImageAttachment({ + value: this.insertImagePixelMap, + size: { width: 100, height: 100 }, + })); + this.style1.insertStyledString(1, insert); + } + + this.mutableStyledString = new MutableStyledString('测试文字', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.style1.insertStyledString(2, this.mutableStyledString); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('clear styles') + .id('clearButton') + .margin({ bottom: 40 }) + .onClick(() => { + if (this.style1) { + this.style1.clearStyles(); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan042.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan042.ets new file mode 100644 index 0000000000000000000000000000000000000000..41087e36eb98bdab50ef65874fc6735a518dfb16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan042.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 { drawing } from '@kit.ArkGraphics2D'; +import { image } from '@kit.ImageKit'; + +class MyCustomSpan42 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 142 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 42, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 420; + height: number = 420; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan042 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan42 = new MyCustomSpan42("Hello world", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + mutableStyledString: MutableStyledString | undefined = undefined; + @State startIndex: number = 0; + @State length: number = 0; + insertImagePixelMap: image.PixelMap | undefined = undefined; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('测试文字', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 42 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 1') + .id('length') + .margin({ bottom: 42 }) + .onClick(() => { + this.length = 1; + }) + + Button('replace StyledString') + .id('replaceButton') + .margin({ bottom: 42 }) + .onClick(() => { + if (this.style1) { + this.style1.replaceStyledString(this.startIndex, this.length, this.mutableStyledString); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan043.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed04bf84b9d82ce1fe56b76533b177d8cd71da5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan043.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { image } from '@kit.ImageKit'; + +class MyCustomSpan43 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 143 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 43, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 430; + height: number = 430; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan043 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan43 = new MyCustomSpan43("Hello world", 300, 300); + customSpan2: MyCustomSpan43 = new MyCustomSpan43("hi", 300, 300); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + mutableStyledString: MutableStyledString = new MutableStyledString(this.customSpan2); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 43 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 1') + .id('length') + .margin({ bottom: 43 }) + .onClick(() => { + this.length = 1; + }) + + Button('replace StyledString') + .id('replaceButton') + .margin({ bottom: 43 }) + .onClick(() => { + if (this.style1) { + this.style1.replaceStyledString(this.startIndex, this.length, this.mutableStyledString); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan044.ets new file mode 100644 index 0000000000000000000000000000000000000000..cfd907d81511bae28ec3c101d18ab73882dbf0da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan044.ets @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 { image } from '@kit.ImageKit'; + +class MyCustomSpan44 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 144 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 44, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan044 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan44 = new MyCustomSpan44("Hello", 300, 300); + customSpan2: MyCustomSpan44 = new MyCustomSpan44("hi", 100, 100); + customSpan3: MyCustomSpan44 = new MyCustomSpan44("hey", 200, 200); + customSpan4: MyCustomSpan44 = new MyCustomSpan44("Hello world", 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + replaceStyledString: MutableStyledString = new MutableStyledString(this.customSpan4); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.style1.appendStyledString(new MutableStyledString(this.customSpan2)); + this.style1.appendStyledString(new MutableStyledString(this.customSpan3)); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 3') + .id('length') + .margin({ bottom: 40 }) + .onClick(() => { + this.length = 3; + }) + + Button('replace StyledString') + .id('replaceButton') + .margin({ bottom: 40 }) + .onClick(() => { + if (this.style1) { + this.style1.replaceStyledString(this.startIndex, this.length, this.replaceStyledString); + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan045.ets new file mode 100644 index 0000000000000000000000000000000000000000..921edb4033c1c02ae8cc578425f5705b647e65aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan045.ets @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { image } from '@kit.ImageKit'; + +class MyCustomSpan45 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 145 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 45, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan045 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan45 = new MyCustomSpan45("Hello", 300, 300); + customSpan2: MyCustomSpan45 = new MyCustomSpan45("hi", 100, 100); + customSpan3: MyCustomSpan45 = new MyCustomSpan45("hey", 200, 200); + customSpan4: MyCustomSpan45 = new MyCustomSpan45("Hello world", 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + imagePixelMap: image.PixelMap | undefined = undefined; + replaceStyledString: MutableStyledString = new MutableStyledString(this.customSpan4); + @State startIndex: number = 0; + @State length: number = 0; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.style1.appendStyledString(new MutableStyledString(this.customSpan2)); + this.style1.appendStyledString(new MutableStyledString(this.customSpan3)); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 3') + .id('length') + .margin({ bottom: 40 }) + .onClick(() => { + this.length = 3; + }) + + Button('replace StyledString') + .id('replaceButton') + .margin({ bottom: 40 }) + .onClick(() => { + if (this.style1) { + if (this.imagePixelMap !== undefined) { + this.replaceStyledString.appendStyledString(new StyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 100, height: 100 }, + }))); + } + this.style1.replaceStyledString(this.startIndex, this.length, this.replaceStyledString); + + this.controller.setStyledString(this.style1); + } + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } + } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan046.ets new file mode 100644 index 0000000000000000000000000000000000000000..477c28c0074582695fa0e23aa9ffa97ae0e870aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan046.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan46 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 146 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 46, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan046 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan46 = new MyCustomSpan46("Hello", 100, 100); + customSpan2: MyCustomSpan46 = new MyCustomSpan46("hi", 100, 100); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 0') + .id('startButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.startIndex = 0; + }) + + Button('Modify and delete length to 1') + .id('length') + .margin({ bottom: 40 }) + .onClick(() => { + this.length = 1; + }) + + Button('insertStyled') + .id('insertButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.style1.insertStyledString(this.startIndex, new MutableStyledString(this.customSpan2)); + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan047.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan047.ets new file mode 100644 index 0000000000000000000000000000000000000000..5934e480b7488629f7e1b31c59fccef7ab339a5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan047.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan47 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 147 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 47, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan047 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan47 = new MyCustomSpan47("Hello", 100, 100); + customSpan2: MyCustomSpan47 = new MyCustomSpan47("hi", 100, 100); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Change the starting position to 1') + .id('startButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.startIndex = 1; + }) + + Button('Modify length to 1') + .id('length') + .margin({ bottom: 40 }) + .onClick(() => { + this.length = 1; + }) + + Button('insert StyledString') + .id('insertButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.style1.insertStyledString(this.startIndex, new MutableStyledString(this.customSpan2)); + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan048.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan048.ets new file mode 100644 index 0000000000000000000000000000000000000000..4defb982a58cca06dad6a4052a75fb541beaea99 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan048.ets @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { drawing } from '@kit.ArkGraphics2D'; +import { image } from '@kit.ImageKit'; + +class MyCustomSpan48 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 148 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 48, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan048 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan48 = new MyCustomSpan48("Hello", 100, 100); + customSpan2: MyCustomSpan48 = new MyCustomSpan48("hi", 100, 100); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('append StyledString') + .id('appendButton') + .margin({ bottom: 40 }) + .onClick(() => { + this.style1.appendStyledString(new MutableStyledString(this.customSpan2)); + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan049.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan049.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bd65d41fbcc93aed92755fdd76f50459aa265bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan049.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan49 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 149 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 49, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan049 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan49 = new MyCustomSpan49("Hello", 100, 100); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .copyOption(CopyOptions.InApp) + .id('UIComponentTextCommonCustomDrawingSpan049') + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan050.ets new file mode 100644 index 0000000000000000000000000000000000000000..900d9d9ddb4e9446ecccb2197555646586764ecc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan050.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan50 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 150 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 50, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = 'drawing'; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan050 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan50 = new MyCustomSpan50('Hello', 100, 100); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .copyOption(CopyOptions.InApp) + .id('UIComponentTextCommonCustomDrawingSpan050') + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan051.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan051.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a0e2933c8ca134fdf321f4176b6ca3e271f2fdf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan051.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan51 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 151 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 51, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan051 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan51 = new MyCustomSpan51("Hello", 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .obscured([ObscuredReasons.PLACEHOLDER]) + .copyOption(CopyOptions.InApp) + .id('UIComponentTextCommonCustomDrawingSpan051') + .border({ width: 1 }) + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan052.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan052.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d06f051b75119edd020b8c0b2fea6ef82c8fa45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan052.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan52 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 152 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 52, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan052 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan52 = new MyCustomSpan52("Hello", 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + @State isshow: boolean = true; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('isshow CustomSpan') + .id('UIComponentTextCommonCustomDrawingSpan052') + .margin({ bottom: 43 }) + .onClick(() => { + this.isshow = !this.isshow; + }) + Text(undefined, { controller: this.controller }) { + } + .visibility(this.isshow ? Visibility.Visible : Visibility.None) + .border({ width: 1 }) + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan053.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan053.ets new file mode 100644 index 0000000000000000000000000000000000000000..45bbbd4295b1bad896eabdcc10bd4b0d475139fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan053.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan53 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 153 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 53, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan053 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan53 = new MyCustomSpan53("Hello", 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + @State enabledSpan: boolean = true; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('Disable CustomSpan') + .id('enabledButton') + .margin({ bottom: 43 }) + .onClick(() => { + this.enabledSpan = false; + }) + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextCommonCustomDrawingSpan053') + .enabled(this.enabledSpan) + .copyOption(CopyOptions.InApp) + .border({ width: 1 }) + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan054.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan054.ets new file mode 100644 index 0000000000000000000000000000000000000000..ecae749e5a4e5e63ef86fb1de1cbf0d7a80056c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan054.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan54 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 154 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 54, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan054 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan54 = new MyCustomSpan54("Hello", 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + @State startIndex: number = 0; + @State length: number = 0; + @State enabledSpan: boolean = true; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextCommonCustomDrawingSpan054') + .draggable(true) + .border({ width: 1 }) + .margin({ bottom: 50 }) + .copyOption(CopyOptions.InApp) + + TextArea() + .id('textArea') + .border({ width: 1 }) + .width(200) + .height(200) + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan055.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan055.ets new file mode 100644 index 0000000000000000000000000000000000000000..f09c92bb92d4d3bb61e24640e3c28a17102755ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan055.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 { drawing } from '@kit.ArkGraphics2D'; + +class MyCustomSpan55 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 155 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 55, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = "drawing"; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan055 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan55 = new MyCustomSpan55("Hello", 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan1); + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('insert string') + .id('UIComponentTextCommonCustomDrawingSpan055') + .margin({ bottom: 40 }) + .onClick(() => { + this.style1.insertString(1, 'hey'); + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + .border({ width: 1 }) + .padding(20) + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan056.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca16aae0a58c0fb24eba7559b8525213f642d156 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan056.ets @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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'; + +class MyCustomSpan56 extends CustomSpan { + constructor(word: string, width: number, height: number) { + super(); + this.word = word; + this.width = width; + this.height = height; + } + + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { + return { width: this.width, height: this.height }; + } + + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 255 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: options.x + 10, + right: options.x + vp2px(this.width) - 10, + top: options.lineTop + 10, + bottom: options.lineBottom - 10 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 155 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, options.x + 55, options.lineBottom - 15); + canvas.detachBrush(); + } + + setWord(word: string) { + this.word = word; + } + + width: number = 200; + height: number = 200; + word: string = 'drawing'; +} + +@Entry +@Component +struct UIComponentTextCommonCustomDrawingSpan056 { + controller: TextController = new TextController(); + customSpan1: MyCustomSpan56 = new MyCustomSpan56('Hello', 200, 200); + customSpan2: MyCustomSpan56 = new MyCustomSpan56('HelloHelloHelloHelloHelloHelloHelloHello', 200, 200); + style1: MutableStyledString = new MutableStyledString(this.customSpan2); + @State clipVal: boolean = true; + + async onPageShow() { + this.controller.setStyledString(this.style1); + } + + build() { + Column() { + Column() { + Button('insert string') + .id('UIComponentTextCommonCustomDrawingSpan056_1') + .onClick(() => { + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.controller.setStyledString(this.style1); + }) + Button('clip button') + .id('UIComponentTextCommonCustomDrawingSpan056_2') + .margin(20) + .onClick(() => { + this.clipVal = !this.clipVal; + this.style1.appendStyledString(new StyledString(this.customSpan2)) + this.controller.setStyledString(this.style1); + }) + + Text(undefined, { controller: this.controller }) { + } + .border({ width: 1 }) + .clip(this.clipVal) + + } + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater001.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b4f1df55ad9c3705fbf3b62394e32455a7e027d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater001.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 { AttributeUpdater } from '@kit.ArkUI' + +class MyTextModifier extends AttributeUpdater { + initializeModifier(instance: TextAttribute) { + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater001 { + private modifier: MyTextModifier = new MyTextModifier() + + build() { + Row() { + Column() { + Text("Hello") + .attributeModifier(this.modifier) + .fontSize(14).border({ width: 1 }).textAlign(TextAlign.Center).lineHeight(20) + .width(200).height(50) + .backgroundColor(Color.Green) + .id('UIComponentTextCommonItscaAttributeUpdater001') + .onClick(() => { + this.modifier.updateConstructorParams("Updated"); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater002.ets new file mode 100644 index 0000000000000000000000000000000000000000..186c938e2e657dfb1e2572270a81ffef75331349 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater002.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. + */ +import { AttributeUpdater } from '@kit.ArkUI' + +class MyTextModifier extends AttributeUpdater { + initializeModifier(instance: TextAttribute) { + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater002 { + private modifier: MyTextModifier = new MyTextModifier() + + + + build() { + Row() { + Column() { + Text("Hello") + .attributeModifier(this.modifier) + .fontSize(14).border({ width: 1 }).textAlign(TextAlign.Center).lineHeight(20) + .width(200).height(50) + .backgroundColor(Color.Yellow) + .id('UIComponentTextCommonItscaAttributeUpdater002') + .onClick(() => { + this.modifier.updateConstructorParams(getContext().resourceManager.getStringSync($r("app.string.attributeUpdater"))); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater003.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac4c9eb17dec94e5fb0d0861e0c787b71fec5785 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater003.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 { AttributeUpdater } from '@kit.ArkUI' + +class MyTextModifier extends AttributeUpdater { + initializeModifier(instance: TextAttribute) { + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater003 { + private modifier: MyTextModifier = new MyTextModifier() + + build() { + Row() { + Column() { + Text("Hello") + .attributeModifier(this.modifier) + .fontSize(14).border({ width: 1 }).textAlign(TextAlign.Center).lineHeight(20) + .width(200).height(50) + .backgroundColor(Color.Green) + .id('UIComponentTextCommonItscaAttributeUpdater003') + .onClick(() => { + this.modifier.updateConstructorParams(undefined); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater004.ets new file mode 100644 index 0000000000000000000000000000000000000000..6328a549952ea2e080ad178c2503881152ef5a74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater004.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 { AttributeUpdater } from '@kit.ArkUI' + +class MyTextModifier extends AttributeUpdater { + initializeModifier(instance: TextAttribute) { + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater004 { + private modifier: MyTextModifier = new MyTextModifier() + + build() { + Row() { + Column() { + Text("Hello") + .attributeModifier(this.modifier) + .fontSize(14).border({ width: 1 }).textAlign(TextAlign.Center).lineHeight(20) + .width(200).height(50) + .backgroundColor(Color.Green) + .id('UIComponentTextCommonItscaAttributeUpdater004') + .onClick(() => { + this.modifier.updateConstructorParams(''); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater005.ets new file mode 100644 index 0000000000000000000000000000000000000000..60d07c7d479f6885173650f3a0585a41a751efef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater005.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 { AttributeUpdater } from '@kit.ArkUI'; + +class MyTextModifier extends AttributeUpdater { + initializeModifier(instance: TextAttribute) { + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater005 { + controller: TextController = new TextController(); + private modifier: MyTextModifier = new MyTextModifier() + + build() { + Row() { + Column() { + Button('change text') + .id('change') + .onClick(() => { + this.modifier.updateConstructorParams("Updated"); + }) + + + Text('Initialize', { controller: this.controller }) + .attributeModifier(this.modifier) + .fontSize(14) + .border({ width: 1 }) + .textAlign(TextAlign.Center) + .lineHeight(20) + .width(200) + .height(50) + .id('UIComponentTextCommonItscaAttributeUpdater005') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater006.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f978b9dfea279a55d10a9870f1fe2cd65b08984 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater006.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 { AttributeUpdater } from '@kit.ArkUI'; + +class MyTextModifier extends AttributeUpdater { + initializeModifier(instance: TextAttribute) { + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater006 { + controller: TextController | null = null; + private modifier: MyTextModifier = new MyTextModifier() + + build() { + Row() { + Column() { + Button('change text') + .id('change') + .onClick(() => { + this.controller = new TextController(); + this.modifier.updateConstructorParams('Updated'); + }) + + + Text('Initialize', { controller: this.controller }) + .attributeModifier(this.modifier) + .fontSize(14) + .border({ width: 1 }) + .textAlign(TextAlign.Center) + .lineHeight(20) + .width(200) + .height(50) + .id('UIComponentTextCommonItscaAttributeUpdater006') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater007.ets new file mode 100644 index 0000000000000000000000000000000000000000..66398f479360356edc9a8903bd2b14654f24a4e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater007.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 { AttributeUpdater } from '@kit.ArkUI'; + +export class ImageModifier extends AttributeUpdater { + width: number = 60; + height: number = 60; + + constructor(width: number, height: number) { + super(); + this.width = width; + this.height = height + } + + applyNormalAttribute(instance: ImageAttribute): void { + instance.width(this.width); + instance.height(this.height); + } +} + +/* + 自定义class实现text的AttributeModifier接口,用于初始化 +*/ +export class TextModifier extends AttributeUpdater { + textSize: number = 12; + + constructor(textSize: number) { + super(); + this.textSize = textSize; + } + + applyNormalAttribute(instance: TextAttribute): void { + instance.fontSize(this.textSize); + instance.fontColor(Color.Orange); + instance.textAlign(TextAlign.Center); + instance.border({ width: 1, color: Color.Orange, style: BorderStyle.Solid }); + instance.margin({ right: 10 }); + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater007 { + @State textOneContent: string | Resource = 'default'; + @State imageSrc: PixelMap | ResourceStr | DrawableDescriptor = ('icon.png'); + //接受外部传入的AttributeModifier类实例,可以只定制部分组件,选择性传入参数。 + @State textOne: AttributeUpdater = new TextModifier(30); + @State imageModifier: AttributeUpdater = new ImageModifier(60, 60); + + build() { + Row() { + Column() { + + Button('change image') + .id('change') + .onClick(() => { + this.imageSrc = ('cat.jpg'); + this.textOne.attribute?.backgroundImage('cat.jpg'); + }) + + Text(this.textOneContent) + .id('UIComponentTextCommonItscaAttributeUpdater007') + .backgroundImage('icon.png') + .attributeModifier(this.textOne) + .fontColor(Color.Orange) + .width(200) + .height(200) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater008.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3f8af56d2aba1cf5d4a76b9f59ed8c14fff1641 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater008.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 { AttributeUpdater } from '@kit.ArkUI'; +import { DrawableDescriptor } from '@kit.ArkUI' +import { image } from '@kit.ImageKit'; + +/* + 自定义class实现text的AttributeModifier接口,用于初始化 +*/ +export class TextModifier extends AttributeUpdater { + textSize: number = 12; + + constructor(textSize: number) { + super(); + this.textSize = textSize; + } + + applyNormalAttribute(instance: TextAttribute): void { + instance.fontSize(this.textSize); + instance.fontColor(Color.Orange); + instance.textAlign(TextAlign.Center); + instance.border({ width: 1, color: Color.Orange, style: BorderStyle.Solid }); + instance.margin({ right: 10 }); + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater008 { + @State textOneContent: string | Resource = 'default'; + @State imageSrc: PixelMap | ResourceStr | DrawableDescriptor = ('icon.png'); + //接受外部传入的AttributeModifier类实例,可以只定制部分组件,选择性传入参数。 + @State textOne: AttributeUpdater = new TextModifier(30); + imagePixelMap: image.PixelMap | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow(): Promise { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + } + + build() { + Row() { + Column() { + Button('change image') + .id('change') + .onClick(() => { + this.imageSrc = ('cat.jpg'); + this.textOne.attribute?.backgroundImage(this.imagePixelMap); + }) + + Text(this.textOneContent) + .id('UIComponentTextCommonItscaAttributeUpdater008') + .backgroundImage('icon.png') + .attributeModifier(this.textOne) + .fontColor(Color.Orange) + .width(200) + .height(200) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater009.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a3f133aea2f74a921613f8b301dc8d1466d9084 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater009.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 { AttributeUpdater } from '@kit.ArkUI'; +import { DrawableDescriptor } from '@kit.ArkUI' +import { image } from '@kit.ImageKit'; + +/* + 自定义class实现text的AttributeModifier接口,用于初始化 +*/ +export class TextModifier extends AttributeUpdater { + textSize: number = 12; + + constructor(textSize: number) { + super(); + this.textSize = textSize; + } + + applyNormalAttribute(instance: TextAttribute): void { + instance.fontSize(this.textSize); + instance.fontColor(Color.Orange); + instance.textAlign(TextAlign.Center); + instance.border({ width: 1, color: Color.Orange, style: BorderStyle.Solid }); + instance.margin({ right: 10 }); + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater009 { + @State textOneContent: string | Resource = 'default'; + @State imageSrc: PixelMap | ResourceStr | DrawableDescriptor = ('icon.png'); + //接受外部传入的AttributeModifier类实例,可以只定制部分组件,选择性传入参数。 + @State textOne: AttributeUpdater = new TextModifier(30); + + build() { + Row() { + Column() { + Button('change image') + .id('change') + .onClick(() => { + this.imageSrc = ('cat.jpg'); + this.textOne.attribute?.backgroundImage('cat.jpg'); + }) + + Text(this.textOneContent) + .id('UIComponentTextCommonItscaAttributeUpdater009') + .backgroundImage('icon.png') + .attributeModifier(this.textOne) + .fontColor(Color.Orange) + .width(200) + .height(200) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater010.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc4070cacc44120857f5de4c796e5ad96137e3f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater010.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 { AttributeUpdater } from '@kit.ArkUI'; +import { DrawableDescriptor } from '@kit.ArkUI' +import { image } from '@kit.ImageKit'; + +/* + 自定义class实现text的AttributeModifier接口,用于初始化 +*/ +export class TextModifier extends AttributeUpdater { + textSize: number = 12; + + constructor(textSize: number) { + super(); + this.textSize = textSize; + } + + applyNormalAttribute(instance: TextAttribute): void { + instance.fontSize(this.textSize); + instance.fontColor(Color.Orange); + instance.textAlign(TextAlign.Center); + instance.border({ width: 1, color: Color.Orange, style: BorderStyle.Solid }); + instance.margin({ right: 10 }); + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater010 { + @State textOneContent: string | Resource = 'default'; + @State imageSrc: PixelMap | ResourceStr | DrawableDescriptor = ('icon.png'); + //接受外部传入的AttributeModifier类实例,可以只定制部分组件,选择性传入参数。 + @State textOne: AttributeUpdater = new TextModifier(30); + resManager = getContext().resourceManager; + pixmapDrawableDescriptor: DrawableDescriptor = new DrawableDescriptor(); + pixmapNew: image.PixelMap = this.pixmapDrawableDescriptor.getPixelMap(); + + onPageShow(): void { + let resourceId = this.getResourceId($r('app.media.cat')); + this.pixmapDrawableDescriptor = this.resManager.getDrawableDescriptor(resourceId); + this.pixmapNew = this.pixmapDrawableDescriptor.getPixelMap(); + } + + private getResourceId(resource: Resource): number { + return resource.id; + } + + build() { + Row() { + Column() { + Button('change image') + .id('change') + .onClick(() => { + this.imageSrc = ('cat.jpg'); + this.textOne.attribute?.backgroundImage(this.pixmapNew); + }) + + Text(this.textOneContent) + .id('UIComponentTextCommonItscaAttributeUpdater010') + .backgroundImage('icon.png') + .attributeModifier(this.textOne) + .fontColor(Color.Orange) + .width(200) + .height(200) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater011.ets new file mode 100644 index 0000000000000000000000000000000000000000..faa4682c86da60e05ec75290956c76d8cdb2efe2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater011.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 { AttributeUpdater } from '@kit.ArkUI'; +import { DrawableDescriptor } from '@kit.ArkUI' +import { image } from '@kit.ImageKit'; + +/* + 自定义class实现text的AttributeModifier接口,用于初始化 +*/ +export class TextModifier extends AttributeUpdater { + textSize: number = 12; + + constructor(textSize: number) { + super(); + this.textSize = textSize; + } + + applyNormalAttribute(instance: TextAttribute): void { + instance.fontSize(this.textSize); + instance.fontColor(Color.Orange); + instance.textAlign(TextAlign.Center); + instance.border({ width: 1, color: Color.Orange, style: BorderStyle.Solid }); + instance.margin({ right: 10 }); + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater011 { + @State textOneContent: string | Resource = 'default'; + @State imageSrc: PixelMap | ResourceStr | DrawableDescriptor = ('icon.png'); + //接受外部传入的AttributeModifier类实例,可以只定制部分组件,选择性传入参数。 + @State textOne: AttributeUpdater = new TextModifier(30); + + build() { + Row() { + Column() { + Button('change image') + .id('change') + .onClick(() => { + this.imageSrc = ('cat.jpg'); + this.textOne.attribute?.backgroundImage('cat.jpg'); + }) + + Text(this.textOneContent) + .id('UIComponentTextCommonItscaAttributeUpdater011') + .backgroundImage(undefined) + .attributeModifier(this.textOne) + .fontColor(Color.Orange) + .width(200) + .height(200) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater012.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f1e36fb1bae157b6d2c2294d3ffde67bfc42ec5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater012.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 { AttributeUpdater } from '@kit.ArkUI'; +import { DrawableDescriptor } from '@kit.ArkUI' +import { image } from '@kit.ImageKit'; + +/* + 自定义class实现text的AttributeModifier接口,用于初始化 +*/ +export class TextModifier extends AttributeUpdater { + textSize: number = 12; + + constructor(textSize: number) { + super(); + this.textSize = textSize; + } + + applyNormalAttribute(instance: TextAttribute): void { + instance.fontSize(this.textSize); + instance.fontColor(Color.Orange); + instance.textAlign(TextAlign.Center); + instance.border({ width: 1, color: Color.Orange, style: BorderStyle.Solid }); + instance.margin({ right: 10 }); + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater009 { + controller: TextController | null = null; + @State textOneContent: string | Resource | null = null; + @State imageSrc: PixelMap | ResourceStr | DrawableDescriptor = ('icon.png'); + //接受外部传入的AttributeModifier类实例,可以只定制部分组件,选择性传入参数。 + @State textOne: AttributeUpdater = new TextModifier(30); + + build() { + Row() { + Column() { + Button('change span') + .id('change') + .onClick(() => { + this.textOne.updateConstructorParams('Updated') + }) + + Text(this.textOneContent, { controller: this.controller }) + .id('UIComponentTextCommonItscaAttributeUpdater009') + .attributeModifier(this.textOne) + .fontColor(Color.Orange) + .width(200) + .height(200) + .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/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater013.ets new file mode 100644 index 0000000000000000000000000000000000000000..8352a5f4170be9ff6042b4385fd2c2c477af8ad1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater013.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 { AttributeUpdater } from '@kit.ArkUI'; + +class MySpanModifier extends AttributeUpdater { + initializeModifier(instance: SpanAttribute) { + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater013 { + private modifier: MySpanModifier = new MySpanModifier() + + build() { + Row() { + Column() { + Text() { + Span('this is span') + .attributeModifier(this.modifier) + .onClick(event => { + this.modifier.updateConstructorParams("span content has changed") + }) + } + .id('UIComponentTextCommonItscaAttributeUpdater013_text') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater014.ets new file mode 100644 index 0000000000000000000000000000000000000000..904027f1faad06f7aebadbbddaeb02428be1fad6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater014.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { AttributeUpdater } from '@kit.ArkUI'; + +export class ImageModifier extends AttributeUpdater { + width: number = 60; + height: number = 60; + + constructor(width: number, height: number) { + super(); + this.width = width; + this.height = height + } + + applyNormalAttribute(instance: ImageAttribute): void { + instance.width(this.width); + instance.height(this.height); + } +} + +/* + 自定义class实现text的AttributeModifier接口,用于初始化 +*/ +export class TextModifier extends AttributeUpdater { + textSize: number = 12; + + constructor(textSize: number) { + super(); + this.textSize = textSize; + } + + applyNormalAttribute(instance: TextAttribute): void { + instance.fontSize(this.textSize); + instance.fontColor(Color.Orange); + instance.textAlign(TextAlign.Center); + instance.border({ width: 1, color: Color.Orange, style: BorderStyle.Solid }); + instance.margin({ right: 10 }); + } +} + +@Entry +@Component +struct UIComponentTextCommonItscaAttributeUpdater014 { + @State textOneContent: string | Resource = 'default'; + @State imageSrc: PixelMap | ResourceStr | DrawableDescriptor = ('icon.png'); + //接受外部传入的AttributeModifier类实例,可以只定制部分组件,选择性传入参数。 + @State textOne: AttributeUpdater = new TextModifier(30); + @State imageModifier: AttributeUpdater = new ImageModifier(60, 60); + + build() { + Row() { + Column() { + + Button('change image') + .id('change1') + .onClick(() => { + this.imageSrc = ('cat.jpg'); + this.textOne.attribute?.backgroundImage('cat.jpg'); + }) + + Button('change image') + .id('change2') + .onClick(() => { + this.imageSrc = ('cat.jpg'); + this.textOne.attribute?.backgroundImage('image2.png'); + }) + + Text(this.textOneContent) + .id('UIComponentTextCommonItscaAttributeUpdater014') + .backgroundImage('icon.png') + .attributeModifier(this.textOne) + .fontColor(Color.Orange) + .width(200) + .height(200) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc81795f4680f08844fa69af310c03f018bc2824 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0030.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 UIComponentTextHyperlinkInteraction0030 { + build() { + Column() { + Hyperlink('https://example.com/') { + } + .id('UIComponentTextHyperlinkInteraction0030_001') + .color(Color.Blue) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b2d62cff656f8f4c82f20e3ad4ab43d2a9e04a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0040.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 UIComponentTextHyperlinkInteraction0040 { + build() { + Column() { + Hyperlink('https://example.com/') { + } + .id('UIComponentTextHyperlinkInteraction0040_001') + .color(Color.Blue) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..c315cf882ce352066b3f04e741858d2d8e00e9e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0080.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 UIComponentTextHyperlinkInteraction0080 { + build() { + Column() { + Hyperlink('https://example.com/') { + } + .id('UIComponentTextHyperlinkInteraction0080_001') + .color(Color.Blue) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..b15a206116f5ec6cc71d91cb6f44959e841c290e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0090.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 UIComponentTextHyperlinkInteraction0090 { + build() { + Column() { + Hyperlink('https://example.com/') { + } + .id('UIComponentTextHyperlinkInteraction0090_001') + .color(Color.Blue) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextImagePrivacySensitive/UIComponentTextImagePrivacySensitive001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextImagePrivacySensitive/UIComponentTextImagePrivacySensitive001.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ca0a7c30a8980482e9dd73d74622ad781376b95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextImagePrivacySensitive/UIComponentTextImagePrivacySensitive001.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 UIComponentTextImagePrivacySensitive001 { + build() { + Row() { + Column() { + Text("这是一段测试文字") + .privacySensitive(true) + .margin({top :30}) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..45a51d9538b979f79fd2bb8fff0e83b99e3a26f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0010.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 UIComponentTextInline0010 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0010_001') + .style(TextInputStyle.Inline) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..9df7b6fe3c1c52f70b111fe97852195ab3c67926 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0020.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 UIComponentTextInline0020 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0020_001') + .style(TextInputStyle.Inline) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..443a7103551655f0f98130c67437a2f0e5ac573e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0030.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 UIComponentTextInline0030 { + @State currentDirection: Direction = Direction.Auto; + + private toggleDirection() { + switch (this.currentDirection) { + case Direction.Auto: + this.currentDirection = Direction.Ltr; + break; + case Direction.Ltr: + this.currentDirection = Direction.Rtl; + break; + case Direction.Rtl: + this.currentDirection = Direction.Auto; + break; + default: + this.currentDirection = Direction.Auto; + break; + } + } + + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0030_001') + .style(TextInputStyle.Inline) + .width('70%') + .direction(this.currentDirection) + Button('切换') + .id('UIComponentTextInline0030_002') + .onClick(() => { + this.toggleDirection(); + }) + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..58f53da20e33f9dbf82c14f6e34f3d8905ce6956 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0060.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 UIComponentTextInline0060 { + build() { + Column() { + TextInput({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0060_001') + .style(TextInputStyle.Inline) + .width('70%') + .minFontSize(4) + .maxFontSize(40) + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c12fd9ec71b4baca4236fc13ea9d95c40552d29 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0070.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 UIComponentTextInline0070 { + build() { + Column() { + TextArea({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0070_001') + .style(TextContentStyle.INLINE) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..b652fc32f3134e77a8f633e45959009187ac6bef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0080.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 UIComponentTextInline0080 { + build() { + Column() { + TextArea({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0080_001') + .style(TextContentStyle.INLINE) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..cdae37f1f54d12e0d4569242297df495bd597dac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0090.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 UIComponentTextInline0090 { + @State currentDirection: Direction = Direction.Auto; + + private toggleDirection() { + switch (this.currentDirection) { + case Direction.Auto: + this.currentDirection = Direction.Ltr; + break; + case Direction.Ltr: + this.currentDirection = Direction.Rtl; + break; + case Direction.Rtl: + this.currentDirection = Direction.Auto; + break; + default: + this.currentDirection = Direction.Auto; + break; + } + } + + build() { + Column() { + TextArea({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0090_001') + .style(TextContentStyle.INLINE) + .width('70%') + .direction(this.currentDirection) + Button('切换') + .id('UIComponentTextInline0090_002') + .onClick(() => { + this.toggleDirection(); + }) + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..a4f9be0618de3d1cb9055355118f988c50791432 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0120.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 UIComponentTextInline0120 { + build() { + Column() { + TextArea({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0120_001') + .style(TextContentStyle.INLINE) + .minFontSize(4) + .maxFontSize(40) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b9857ce9a7be9c4cd62edfb3c7b9c31f4f3256d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInline/UIComponentTextInline0130.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 UIComponentTextInline0130 { + build() { + Column() { + TextArea({ + text: 'This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu.' + }) + .id('UIComponentTextInline0130_001') + .style(TextContentStyle.INLINE) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInput/UIComponentTextInput0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInput/UIComponentTextInput0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..c134f525008545ee4f2926eee109ee6f0418b28c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInput/UIComponentTextInput0010.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. + */ +import { uiAppearance } from '@kit.ArkUI' + + +@Entry +@Component +struct UIComponentTextInput0010 { + @State message: string = 'Hello' + + build() { + Row() { + Column() { + TextInput() + .type(InputType.Password) + Button('change to light') + .id('button1') + .onClick(async () => { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }) + }) + Button('change to dark') + .id('button2') + .onClick(async () => { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, () => { + }) + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..904ee30d79b1ae955c269dd03dd815aa9a354051 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0010.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 UIComponentTextInputNumberDecimal0010 { + + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0010') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0010_1') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0010_2') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8a6ce02254dca3403304e1110e7b2a2ce41bee4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0020.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 UIComponentTextInputNumberDecimal0020 { + + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0020') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e82a5a6679c41e74b8285c3a08005812227ed90 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0030.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 UIComponentTextInputNumberDecimal0030 { + + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0030') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a04fa34bf53f1b461c65c789448e30bfc5cc707 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0040.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 UIComponentTextInputNumberDecimal0040 { + + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0040') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..5919466559c6522035c96ced032bf8eec3b74e9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0050.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 UIComponentTextInputNumberDecimal0050 { + + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0050_1') + .margin(2) + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0050') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..354882b130c9d79a8d7fed38eb03a2262bf6bd38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0060.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 UIComponentTextInputNumberDecimal0060 { + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0060_1') + .margin(2) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0060') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + .inputFilter('[0-9.]') + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebad7464db86ecfa17ee73f0781c5013c0e6109e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0070.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 UIComponentTextInputNumberDecimal0070 { + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_1') + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_2') + .type(InputType.Password) + .inputFilter('[0-9.]') + .showPassword(true) + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_3') + .type(InputType.Number) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_4') + .type(InputType.Email) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_5') + .type(InputType.PhoneNumber) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_6') + .type(InputType.USER_NAME) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_7') + .type(InputType.NEW_PASSWORD) + .showPassword(true) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_8') + .type(InputType.NUMBER_PASSWORD) + .showPassword(true) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_9') + .type(InputType.SCREEN_LOCK_PASSWORD) + .showPassword(true) + .inputFilter('[0-9.]') + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0070_10') + .type(InputType.NUMBER_DECIMAL) + .inputFilter('[0-9.]') + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..177262c065f997833e8d5504e7e8f829bafb8e11 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0080.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 UIComponentTextInputNumberDecimal0080 { + build() { + Row() { + Column() { + TextInput() + .id('TextInputUIComponentTextInputNumberDecimal0080') + .type(InputType.Number) + .margin(2) + .inputFilter('[a-z]') + } + .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/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b6fc65bd0681b77966fee5309fadb32e2cc10b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0100.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 UIComponentTextInputNumberDecimal0100 { + build() { + Row() { + Column() { + TextInput({ + text:'abcdABC123.456哈哈' + }) + .id('TextInputUIComponentTextInputNumberDecimal0100') + .type(InputType.NUMBER_DECIMAL) + .margin(2) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba448d5de53290f09ea0b53498a22245758a0168 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0010.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 UIComponentTextInputSecurityKeyboardScroll0010 { + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0010') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..8e73955998d89792726196a21d12971a100bd91f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0020.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 UIComponentTextInputSecurityKeyboardScroll0020 { + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0020') + .type(InputType.SCREEN_LOCK_PASSWORD) + .margin(2) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d7888e2b1f451bb12364fe2887b7c5a28e28e62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0030.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 UIComponentTextInputSecurityKeyboardScroll0030 { + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0030') + .type(InputType.SCREEN_LOCK_PASSWORD) + .margin(2) + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0030_1') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1f94fd6dd6ccf4cbec566f3630f52cfaebd5df9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0040.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 UIComponentTextInputSecurityKeyboardScroll0040 { + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0040') + .type(InputType.SCREEN_LOCK_PASSWORD) + .margin(2) + .textAlign(TextAlign.Center) + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0040_1') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(TextAlign.Center) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..edc54c52172a857036f668d9b8c2dfb1395b9010 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0050.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 UIComponentTextInputSecurityKeyboardScroll0050 { + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0050') + .type(InputType.SCREEN_LOCK_PASSWORD) + .margin(2) + .textAlign(TextAlign.End) + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0050_1') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(TextAlign.End) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..1274ac95fe2cec61e6627ce3f815a3384a4cbdf2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0060.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 UIComponentTextInputSecurityKeyboardScroll0060 { + @State textAlign: number | undefined = TextAlign.Start + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0060') + .type(InputType.SCREEN_LOCK_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0060_1') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + Button() + .id('btnUIComponentTextInputSecurityKeyboardScroll0060') + .onClick(() => { + this.textAlign = TextAlign.End + }) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..532029760d97878de75e628c6fac6cedec7feac2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0070.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 UIComponentTextInputSecurityKeyboardScroll0070 { + @State textAlign: number | undefined = TextAlign.Start + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0070') + .margin(2) + .textAlign(this.textAlign) + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0070_1') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd32dc5698efa64feb677c6e7c7bed0bc6b3afd7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0080.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 UIComponentTextInputSecurityKeyboardScroll0080 { + @State textAlign: number | undefined = TextAlign.Start + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0080') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + .showPassword(true) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..d989657486d3a01a86c9b677ffbdd8acf044ca53 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0090.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 UIComponentTextInputSecurityKeyboardScroll0090 { + @State textAlign: number | undefined = TextAlign.Start + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0090') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + .showPassword(true) + .maxLength(9) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..9031a8d5def40852d6c9110c03f9471366018525 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0100.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 UIComponentTextInputSecurityKeyboardScroll0100 { + @State textAlign: number | undefined = TextAlign.Start + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0100') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + .showPassword(true) + .maxLength(20) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed336ac069f335478daa585bbf8126fe70ed1092 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0110.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 UIComponentTextInputSecurityKeyboardScroll0110 { + @State maxLength: number | undefined = 10; + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0110') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .showPassword(true) + .maxLength(20) + Button('change maxLength') + .id('btnUIComponentTextInputSecurityKeyboardScroll0110') + .onClick(() => { + this.maxLength = 5; + }) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..631e3a0bc8586371ac4761a14629e3d2ee58772e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0120.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 UIComponentTextInputSecurityKeyboardScroll0120 { + @State textAlign: number | undefined = TextAlign.Start + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0120') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + .showPassword(true) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..fbbd6da1474ba8e79729024034e0b215b9c4680b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0130.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 UIComponentTextInputSecurityKeyboardScroll0130 { + @State textAlign: number | undefined = TextAlign.Start + @State passWordSrc1: string = 'cat.jpg' + @State passWordSrc2: string = 'icon.png' + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0130') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + .width(500) + .passwordIcon({ onIconSrc: this.passWordSrc1, offIconSrc: this.passWordSrc2 }) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..43d9e4ddf2840d00c025c9611d3b72d69b18cbc5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0140.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 UIComponentTextInputSecurityKeyboardScroll0140 { + @State textAlign: number | undefined = TextAlign.Start + @State passWordSrc1: string = 'cat.jpg' + @State passWordSrc2: string = 'icon.png' + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0140') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .textAlign(this.textAlign) + .width(500) + } + .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/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..d45a60effb67660d93a453b503cda05f08e34931 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0150.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 UIComponentTextInputSecurityKeyboardScroll0150 { + @State textAlign: number | undefined = TextAlign.Start + @State passWordSrc1: string = 'cat.jpg' + @State passWordSrc2: string = 'icon.png' + + build() { + Row() { + Column() { + TextInput() + .id('UIComponentTextInputSecurityKeyboardScroll0150') + .type(InputType.NUMBER_PASSWORD) + .margin(2) + .padding(10) + .textAlign(this.textAlign) + } + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..43c2aeb40bb5c2b0299e991816d5586dc57522ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0200.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 { JSON } from '@kit.ArkTS'; + +@Entry +@Component +struct UIComponentTextReverseAnalysis0200 { + mutableStyledString: MutableStyledString = new MutableStyledString('哈' + '\uD83C\uDDe8\uD83C\uDDF3'+'哈', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange}) + }]); + @State msg : string = ''; + controller: TextController = new TextController(); + async onPageShow() { + this.controller.setStyledString(this.mutableStyledString); + } + build() { + Column() { + Button('insert') + .id('insert') + .onClick(()=>{ + this.mutableStyledString.insertString(1,'插入'); + this.controller.setStyledString(this.mutableStyledString); + this.msg = `${JSON.stringify(this.mutableStyledString.getStyles(3,4))}`; + }) + Text('', { controller: this.controller }) + .width('80%') + .height(60) + .id('UIComponentTextReverseAnalysis0200') + Text(this.msg) + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..bd47bc3b294933a10369b4897b5678dfa5bca4a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0300.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 UIComponentTextReverseAnalysis0300 { + build() { + Column() { + TextInput() + .id('UIComponentTextReverseAnalysis0300_001') + .enterKeyType(EnterKeyType.Search) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4f4a0abc2830c61d07b92c07370d88d2af5e561 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0350.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 UIComponentTextReverseAnalysis0350 { + build() { + Column() { + TextInput() + .id('UIComponentTextReverseAnalysis0350_001') + .hoverEffect(HoverEffect.Scale) + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d807fdbac2437cd998832c6b48e678ab5007f84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0390.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextReverseAnalysis0390 { + scroll: Scroller = new Scroller(); + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + this.buttonText = '点击'; + }, + onLongPress: () => { + this.buttonText = '长按'; + } + }); + mutableStyledString3: MutableStyledString = new MutableStyledString("hello", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + @State fontColor1: ResourceColor = Color.Red; + @State buttonText: string = ''; + controller3: TextController = new TextController(); + + async onPageShow() { + this.controller3.setStyledString(this.mutableStyledString3); + } + + build() { + Column() { + Scroll(this.scroll) { + Column({ space: 30 }) { + Text('触发事件:' + this.buttonText) + .fontSize(30) + .margin({ bottom: 100 }) + Text(undefined, { controller: this.controller3 }) + .fontSize(30) + .copyOption(CopyOptions.InApp) + .draggable(true) + .clip(true) + .id('UIComponentTextReverseAnalysis0390_001') + }.width('100%') + } + .expandSafeArea([SafeAreaType.KEYBOARD]) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .edgeEffect(EdgeEffect.None) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..b86d28df1f3080a995b0b8fc5ef2a3d045c3c689 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0400.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 UIComponentTextReverseAnalysis0400 { + @State phoneNumber: string = '(86) (755) ********'; + @State url: string = 'www.fda.com'; + @State email: string = '***@example.com'; + @State address: string = 'XX省XX市XX区XXXX'; + @State datetime: string = 'XX年XX月XX日XXXX'; + @State enableDataDetector: boolean = true; + @State types: TextDataDetectorType[] = []; + @State text: string = ''; + + build() { + Row() { + Column() { + Text('触发事件:' + this.text) + Text() { + Span('电话号码:' + this.phoneNumber + '\n' + + '链接:' + this.url + '\n' + + '邮箱:' + this.email + '\n' + + '地址:' + this.address + '\n' + + '时间:' + this.datetime,) + .onClick(() => { + this.text = '点击'; + }) + ImageSpan($r('app.media.icon')) + .width('100px') + .height('100px') + .objectFit(ImageFit.Fill) + .verticalAlign(ImageSpanAlignment.CENTER) + } + .id('UIComponentTextReverseAnalysis0400_001') + .fontSize(16) + .copyOption(CopyOptions.None) + .enableDataDetector(this.enableDataDetector) + .dataDetectorConfig({ + types: this.types, onDetectResultUpdate: (result: string) => { + } + }) + .textAlign(TextAlign.Center) + .borderWidth(1) + .padding(10) + .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/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..7296453a877f05b2cbddbcef7e29d74153a20c06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0410.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 UIComponentTextReverseAnalysis0410 { + @State phoneNumber: string = '(86) (755) ********'; + @State url: string = 'www.fda.com'; + @State email: string = '***@example.com'; + @State address: string = 'XX省XX市XX区XXXX'; + @State datetime: string = 'XX年XX月XX日XXXX'; + @State enableDataDetector: boolean = true; + @State types: TextDataDetectorType[] = []; + @State text: string = ''; + + build() { + Row() { + Column() { + Text('触发事件:' + this.text) + Text() { + Span('电话号码:' + this.phoneNumber + '\n' + + '链接:' + this.url + '\n' + + '邮箱:' + this.email + '\n' + + '地址:' + this.address + '\n' + + '时间:' + this.datetime,) + .onClick(() => { + this.text = '点击'; + }) + ImageSpan($r('app.media.icon')) + .width('100px') + .height('100px') + .objectFit(ImageFit.Fill) + .verticalAlign(ImageSpanAlignment.CENTER) + } + .id('UIComponentTextReverseAnalysis0410_001') + .fontSize(16) + .copyOption(CopyOptions.InApp) + .enableDataDetector(this.enableDataDetector) + .dataDetectorConfig({ + types: this.types, onDetectResultUpdate: (result: string) => { + } + }) + .textAlign(TextAlign.Center) + .borderWidth(1) + .padding(10) + .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/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b52db4c78f9e23c8201086fb12975127fd4a0f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0420.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextReverseAnalysis0420 { + scroll: Scroller = new Scroller(); + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + this.buttonText = '点击'; + }, + onLongPress: () => { + this.buttonText = '长按'; + } + }); + mutableStyledString3: MutableStyledString = new MutableStyledString("hello", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + @State fontColor1: ResourceColor = Color.Red; + @State buttonText: string = ''; + controller3: TextController = new TextController(); + + async onPageShow() { + this.controller3.setStyledString(this.mutableStyledString3); + } + + build() { + Column() { + Scroll(this.scroll) { + Column({ space: 30 }) { + Text('触发事件:' + this.buttonText) + .fontSize(30) + .margin({ bottom: 100 }) + Text(undefined, { controller: this.controller3 }) + .fontSize(30) + .copyOption(CopyOptions.InApp) + .draggable(true) + .clip(true) + .id('UIComponentTextReverseAnalysis0420_001') + }.width('100%') + } + .expandSafeArea([SafeAreaType.KEYBOARD]) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .edgeEffect(EdgeEffect.None) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..1651829f3d8ba4f1bfb7e29607b98e8b2600d4f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0430.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentTextReverseAnalysis0430 { + scroll: Scroller = new Scroller(); + fontStyleAttr1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + this.buttonText = '点击'; + }, + onLongPress: () => { + this.buttonText = '长按'; + } + }); + mutableStyledString3: MutableStyledString = new MutableStyledString("hello", [{ + start: 0, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + @State fontColor1: ResourceColor = Color.Red; + @State buttonText: string = ''; + controller3: TextController = new TextController(); + + async onPageShow() { + this.controller3.setStyledString(this.mutableStyledString3); + } + + build() { + Column() { + Scroll(this.scroll) { + Column({ space: 30 }) { + Text('触发事件:' + this.buttonText) + .fontSize(30) + .margin({ bottom: 100 }) + Text(undefined, { controller: this.controller3 }) + .fontSize(30) + .copyOption(CopyOptions.InApp) + .draggable(true) + .clip(true) + .id('UIComponentTextReverseAnalysis0430_001') + }.width('100%') + } + .expandSafeArea([SafeAreaType.KEYBOARD]) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .edgeEffect(EdgeEffect.None) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0480.ets new file mode 100644 index 0000000000000000000000000000000000000000..97d427c5cd114465c5818c30d093480ca7d8533e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0480.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 UIComponentTextReverseAnalysis0480 { + build() { + Column() { + TextInput() + .id('UIComponentTextReverseAnalysis0480_001') + .width('70%') + Button('按钮') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0490.ets new file mode 100644 index 0000000000000000000000000000000000000000..716a50b5928e89c63f16ae677bec27234f4c5355 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0490.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 UIComponentTextReverseAnalysis0490 { + build() { + Column() { + TextInput() + .id('UIComponentTextReverseAnalysis0490_001') + .width('70%') + TextInput() + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..41117c0be800e6c10ce6d98aaccf89627f2756ad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0500.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 UIComponentTextReverseAnalysis0500 { + build() { + Column() { + Button('按钮') + .id('UIComponentTextReverseAnalysis0500_001') + TextInput() + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..b467ff386bc5788465cddab236206aeb58352f75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0510.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 UIComponentTextReverseAnalysis0510 { + build() { + Column() { + TextInput() + .id('UIComponentTextReverseAnalysis0510_001') + .width('70%') + Button('按钮') + TextInput() + .width('70%') + }.width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..918fac5bf7e52f5730a0101b4b9c488fbf41ff0a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0010.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 UIComponentTextTextAreaAction0010 { + build() { + Column(){ + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0010') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..b06476286c1d6d7eab3609d73ecf84768b205039 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0020.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 UIComponentTextTextAreaAction0020 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0020') + .fontSize(20) + } + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..231c7b5ec7866cc167d6dccf7ac60a72b50b9318 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0030.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 UIComponentTextTextAreaAction0030 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0030') + .fontSize(20) + } + .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/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..9548e176936215c468725c365cd8a68b014a1498 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0040.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 UIComponentTextTextAreaAction0040 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0040') + .fontSize(20) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0040_1') + .fontSize(20) + } + .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/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..4cdb8409fa2d972c842fc2578d607480acd8560a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0070.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 UIComponentTextTextAreaAction0070 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0070') + .fontSize(20) + } + .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/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd269668f5d36c4526b917992be1724d0b0545c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0080.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 UIComponentTextTextAreaAction0080 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0080') + .fontSize(20) + } + .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/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..c6d8051093b5e7f545a49803c17d4d9700490d20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0090.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 UIComponentTextTextAreaAction0090 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0090') + .fontSize(20) + } + .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/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..bae1dd968b9530e1ee7a04a99b15938e85ad6887 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0100.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 UIComponentTextTextAreaAction0100 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0100') + .fontSize(20) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaAction0100_1') + .fontSize(20) + } + .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/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..00526b17f38831576be24a0e168477952158bd44 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0110.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 UIComponentTextTextAreaAction0110 { + controller: TextAreaController = new TextAreaController(); + @State msg: string = '当前行数为:' + + build() { + Column({ space: 20 }) { + TextArea({ controller: this.controller }) + .width('70%') + .id('TextTextAreaAction0110') + .fontSize(20) + + Text(this.msg) + .width('70%') + .id('TextTextAreaAction0110_1') + .enabled(true) + .fontSize(20) + .onClick(() => { + this.msg += this.controller.getTextContentLineCount(); + }) + } + .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/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances0900.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances0900.ets new file mode 100644 index 0000000000000000000000000000000000000000..0fae3582334ceafabb7d74afc5b6721b6ba629e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances0900.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 UIComponentTextTextAreaEnhances0900 { + build() { + Column() { + TextArea() + .width('auto') + .id('TextAreaUIComponentTextTextAreaEnhances0900') + .fontSize(20) + .textAlign(TextAlign.JUSTIFY) + } + .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/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances2500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances2500.ets new file mode 100644 index 0000000000000000000000000000000000000000..b5cb6dd8efb7325c5991364ce6fd40b2450696e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances2500.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 UIComponentTextTextAreaEnhances2500 { + build() { + Column() { + TextArea() + .width('auto') + .id('TextAreaUIComponentTextTextAreaEnhances2500') + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..a86e61d9f8520fe506631046fc528f72e3391e13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0010.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 UIComponentTextTextAreaEnterkeyType0010 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0010') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('设置enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0010') + .onClick(() => { + this.enterKeyType = EnterKeyType.Done; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0016.ets new file mode 100644 index 0000000000000000000000000000000000000000..10876a51d014a2ab8952fd292bb80aef43721f95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0016.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 UIComponentTextTextAreaEnterkeyType0016 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0016') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('设置enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0016') + .onClick(() => { + this.enterKeyType = EnterKeyType.NEW_LINE; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b64220e499334d8aae4a60878c0bcd42e3a18e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0020.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 UIComponentTextTextAreaEnterkeyType0020 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0020') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('设置enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0020') + .onClick(() => { + this.enterKeyType = EnterKeyType.Go; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..695dcd6b6e26256f09740ed4d2b7cb0ab4da87cb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0030.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 UIComponentTextTextAreaEnterkeyType0030 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0030') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('设置enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0030') + .onClick(() => { + this.enterKeyType = EnterKeyType.Search; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..db16a7d77dbc291cf6bcdbd695fcd51961ab3b46 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0040.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 UIComponentTextTextAreaEnterkeyType0040 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0040') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('设置enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0040') + .onClick(() => { + this.enterKeyType = EnterKeyType.Send; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..6888251deb468d6f1ccb7840f8d3b34956c1f783 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0050.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 UIComponentTextTextAreaEnterkeyType0050 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0050') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('设置enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0050') + .onClick(() => { + this.enterKeyType = EnterKeyType.Next; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..a44772d8895cb8f18db65c30970f20ed6afbbda4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0060.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 UIComponentTextTextAreaEnterkeyType0060 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0060') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('设置enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0060') + .onClick(() => { + this.enterKeyType = EnterKeyType.PREVIOUS; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..df431dc682609e9e39503fa29f2516f40e68556b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0080.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 UIComponentTextTextAreaEnterkeyType0080 { + @State enterKeyType: EnterKeyType | undefined = undefined; + + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0080') + .fontSize(20) + .enterKeyType(this.enterKeyType) + Button('还原enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0080') + .onClick(() => { + this.enterKeyType = undefined; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..32322fbe50ee8865e86ce76a6610ed4dd5032ba4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0090.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 UIComponentTextTextAreaEnterkeyType0090 { + @State enterKeyType: EnterKeyType | undefined = undefined; + @State text: string | undefined = undefined; + @State text1: string | undefined = undefined; + + build() { + Column() { + Text(this.text) + Text(this.text1) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0090') + .fontSize(20) + .enterKeyType(this.enterKeyType) + .onSubmit(() => { + if (this.enterKeyType = EnterKeyType.Go) { + this.text = this.enterKeyType.toString(); + } else { + this.text1 = JSON.stringify(this.enterKeyType); + } + }) + Button('设置enterKey为Go') + .id('btnUIComponentTextTextAreaEnterkeyType0090') + .onClick(() => { + this.enterKeyType = EnterKeyType.Go; + }) + Button('还原enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0090_1') + .onClick(() => { + this.enterKeyType = undefined; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c1f900afcc54bbb3d23163dba169629922b107d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0100.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 UIComponentTextTextAreaEnterkeyType0100 { + @State enterKeyType: EnterKeyType | undefined = undefined; + @State text: string | undefined = undefined; + @State text1: string | undefined = undefined; + + build() { + Column() { + Text(this.text) + Text(this.text1) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0100') + .fontSize(20) + .enterKeyType(this.enterKeyType) + .onSubmit(() => { + if (this.enterKeyType = EnterKeyType.Go) { + this.text = this.enterKeyType.toString(); + } else { + this.text1 = JSON.stringify(this.enterKeyType); + } + }) + Button('设置enterKey为Go') + .id('btnUIComponentTextTextAreaEnterkeyType0100') + .onClick(() => { + this.enterKeyType = EnterKeyType.Go; + }) + Button('还原enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0100_1') + .onClick(() => { + this.enterKeyType = undefined; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d2107c217e332f6984861dce5956b2a9e3e0423 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0110.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 UIComponentTextTextAreaEnterkeyType0110 { + @State enterKeyType: EnterKeyType | undefined = undefined; + @State text: string | undefined = undefined; + @State text1: string | undefined = undefined; + + build() { + Column() { + Text(this.text) + Text(this.text1) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0110') + .fontSize(20) + .enterKeyType(this.enterKeyType) + .style(TextContentStyle.INLINE) + .onSubmit(() => { + if (this.enterKeyType = EnterKeyType.Go) { + this.text = this.enterKeyType.toString(); + } else { + this.text1 = JSON.stringify(this.enterKeyType); + } + }) + Button('设置enterKey为Go') + .id('btnUIComponentTextTextAreaEnterkeyType0110') + .onClick(() => { + this.enterKeyType = EnterKeyType.Go; + }) + Button('还原enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0110_1') + .onClick(() => { + this.enterKeyType = undefined; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..ab7234d26da75640f8db2c527acbff2fb225d830 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0120.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 UIComponentTextTextAreaEnterkeyType0120 { + @State enterKeyType: EnterKeyType | undefined = undefined; + @State text: string | undefined = undefined; + @State text1: string | undefined = undefined; + + build() { + Column() { + Text(this.text) + Text(this.text1) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0120') + .fontSize(20) + .enterKeyType(this.enterKeyType) + .style(TextContentStyle.DEFAULT) + .onSubmit(() => { + if (this.enterKeyType = EnterKeyType.Go) { + this.text = this.enterKeyType.toString(); + } else { + this.text1 = JSON.stringify(this.enterKeyType); + } + }) + Button('设置enterKey为Go') + .id('btnUIComponentTextTextAreaEnterkeyType0120') + .onClick(() => { + this.enterKeyType = EnterKeyType.Go; + }) + Button('还原enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0120_1') + .onClick(() => { + this.enterKeyType = undefined; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..c96e68c06331c34d624baebaaafc46d6611edf23 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0130.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 UIComponentTextTextAreaEnterkeyType0130 { + @State enterKeyType: EnterKeyType | undefined = undefined; + @State text: string | undefined = undefined; + @State text1: string | undefined = undefined; + + build() { + Column() { + Text(this.text) + Text(this.text1) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0130') + .fontSize(20) + .enterKeyType(this.enterKeyType) + .style(TextContentStyle.DEFAULT) + .onSubmit(() => { + if (this.enterKeyType = EnterKeyType.Go) { + this.text = this.enterKeyType.toString(); + } else { + this.text1 = JSON.stringify(this.enterKeyType); + } + }) + Button('设置enterKey为Go') + .id('btnUIComponentTextTextAreaEnterkeyType0130') + .onClick(() => { + this.enterKeyType = EnterKeyType.Go; + }) + Button('还原enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0130_1') + .onClick(() => { + this.enterKeyType = undefined; + }) + } + .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/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fb262cd1cd87087bc3ebfad2bd9e0661aad84b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0140.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 UIComponentTextTextAreaEnterkeyType0140 { + @State enterKeyType: EnterKeyType | undefined = undefined; + @State text: string | undefined = undefined; + @State text1: string | undefined = undefined; + + build() { + Column() { + Text(this.text) + Text(this.text1) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEnterkeyType0140') + .fontSize(20) + .enterKeyType(this.enterKeyType) + .style(TextContentStyle.DEFAULT) + .onSubmit(() => { + if (this.enterKeyType = EnterKeyType.Go) { + this.text = this.enterKeyType.toString(); + } else { + this.text1 = JSON.stringify(this.enterKeyType); + } + }) + Button('设置enterKey为Go') + .id('btnUIComponentTextTextAreaEnterkeyType0140') + .onClick(() => { + this.enterKeyType = EnterKeyType.Go; + }) + Button('还原enterKey') + .id('btnUIComponentTextTextAreaEnterkeyType0140_1') + .onClick(() => { + this.enterKeyType = undefined; + }) + } + .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/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..7c8ea808adc7dc173a29ce0f44a8e520f9409125 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0130.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 mediaquery from '@ohos.mediaquery'; +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +let portraitFunc = null; +@Entry +@Component +struct UIComponentTextTextAreaEvaSaveInputMethod0130 { + @State enterKeyType: EnterKeyType | undefined = undefined; + listener = mediaquery.matchMediaSync('(orientation: 横屏)'); + onPortrait() { + } + + aboutToAppear() { + // 绑定当前应用实例 + portraitFunc = this.onPortrait.bind(this); + // 绑定回调函数 + this.listener.on('change', portraitFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context = getContext(this) as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + build() { + Column() { + Scroll(){ + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEvaSaveInputMethod0130') + .fontSize(20) + .enterKeyType(this.enterKeyType) + } + Button('切换横竖屏') + .id('btnUIComponentTextTextAreaEvaSaveInputMethod0130') + .onClick(() => { + this.changeOrientation(true); + }) + } + .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/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..d1ff6ffab582a6f895ac8bfd03fdbf82b55bb291 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0140.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 mediaquery from '@ohos.mediaquery'; +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +let portraitFunc = null; +@Entry +@Component +struct UIComponentTextTextAreaEvaSaveInputMethod0140 { + @State enterKeyType: EnterKeyType | undefined = undefined; + listener = mediaquery.matchMediaSync('(orientation: 横屏)'); + onPortrait() { + } + + aboutToAppear() { + // 绑定当前应用实例 + portraitFunc = this.onPortrait.bind(this); + // 绑定回调函数 + this.listener.on('change', portraitFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context = getContext(this) as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + build() { + Column() { + Button('切换横竖屏') + .id('btnUIComponentTextTextAreaEvaSaveInputMethod0140') + .onClick(() => { + this.changeOrientation(true); + }) + .margin({ + top:400 + }) + Scroll(){ + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEvaSaveInputMethod0140') + .fontSize(20) + .enterKeyType(this.enterKeyType) + } + } + .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/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..1335ae488d764485d7f1853e12418a6ef891d286 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0150.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 mediaquery from '@ohos.mediaquery'; +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +let portraitFunc = null; +@Entry +@Component +struct UIComponentTextTextAreaEvaSaveInputMethod0150 { + @State enterKeyType: EnterKeyType | undefined = undefined; + listener = mediaquery.matchMediaSync('(orientation: 横屏)'); + onPortrait() { + } + + aboutToAppear() { + // 绑定当前应用实例 + portraitFunc = this.onPortrait.bind(this); + // 绑定回调函数 + this.listener.on('change', portraitFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context = getContext(this) as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + build() { + Column() { + Button('切换横竖屏') + .id('btnUIComponentTextTextAreaEvaSaveInputMethod0150') + .onClick(() => { + this.changeOrientation(true); + }) + .margin({ + top:700 + }) + Scroll(){ + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaEvaSaveInputMethod0150') + .fontSize(20) + .enterKeyType(this.enterKeyType) + } + } + .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/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..4ec39f7eb659ba1a9b6b46597a5b214a0a1b9b25 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0010.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 UIComponentTextTextAreaInterAction0010 { + build() { + Column() { + TextArea() + .width('100%') + .id('TextAreaUIComponentTextTextAreaInterAction0010') + .type(TextAreaType.NORMAL) + .maxLines(1) + .copyOption(CopyOptions.InApp) + } + .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/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d215203e43c683202c4df3c445a64d280cdc88d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0030.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 UIComponentTextTextAreaInterAction0030 { + build() { + Column() { + TextArea() + .width('100%') + .id('TextAreaUIComponentTextTextAreaInterAction0030') + .type(TextAreaType.NORMAL) + .maxLines(1) + .copyOption(CopyOptions.InApp) + } + .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/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..9af9e49ce7c3fe854608f5a1209ff48effee07b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0040.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 UIComponentTextTextAreaInterAction0040 { + build() { + Column() { + TextArea() + .width('100%') + .id('TextAreaUIComponentTextTextAreaInterAction0040') + .type(TextAreaType.NORMAL) + .maxLines(1) + .copyOption(CopyOptions.InApp) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..12632aa2959542a83d4641f9fbadc4ff56dcd639 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0010.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 UIComponentTextTextAreaInterActive0010 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0010') + .type(TextAreaType.NORMAL) + .maxLines(1) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..f5f750d094c6226cb03a357a1dd8b865df95ff02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0020.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 UIComponentTextTextAreaInterActive0020 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0020') + .style(TextContentStyle.INLINE) + .maxLines(1) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..824f76a540bcd571a6e27ed75645254abc8cbc7b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0030.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 UIComponentTextTextAreaInterActive0030 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0030') + .style(TextContentStyle.INLINE) + .maxLines(5) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..7084b57f8e05b5aa136069a538721c45e1b4769a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0040.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 UIComponentTextTextAreaInterActive0040 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0040') + .selectionMenuHidden(false) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..26d7f1c88e657fd62de4b07d35d14ea3f8bfcef3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0050.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 UIComponentTextTextAreaInterActive0050 { + build() { + Column() { + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0050') + .selectionMenuHidden(true) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba7ae09292299d9fb914fa2ecda07f01c2d566d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0060.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 UIComponentTextTextAreaInterActive0060 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0060') + Button('change caret') + .id('btnTextAreaUIComponentTextTextAreaInterActive0060') + .onClick(() => { + this.controller.caretPosition(10) + }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee9f89917b0f167c7cf035297c859d0d6af13b6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0070.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 UIComponentTextTextAreaInterActive0070 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0070') + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae55f56c6401993496c23fcf8c7e143e86dd25f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0300.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 UIComponentTextTextAreaInterActive0300 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0300') + .maxLength(110) + .showCounter(true, { thresholdPercentage: 100, highlightBorder: true }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..bcda17d72846a2123c9215f08dd20066cc360c23 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0320.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 UIComponentTextTextAreaInterActive0320 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0320') + .maxLength(110) + .showCounter(true, { thresholdPercentage: 100, highlightBorder: true }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..56c9a29ee6048254b4ae1155d964c530026a10b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0330.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 UIComponentTextTextAreaInterActive0330 { + controller: TextAreaController = new TextAreaController() + @State text: string = '' + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0330') + .inputFilter('[hello world]', (e) => { + console.log(JSON.stringify(e)) + }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..bfb916b28987e47b041f171de6f8a99835e98ab8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0340.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 UIComponentTextTextAreaInterActive0340 { + controller: TextAreaController = new TextAreaController() + @State text: string = '' + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0340') + .inputFilter('[hello]', (e) => { + console.log(JSON.stringify(e)) + }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..f945edd0fd6d7ea94566a743f4157d874c3d7ebb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0350.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 UIComponentTextTextAreaInterActive0350 { + controller: TextAreaController = new TextAreaController() + @State text: string = '' + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0350') + .inputFilter('大家好', (e) => { + console.log(JSON.stringify(e)) + }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..87cf3c626e62d4011cad6f80f0513e590cbd07dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0360.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 UIComponentTextTextAreaInterActive0360 { + controller: TextAreaController = new TextAreaController() + @State text: string = '' + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0360') + .inputFilter('大家好大家好', (e) => { + console.log(JSON.stringify(e)) + }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ca2707913d09de15ce696e3fe46c27de260d1eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0370.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 UIComponentTextTextAreaInterActive0370 { + controller: TextAreaController = new TextAreaController() + @State text: string = '' + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0370') + .inputFilter('[abc_ABC@#*/?]', (e) => { + console.log(JSON.stringify(e)) + }) + } + .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/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f21e1831d460be377af1b2b5dbd195d622e173e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0380.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 UIComponentTextTextAreaInterActive0380 { + controller: TextAreaController = new TextAreaController() + @State text: string = '' + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterActive0380') + .inputFilter('[大家好_hello]', (e) => { + console.log(JSON.stringify(e)) + }) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0670.ets new file mode 100644 index 0000000000000000000000000000000000000000..901bfc7f74ba9284a6c7f4593dfe21791365ed50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0670.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 UIComponentTextTextAreaInterface0670 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0670') + .caretColor('#ff00ff') + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0680.ets new file mode 100644 index 0000000000000000000000000000000000000000..09da0fd354a2872a93426d6ab3b88417f1641b60 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0680.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 UIComponentTextTextAreaInterface0680 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0680') + .caretColor(Color.Pink) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0690.ets new file mode 100644 index 0000000000000000000000000000000000000000..bbbeabacb70be858ba974c411e620a9be9e05875 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0690.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 UIComponentTextTextAreaInterface0690 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0690') + .caretColor(0xffc0cb) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0700.ets new file mode 100644 index 0000000000000000000000000000000000000000..264aa188fde82eb14a230cb3f2e81fc9de8a282f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0700.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 UIComponentTextTextAreaInterface0700 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0700') + .caretColor(getContext().resourceManager.getColorSync($r('app.color.color_0x800080'))) + .caretStyle({ + width:5 + }) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0710.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6dbd78fb05bba820b8fd57f98c72cd128729ee3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0710.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 UIComponentTextTextAreaInterface0710 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0710') + .caretColor('rgb(0,0,255)') + .caretStyle({ + width:5 + }) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0720.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bfb9ad0fa771d6d6a86a47d0d53db952ef560f7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0720.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 UIComponentTextTextAreaInterface0720 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0720') + .caretColor('rgba(0,255,0,1)') + .caretStyle({ + width:5 + }) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0730.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0730.ets new file mode 100644 index 0000000000000000000000000000000000000000..ffa107a2f2928fb0f58fac0ae33f9c4e8b38c92b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0730.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 UIComponentTextTextAreaInterface0730 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0730') + .caretColor('adad') + .caretStyle({ + width:5 + }) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0740.ets new file mode 100644 index 0000000000000000000000000000000000000000..fec22df5cc7b008e9d06a381bb9b0d382effcb58 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0740.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 UIComponentTextTextAreaInterface0740 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface0740') + .caretColor('rgba(0,255,0,1)') + .caretColor('rgb(0,0,255)') + .caretColor(getContext().resourceManager.getColorSync($r('app.color.color_0x800080'))) + .caretStyle({ + width:5 + }) + } + .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/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface1020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface1020.ets new file mode 100644 index 0000000000000000000000000000000000000000..830ce1700c92d9ef41ba1ed9c2304c9b76dd01e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface1020.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 UIComponentTextTextAreaInterface1020 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Text() + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaInterface1020') + .style(TextContentStyle.DEFAULT) + .caretStyle({ + width:5 + }) + } + .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/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f6048ff326ac1a7b7ef57e9a226d0b2ae57986c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0010.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 UIComponentTextTextAreaLayout0010 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .id('TextAreaUIComponentTextTextAreaLayout0010') + .caretColor('#ff00ff') + } + .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/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8d081efe939504aee4a2762a0875add400bc05d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0020.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 UIComponentTextTextAreaLayout0020 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .id('TextAreaUIComponentTextTextAreaLayout0020') + .caretColor('#ff00ff') + .width(400) + .height(200) + } + .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/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..793f8895f8ffcacaf6a4d0626593df4da9b621d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0090.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 UIComponentTextTextAreaOnEditChange0090 { + controller: TextAreaController = new TextAreaController(); + @State msg: string = '这是一个文本Text' + @State res: string = '' + + build() { + Column({ space: 20 }) { + Text(this.msg) + .draggable(true) + .enabled(true) + .id('TextAreaOnEditChange0090') + .fontSize(20) + .copyOption(CopyOptions.InApp) + TextArea({ text: 'get content: ', controller: this.controller }) + .width('80%') + .margin({ top: 30 }) + .height(200) + .draggable(true) + .id('TextAreaOnEditChange0090_1') + .fontSize(20) + .copyOption(CopyOptions.InApp) + .onEditChange((isEditing: boolean) => { + this.res = '从textarea外向textarea内拖拽,onEditChange 回调'; + }) + Text(this.res) + .fontSize(20).borderWidth(3).width('90%') + } + .width('100%').margin(20) + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..59b132345fce50bf4602a3701d08d166751d8ca9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0100.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 { text } from '@kit.ArkGraphics2D' + +@CustomDialog +@Component +struct CustomDialogExample { + controller?: CustomDialogController + cancel: () => void = () => { + } + confirm: () => void = () => { + } + + build() { + Column() { + TextInput({ placeholder: 'input' }).height(60).width('90%') + .id('UIComponentTextTextEvasiveInput001_input') + .onChange((value: string) => { + }) + }.borderRadius(10) + } +} + +@Entry +@Component +struct UIComponentTextTextAreaOnEditChange0100 { + @State text: string = ''; + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + this.onCancel() + }, + confirm: () => { + this.onAccept() + } + }), + cancel: this.exitApp, + autoCancel: true, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss() + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss() + } + }, + alignment: DialogAlignment.Center, + offset: { dx: 0, dy: -35 }, + 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() { + Text(this.text) + TextArea() + .id('UIComponentTextTextAreaOnEditChange0100_textArea') + .width(100) + .height(50) + .onEditChange(() => { + this.text = 'onEditChange + 1' + }) + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }) + .backgroundColor(0x317aff) + }.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/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..74691901e1066c38f10ba441a9c5f5eef83646bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0130.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 UIComponentTextTextAreaOnEditChange0130 { + controller: TextAreaController = new TextAreaController(); + @State msg: string = '这是一个文本TextArea|这是一个文本TextArea这是一个文本TextArea' + @State res: string = '' + + build() { + Column({ space: 20 }) { + TextArea({ text: this.msg, controller: this.controller }).width(300) + .draggable(true) + .id('TextAreaOnEditChange0130_1') + .copyOption(CopyOptions.InApp) + .fontSize(20) + TextArea({ text: 'get content: ', controller: this.controller }) + .width('80%') + .margin({ top: 30 }) + .height(200) + .draggable(true) + .id('TextAreaOnEditChange0130_2') + .fontSize(20) + .copyOption(CopyOptions.InApp) + .onEditChange((isEditing: boolean) => { + this.res = '从textarea内向textarea外拖拽,onEditChange 回调'; + }) + + Text(this.res) + .fontSize(20).borderWidth(3).width('90%') + } + .width('100%').margin(20) + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..34a9af1ae09d8baded176cad538e86495d8c17fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0020.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 UIComponentTextTextAreaSelection0020 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0020') + .fontSize(20) + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0020') + .onClick(() => { + this.controller.setTextSelection(0, 5) + }) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..a1d63da8c4267f5eb669846d2034d7f4208747d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0030.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 UIComponentTextTextAreaSelection0030 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0030') + .fontSize(20) + .maxLines(3) + .style(TextContentStyle.INLINE) + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0030') + .onClick(() => { + this.controller.setTextSelection(0, 5) + }) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..29a31fbcadcafdc12145017fb7fa00139e162d32 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0040.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 UIComponentTextTextAreaSelection0040 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0040') + .fontSize(20) + .maxLines(3) + .style(TextContentStyle.INLINE) + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0040') + .onClick(() => { + this.controller.setTextSelection(0, 0) + }) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..37f98af1a24da9e7c67b36cd473934bf7e7a2df0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0050.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 UIComponentTextTextAreaSelection0050 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0050') + .onClick(() => { + this.controller.setTextSelection(0, 5) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0050') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..c5b8aa6bac26bcc8e9fef4443a079a78c9386577 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0060.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 UIComponentTextTextAreaSelection0060 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0060') + .onClick(() => { + this.controller.setTextSelection(0, 5) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0060') + .fontSize(20) + TextArea() + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0060_1') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..8331dfea13477585468d1cf532ffa0b7b30ffc42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0070.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 UIComponentTextTextAreaSelection0070 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0070') + .onClick(() => { + this.controller.setTextSelection(undefined, undefined) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0070') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..049795a7d02d947b96d3143df75ebd85c8ef56d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090.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 UIComponentTextTextAreaSelection0090 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0090') + .fontSize(20) + Button('起始位置小于0,终止位置大于可选文本最大长度') + .id('btnUIComponentTextTextAreaSelection0090_1') + .onClick(() => { + this.controller.setTextSelection(-1, 6) + }) + Button('起始位置小于0,终止位置等于可选文本最大长度') + .id('btnUIComponentTextTextAreaSelection0090_2') + .onClick(() => { + this.controller.setTextSelection(-1, 5) + }) + Button('起始位置等于0,终止位置等于可选文本最大长度') + .id('btnUIComponentTextTextAreaSelection0090_3') + .onClick(() => { + this.controller.setTextSelection(0, 5) + }) + Button('起始位置等于0,终止位置大于可选文本最大长度') + .id('btnUIComponentTextTextAreaSelection0090_4') + .onClick(() => { + this.controller.setTextSelection(0, 10) + }) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d9400a505f578178754bcdbf5df4759cc8a17bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0100.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 UIComponentTextTextAreaSelection0100 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0100') + .onClick(() => { + this.controller.setTextSelection(0, 7) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0100') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..b09e1147107f38ceab2c12fad75959e5b64760cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0110.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 UIComponentTextTextAreaSelection0110 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0110') + .onClick(() => { + this.controller.setTextSelection(2, 7) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0110') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce15e50bac9f5434756bdce77113075d9c96bdce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0120.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 UIComponentTextTextAreaSelection0120 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0120') + .onClick(() => { + this.controller.setTextSelection(2, 7) + }) + Button('取消选中') + .id('btnUIComponentTextTextAreaSelection0120_1') + .onClick(() => { + this.controller.setTextSelection(0, 0) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0120') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d65d3fa20bb33f33232dd17549590f72a88b1ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0130.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 UIComponentTextTextAreaSelection0130 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0130') + .onClick(() => { + this.controller.setTextSelection(2, 7) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0130') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..9db845be29937e0f15af957ed3ff6f1d08cc81e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0140.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 UIComponentTextTextAreaSelection0140 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0140') + .onClick(() => { + this.controller.setTextSelection(2, 7) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0140') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..205141e3a9731fdb24778193c5ad15b24f65ea2a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0150.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 UIComponentTextTextAreaSelection0150 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0150') + .onClick(() => { + this.controller.setTextSelection(2, 7) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0150') + .fontSize(20) + } + .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/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..2942bd1173b03ded073808ffab6565803dff8a3b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0160.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 UIComponentTextTextAreaSelection0160 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + Button('Show selected') + .id('btnUIComponentTextTextAreaSelection0160') + .onClick(() => { + this.controller.setTextSelection(-2, -1) + }) + TextArea({ + controller: this.controller + }) + .width('70%') + .id('TextAreaUIComponentTextTextAreaSelection0160') + .fontSize(20) + } + .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/UIComponentTextTextAreaUxComsistency/UIComponentTextTextAreaUxComsistency0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaUxComsistency/UIComponentTextTextAreaUxComsistency0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ba081a4d75b7262d2c7bd44d8b51a65d957adaf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAreaUxComsistency/UIComponentTextTextAreaUxComsistency0060.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 UIComponentTextTextAreaUxComsistency0060 { + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + controller: this.controller + }) + .id('TextAreaUIComponentTextTextAreaUxComsistency0060') + .style(TextContentStyle.INLINE) + Button('改变光标位置') + .id('btnUIComponentTextTextAreaUxComsistency0060') + .onClick(() => { + this.controller.caretPosition(5) + }) + } + .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/UIComponentTextTextEditable/UIComponentTextTextEditable014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable014.ets new file mode 100644 index 0000000000000000000000000000000000000000..31ad8e195a04fe79d3cdd83751ca70a824e54176 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable014.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 UIComponentTextTextEditable014 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("012345", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable015.ets new file mode 100644 index 0000000000000000000000000000000000000000..8730691b74fb4f7d5d1c211a6ef3b9130fb587b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable015.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 UIComponentTextTextEditable015 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button('addTextSpan') + .width(110) + .id('add') + .onClick(() => { + this.controller.addTextSpan('add', { + offset: 2, + style: + { + fontColor: Color.Red, + fontSize: 30 + } + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("012345", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable016.ets new file mode 100644 index 0000000000000000000000000000000000000000..3770b1718b468658465accd5d096827947e8827d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable016.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 UIComponentTextTextEditable016 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["60px", "60px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + layoutStyle: { + borderRadius: { + topLeft: '10px', + topRight: '20px', + bottomLeft: '30px', + bottomRight: '40px' + }, + margin: { + left: '10px', + top: '20px', + right: '30px', + bottom: '40px' + } + } + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable017.ets new file mode 100644 index 0000000000000000000000000000000000000000..86f51dc206faf80b7f4b234e5dc50b33c27bef72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable017.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 UIComponentTextTextEditable017 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button('addImageSpan') + .width(110) + .id('add') + .onClick(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["50px", "50px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + } + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["100px", "100px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + layoutStyle: { + margin: { + left: '40px', + top: '40px', + right: '40px', + bottom: '40px' + } + } + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable018.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3f84c852096be8ed97cadd8c7dd7b1086e4e831 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable018.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 UIComponentTextTextEditable018 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("delete spans") + .id('deleteButton') + .onClick(() => { + this.controller.deleteSpans({ + start: 0, + end: 3 + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("012345", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + + .height('100%') +} +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable019.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0344df32c8920eae95b4a8bf867bc428a4a5760 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable019.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 UIComponentTextTextEditable019 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("delete spans") + .id('deleteButton') + .onClick(() => { + this.controller.deleteSpans({ + start: 5, + end: 7 + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("012345", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + this.controller.addTextSpan("6789", + { + style: + { + fontColor: Color.Green, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable020.ets new file mode 100644 index 0000000000000000000000000000000000000000..316b08c946e9ede6c2cffd30e297e9775a84711f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable020.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 UIComponentTextTextEditable020 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("delete spans") + .id('deleteButton') + .onClick(() => { + this.controller.deleteSpans({ + start: 0, + end: 2 + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["60px", "60px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + } + }) + + this.controller.addTextSpan("012", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable021.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac18b083dd2409b7508dbf21358f369e894ff1c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable021.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 UIComponentTextTextEditable021 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("delete spans") + .id('deleteButton') + .onClick(() => { + this.controller.deleteSpans({ + start: 2, + end: 4 + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("012", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["60px", "60px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable022.ets new file mode 100644 index 0000000000000000000000000000000000000000..ea1df187290df90c65425368acce7b817402bdd3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable022.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 UIComponentTextTextEditable022 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("update spans") + .id('updateButton') + .onClick(() => { + this.controller.updateSpanStyle({ + textStyle: + { + fontWeight: FontWeight.Bolder + } + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("0123456", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable023.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d8efea74a729d1293fdfbd59660df6041f1422e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable023.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 UIComponentTextTextEditable023 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("update spans") + .id('updateButton') + .onClick(() => { + this.controller.updateSpanStyle({ + start: 0, + end: 3, + textStyle: + { + fontWeight: FontWeight.Bolder + } + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("0123456", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable024.ets new file mode 100644 index 0000000000000000000000000000000000000000..75d5d7de0e8d51fa74f1e8b19baf87d45d63e66f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable024.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 UIComponentTextTextEditable024 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("update image") + .id('updateButton') + .onClick(() => { + this.controller.updateSpanStyle({ + start: 0, + end: 3, + imageStyle: + { + size: ["100px", "100px"] + } + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["60px", "60px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable025.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae7dfa8fb3385ea94229a269f3426f984c6aacee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable025.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 UIComponentTextTextEditable025 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("update second image") + .id('updateButton') + .onClick(() => { + this.controller.updateSpanStyle({ + start: 1, + end: 2, + imageStyle: + { + size: ["100px", "100px"] + } + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["60px", "60px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + } + }) + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["60px", "60px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable026.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a25b0baadfcddee2463ed26abda30741ad8d8cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable026.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. + */ + +@Entry +@Component +struct UIComponentTextTextEditable026 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Row() { + Column() { + Button("update span style") + .id('updateButton') + .onClick(() => { + this.controller.updateSpanStyle({ + start: 0, + end: 1, + imageStyle: + { + size: ["100px", "100px"] + } + }) + this.controller.updateSpanStyle({ + start: 3, + end: 5, + textStyle: { + fontWeight: FontWeight.Bolder + } + }) + }) + + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: + { + size: ["60px", "60px"], + verticalAlign: ImageSpanAlignment.BOTTOM, + } + }) + this.controller.addTextSpan("0123456", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput001.ets new file mode 100644 index 0000000000000000000000000000000000000000..f01515f098c92f740607cd630383d39ae5d946d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput001.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. + */ + +@CustomDialog +@Component +struct CustomDialogExample { + controller?: CustomDialogController + cancel: () => void = () => { + } + confirm: () => void = () => { + } + + build() { + Column() { + TextInput({ placeholder: 'input' }).height(60).width('90%') + .id('UIComponentTextTextEvasiveInput001_input') + .onChange((value: string) => { + }) + }.borderRadius(10) + } +} + +@Entry +@Component +struct UIComponentTextTextEvasiveInput001 { + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + this.onCancel() + }, + confirm: () => { + this.onAccept() + } + }), + cancel: this.exitApp, + autoCancel: true, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss() + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss() + } + }, + alignment: DialogAlignment.Center, + offset: { dx: 0, dy: -35 }, + 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('open') + .id('UIComponentTextTextEvasiveInput001_button') + .width(100) + .height(50) + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }).backgroundColor(0x317aff) + }.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/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput002.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bfe11042cdad52f8780c3bd263cd9f81a531581 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput002.ets @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 +@Component +struct CustomDialogExample002 { + controller?: CustomDialogController + cancel: () => void = () => { + } + confirm: () => void = () => { + } + + build() { + Column() { + Text('Whether to change a text?').fontSize(16).margin({ bottom: 10 }) + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Button('cancel') + .onClick(() => { + if (this.controller != undefined) { + this.controller.close() + this.cancel() + } + }).backgroundColor(0xffffff).fontColor(Color.Black) + Button('confirm') + .onClick(() => { + if (this.controller != undefined) { + this.controller.close() + this.confirm() + } + }).backgroundColor(0xffffff).fontColor(Color.Red) + }.margin({ bottom: 10 }) + + TextInput({ placeholder: 'input' }).height(60).width('90%') + .id('UIComponentTextTextEvasiveInput002_input') + .onChange((value: string) => { + }) + }.borderRadius(10) + } +} + +@Entry +@Component +struct UIComponentTextTextEvasiveInput002 { + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample002({ + cancel: () => { + this.onCancel() + }, + confirm: () => { + this.onAccept() + } + }), + cancel: this.exitApp, + autoCancel: true, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss() + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss() + } + }, + alignment: DialogAlignment.Center, + // offset: { dx: 0, dy: -35 }, + 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('open') + .id('UIComponentTextTextEvasiveInput002_button') + .width(100) + .height(50) + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }).backgroundColor(0x317aff) + }.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/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput003.ets new file mode 100644 index 0000000000000000000000000000000000000000..7881e08796326ed4e5974182fff86c5f7bb2c4d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput003.ets @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@CustomDialog +@Component +struct CustomDialogExample003 { + controller?: CustomDialogController + cancel: () => void = () => { + } + confirm: () => void = () => { + } + + build() { + Column() { + Text('Whether to change a text?').fontSize(16).margin({ bottom: 10 }) + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Button('cancel') + .onClick(() => { + if (this.controller != undefined) { + this.controller.close() + this.cancel() + } + }).backgroundColor(0xffffff).fontColor(Color.Black) + Button('confirm') + .onClick(() => { + if (this.controller != undefined) { + this.controller.close() + this.confirm() + } + }).backgroundColor(0xffffff).fontColor(Color.Red) + }.margin({ bottom: 10 }) + + TextInput({ placeholder: 'input' }) + .height(60) + .width('90%') + .id('UIComponentTextTextEvasiveInput003_input') + .onChange((value: string) => { + }) + .margin({ top: 10, bottom: 10 }) + }.borderRadius(10) + } +} + +@Entry +@Component +struct UIComponentTextTextEvasiveInput003 { + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample003({ + cancel: () => { + this.onCancel() + }, + confirm: () => { + this.onAccept() + } + }), + cancel: this.exitApp, + autoCancel: true, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss() + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss() + } + }, + alignment: DialogAlignment.Center, + // offset: { dx: 0, dy: -35 }, + 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('open') + .id('UIComponentTextTextEvasiveInput003_button') + .width(100) + .height(50) + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }) + .backgroundColor(0x317aff) + }.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/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput004.ets new file mode 100644 index 0000000000000000000000000000000000000000..41960cd7788f1b6500cbe1dc35496c77d1bcc33c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput004.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. + */ + +@CustomDialog +@Component +struct CustomDialogExample004 { + controller?: CustomDialogController + cancel: () => void = () => { + } + confirm: () => void = () => { + } + + build() { + Column() { + Text('Whether to change a text?').fontSize(16).margin({ top: 10, bottom: 10 }) + + TextInput({ placeholder: 'input' }) + .height(60) + .width('90%') + .id('UIComponentTextTextEvasiveInput004_input') + .onChange((value: string) => { + }) + .margin({ top: 10, bottom: 10 }) + + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Button('cancel') + .onClick(() => { + if (this.controller != undefined) { + this.controller.close() + this.cancel() + } + }).backgroundColor(0xffffff).fontColor(Color.Black) + Button('confirm') + .onClick(() => { + if (this.controller != undefined) { + this.controller.close() + this.confirm() + } + }).backgroundColor(0xffffff).fontColor(Color.Red) + }.margin({ bottom: 10 }) + }.borderRadius(10) + } +} + +@Entry +@Component +struct UIComponentTextTextEvasiveInput004 { + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample004({ + cancel: () => { + this.onCancel() + }, + confirm: () => { + this.onAccept() + } + }), + cancel: this.exitApp, + autoCancel: true, + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss() + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss() + } + }, + alignment: DialogAlignment.Center, + // offset: { dx: 0, dy: -35 }, + 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('open') + .id('UIComponentTextTextEvasiveInput004_button') + .width(100) + .height(50) + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }) + .backgroundColor(0x317aff) + }.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/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle001.ets new file mode 100644 index 0000000000000000000000000000000000000000..18db3b25a93073d5aa29558f06638f59051d8d00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle001.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle001 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + start: -1, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }, { + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle001') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..ace1d8e5216850a74c63ffe49e92b65d4fc56305 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0020.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0020 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + start: -1, + length: -10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }, { + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0020') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..048dc52fd17f21ed949ae39a8b3ab55e370662ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0030.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0030 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + start: 10, + length: -10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0030') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..49b57eb67ceb63593be367399d4218ae789daf60 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0040.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0040 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: 10, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0040') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..961bb4eeaae95e0760ed808e36ab7253a6e623f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0050.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0050 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: -1, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0050') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a717a75df0098f283f1794773b43b50a195e18c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0060.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0060 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: -1, + length: -10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0060') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f3b1d1b75eda7d4ae219749b255183d0bc036e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0070.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0070 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: 10, + length: -10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0070') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..dcfbe280742f903299a9e741c617eb501dd6ac13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0080.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0080 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: 10, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0080') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle009.ets new file mode 100644 index 0000000000000000000000000000000000000000..6466b3758716c4d329e96b39d00d0847200db3e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle009.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle009 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + styledKey: StyledStringKey.FONT, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle009') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle010.ets new file mode 100644 index 0000000000000000000000000000000000000000..8beb772093bc7cf468a557ac4664c5067ee29f39 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle010.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle010 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + longPressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + styledKey: StyledStringKey.FONT, + styledValue: this.longPressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle010') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle011.ets new file mode 100644 index 0000000000000000000000000000000000000000..270ea5cb686c58ff3e99f3e2eadcf3647049aad7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle011.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle011 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + + onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + styledKey: StyledStringKey.GESTURE, + styledValue: '' + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle011') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle012.ets new file mode 100644 index 0000000000000000000000000000000000000000..12bf12f405ca67bb9c6b865bd23c3c1a8f10856b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle012.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle012 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + longPressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + start: 0, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.longPressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle012') + .copyOption(CopyOptions.InApp) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle013.ets new file mode 100644 index 0000000000000000000000000000000000000000..bdb1bdafb676dcfe96a94171e8ecb6611ecc89f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle013.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. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle013 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle013') + .copyOption(CopyOptions.InApp) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle014.ets new file mode 100644 index 0000000000000000000000000000000000000000..12e5b85427ef1441407aa83f5e999f1ae961f304 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle014.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 '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle014 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + longGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGesture + }, { + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.longGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle014') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle015.ets new file mode 100644 index 0000000000000000000000000000000000000000..464d17edd9e875a69a3c295a1134efe0bea6492c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle015.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle015 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '属性字符串点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle015') + .onClick(() => { + promptAction.showToast({ message: '组件点击事件触发' }) + }) + .onTouch(() => { + console.log(`onTouch enter`) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle016.ets new file mode 100644 index 0000000000000000000000000000000000000000..34303a4aac6db6a104de684a8d9dcaf14f5fa543 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle016.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle016 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + longPressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.longPressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle016') + .onTouch(() => { + promptAction.showToast({ message: '组件触摸事件触发' }) + }) + .onClick(() => { + promptAction.showToast({ message: '组件点击事件触发' }) + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle017.ets new file mode 100644 index 0000000000000000000000000000000000000000..809010ace7097906eae5d2254b3ca1fd434d85d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle017.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle017 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + @State textAlign: TextAlign = TextAlign.Center; + @State letterSpacing: number = 10; + @State lineHeight: number = 25; + longPressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + }, + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.longPressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('Modify attribute') + .id('updateAttribute') + .onClick(() => { + this.textAlign = TextAlign.Start; + this.letterSpacing = 25; + this.lineHeight = 50; + }) + + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle017') + .textAlign(this.textAlign) + .letterSpacing(this.letterSpacing) + .lineHeight(this.lineHeight) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018.ets new file mode 100644 index 0000000000000000000000000000000000000000..71457866d7cf40cb9679dcafc20eb1a68ec0221d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle018 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + @State clipValue: boolean = true; + pressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + }, + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456788888888888888888888888888888888888', [{ + start: 0, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('Modify clip') + .id('updateAttribute') + .onClick(() => { + this.clipValue = !this.clipValue; + }) + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle018') + .clip(this.clipValue) + .width('50px') + .height('100px') + .border({ width: 1 }) + } + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle019.ets new file mode 100644 index 0000000000000000000000000000000000000000..45dec1635ea2eee4717930b83e57bb88dbeb620b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle019.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle019 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + @State paddingSize: number = 10; + @State marginSize: number = 10; + @State borderStyles: BorderOptions = { width: 1, color: Color.Red }; + pressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + }, + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 5, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('Modify attribute') + .id('updateAttribute') + .onClick(() => { + this.paddingSize = 20; + this.marginSize = 30; + this.borderStyles = { width: 2, color: Color.Green }; + }) + + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle019') + .onClick(() => { + promptAction.showToast({ message: '组件点击事件触发' }) + }) + .padding(this.paddingSize) + .margin(this.marginSize) + .border(this.borderStyles) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle020.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d1fba5b83abcc016865af9becaabb295394f8b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle020.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle020 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + }, + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle020') + .width(-100) + .height(-100) + .border({ width: 1, color: Color.Red }) + + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d664a9052f72cedda28d9c1779856c4352b914e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0210.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0210 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789110', [{ + start: 0, + length: 12, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text('This is an example for text obscured attribute.', { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0210') + .fontSize(30) + .width('100%') + .fontColor(Color.Black) + .border({ width: 1 }) + .obscured([ObscuredReasons.PLACEHOLDER]) + .privacySensitive(true) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..bea16896ac83a3daac4dadc6f401a941cc864891 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0220.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0220 { + @State visibilityBool:Visibility = Visibility.Visible + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + clickGestureAttr1: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + this.visibilityBool = Visibility.Hidden + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: 0, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + },{ + start: 0, + length: 20, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr1 + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0220') + .visibility(this.visibilityBool) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..4208669a3eb9574728e0446044d16f25577006be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0230.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0230 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + clickGestureAttr1: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: 0, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + },{ + start: 11, + length: 6, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr1 + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0230') + .mask(new ProgressMask(5.0, 10.0, Color.Green) ) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle024.ets new file mode 100644 index 0000000000000000000000000000000000000000..da378a1c57903edfc4a61ce66b20135d945280c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle024.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle024 { + @State canFocus: boolean = true; + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + }, + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456788888888888888888888888888888', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle024') + .fontSize(50) + .width('100%') + .border({ width: 1, color: Color.Red }) + .focusable(this.canFocus) + + Button('change focusable') + .id('UIComponentTextTextGestureStyle024_button') + .width(100) + .height(50) + .onClick(event => { + this.canFocus = !this.canFocus; + }) + .margin({ top: 20 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..8e085979f7096d87e8a86af63269f3edf52f5f13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0250.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0250 { + @State enable:boolean = true; + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + clickGestureAttr1: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + this.enable = true + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456', [{ + start: 0, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + },{ + start: 0, + length: 20, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr1 + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0250') + .enabled(this.enable) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..4577298d908c1251fae5298ad685e0c9c0f0ce75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0260.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0260 { + @State longClickStart: number = 0; + @State clickStart: number = 0; + @State longClickLength: number = 0; + @State clickLength: number = 0; + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + clickGestureAttr1: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456789123456aaaaaaaaaaaaaaaaaaaaaaa', [{ + start: this.longClickStart, + length: this.longClickLength, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }, { + start: this.clickStart, + length: this.clickLength, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr1 + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0260') + .ellipsisMode(EllipsisMode.START) + .textOverflow({ + overflow: TextOverflow.Ellipsis + }) + .maxLines(1) + .width('10%') + Button('手势响应区间显示为部分文本部分省略') + .id('btnUIComponentTextTextGestureStyle0260_1') + .onClick(() => { + this.longClickStart = 0; + this.clickStart = -1; + this.longClickLength = 3; + this.clickLength = -10; + }) + Button('手势响应区间显示为全部省略') + .id('btnUIComponentTextTextGestureStyle0260_2') + .onClick(() => { + this.longClickStart = 0; + this.clickStart = 0; + this.longClickLength = 3; + this.clickLength = 3; + }) + Button('手势响应区间显示为部分文本') + .id('btnUIComponentTextTextGestureStyle0260_3') + .onClick(() => { + this.longClickStart = -1; + this.clickStart = -1; + this.longClickLength = -10; + this.clickLength = -10; + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..198fe373ef83563783c6949cde1a542c9b20acc4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0270.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0270 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + clickGestureAttr1: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('18700000000', [{ + start: 0, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }, { + start: 11, + length: 6, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr1 + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle0270') + .enableDataDetector(true) + .dataDetectorConfig({ + types: [TextDataDetectorType.PHONE_NUMBER], + color: Color.Red, + decoration:{ + type: TextDecorationType.Underline, + style: TextDecorationStyle.SOLID + } + }) + .copyOption(CopyOptions.InApp) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f803acfda497a99d5e177063b2477a810e23061 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0280.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle0280 { + @State selectionStart: number = 0; + @State selectionEnd: number = 0; + controller: TextController = new TextController(); + options: TextOptions = { controller: this.controller }; + mutableStyledString: MutableStyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + clickGestureAttr1: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('18700000000', [{ + start: 0, + length: 10, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }, { + start: 11, + length: 6, + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr1 + }]); + this.options.controller.setStyledString(this.mutableStyledString); + } + + @Builder + RightClickTextCustomMenu() { + Column() { + Menu() { + MenuItemGroup() { + MenuItem({ startIcon: $r('app.media.app_icon'), content: "Right Click Menu 1", labelInfo: "" }) + .onClick((event) => { + this.controller.closeSelectionMenu(); + }) + MenuItem({ startIcon: $r('app.media.app_icon'), content: "Right Click Menu 2", labelInfo: "" }) + MenuItem({ startIcon: $r('app.media.app_icon'), content: "Right Click Menu 3", labelInfo: "" }) + } + } + .MenuStyles() + } + } + + build() { + Row() { + Column() { + Text(undefined, this.options) + .id('UIComponentTextTextGestureStyle0280') + .bindSelectionMenu(TextSpanType.TEXT, this.RightClickTextCustomMenu, TextResponseType.RIGHT_CLICK, { + onDisappear: () => { + console.info(`自定义选择菜单关闭时回调`); + }, + onAppear: () => { + this.selectionStart = 5; + this.selectionEnd = 8; + } + }) + .copyOption(CopyOptions.InApp) + .selection(this.selectionStart, this.selectionEnd) + } + .width('100%') + } + .height('100%') + } +} + +@Extend(Menu) +function MenuStyles() { + .radius($r('sys.float.ohos_id_corner_radius_card')) + .clip(true) + .backgroundColor('#F0F0F0') +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle029.ets new file mode 100644 index 0000000000000000000000000000000000000000..54dc1f777d16eb35cd113ed9d389fcf716ef4a55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle029.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle029 { + @State start: number = 0; + @State end: number = 0; + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + console.log(`qjq 029 onLongPress enter`) + promptAction.showToast({ message: '长按事件触发' }) + }, + onClick: () => { + console.log(`qjq 029 onClick enter`) + this.start = 0; + this.end = 7; + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456788888888888888888888888888888', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle029') + .fontSize(50) + .width('100%') + .border({ width: 1, color: Color.Red }) + .copyOption(CopyOptions.None) + .selection(this.start, this.end) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle030.ets new file mode 100644 index 0000000000000000000000000000000000000000..b77280ec1021f37437efeea676a75794fbc87f82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle030.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle030 { + @State styledValue: string = ""; + textController: TextController = new TextController(); + mStyledString: StyledString | undefined = undefined; + clickGestureAttr: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mStyledString = new StyledString('13213221312', [{ + styledKey: StyledStringKey.GESTURE, + styledValue: this.clickGestureAttr + }]); + this.textController.setStyledString(this.mStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle030') + + Text(`styledValue: ${this.styledValue}`) + .margin({ top: 20 }) + + Button('getStyles') + .id('UIComponentTextTextGestureStyle030_button') + .width(100) + .height(50) + .margin({ top: 20 }) + .onClick(event => { + let styles = this.mStyledString?.getStyles(0, this.mStyledString.length) + this.styledValue = JSON.stringify(styles?.[0].styledValue); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle031.ets new file mode 100644 index 0000000000000000000000000000000000000000..1701d181104de78d614d87aca539d0d75a7b6093 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle031.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle031 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + textController2: TextController = new TextController(); + mutableStyledString2: MutableStyledString | undefined = undefined; + @State isEquals: string = ''; + longPressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + }, + }) + pressGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.longPressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + this.mutableStyledString2 = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController2.setStyledString(this.mutableStyledString2); + } + + build() { + Row() { + Column() { + Button('IsEquals') + .id('equals') + .onClick(() => { + if (this.mutableStyledString && this.mutableStyledString2) { + if (this.mutableStyledString.equals(this.mutableStyledString2)) { + this.isEquals = 'true'; + } else { + this.isEquals = 'false'; + } + } + }) + Text(this.isEquals) + .margin({ bottom: 50 }) + Text(undefined, { controller: this.textController }) + Text(undefined, { controller: this.textController2 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle032.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b4259588e651f591df2a571f43815ae8162d086 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle032.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle032 { + @State result: string = ''; + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + }, + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('0123456788888888888888888888888888888', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle032') + .fontSize(50) + .width('100%') + .border({ width: 1, color: Color.Red }) + + Text(`result: ${this.result}`) + .margin({ top: 20 }) + + Button('subStyledString') + .id('UIComponentTextTextGestureStyle032_button') + .width(100) + .height(50) + .onClick(event => { + let style = this.mutableStyledString?.subStyledString(0, 5) + this.result = JSON.stringify(style?.getStyles(0, 5)) + }) + .margin({ top: 20 }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle033.ets new file mode 100644 index 0000000000000000000000000000000000000000..75a846fa1342283b54809090a400b9d3e0fbff35 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle033.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle033 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + }, + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('replaceStyle') + .id('replaceStyle') + .onClick(() => { + this.mutableStyledString?.replaceStyle({ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }) + this.textController.setStyledString(this.mutableStyledString); + }) + .margin({ bottom: 50 }) + Text(undefined, { controller: this.textController }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle034.ets new file mode 100644 index 0000000000000000000000000000000000000000..a75835661883b7fd0000c217c66f8e416a199bc4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle034.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle034 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + }, + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('setStyle') + .id('setStyle') + .onClick(() => { + this.mutableStyledString?.setStyle({ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Green }) + }) + this.textController.setStyledString(this.mutableStyledString); + }) + .margin({ bottom: 50 }) + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle034') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle035.ets new file mode 100644 index 0000000000000000000000000000000000000000..c382cae91613fd61a600919a761602ea32e80e0a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle035.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 '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle035 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + }, + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('removeStyle') + .id('removeStyle') + .onClick(() => { + this.mutableStyledString?.removeStyle(0, 8, StyledStringKey.GESTURE); + this.textController.setStyledString(this.mutableStyledString); + }) + .margin({ bottom: 50 }) + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle035') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle036.ets new file mode 100644 index 0000000000000000000000000000000000000000..b431d99e97aeae8c175ab855c73bcac42d57f074 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle036.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle036 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + }, + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }, + { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('removeStyles') + .id('removeStyles') + .onClick(() => { + this.mutableStyledString?.removeStyles(0, 8); + this.textController.setStyledString(this.mutableStyledString); + }) + .margin({ bottom: 50 }) + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle036') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle037.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle037.ets new file mode 100644 index 0000000000000000000000000000000000000000..908f02e06e27dd226cdfd70f9d5d105cc27cde65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle037.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 { promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextGestureStyle037 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + pressGesture: GestureStyle = new GestureStyle({ + onClick: () => { + promptAction.showToast({ message: '点击事件触发' }) + }, + onLongPress: () => { + promptAction.showToast({ message: '长按事件触发' }) + } + }) + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 4, + styledKey: StyledStringKey.GESTURE, + styledValue: this.pressGesture + }, + { + start: 4, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Orange }) + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Row() { + Column() { + Button('insertString') + .id('insertString') + .onClick(() => { + this.mutableStyledString?.insertString(0, 'insert new string'); + this.textController.setStyledString(this.mutableStyledString); + }) + .margin({ bottom: 50 }) + Text(undefined, { controller: this.textController }) + .id('UIComponentTextTextGestureStyle037') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt004.ets new file mode 100644 index 0000000000000000000000000000000000000000..2507c86f9cad6ebea71bce191ecc05337456f710 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt004.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 UIComponentTextTextImageSpanAlt004 { + build() { + Column() { + Text() { + ImageSpan('cat.jpg') + .width(40) + .height(40) + .padding(10) + .border({ width: 1 }) + } + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt005.ets new file mode 100644 index 0000000000000000000000000000000000000000..a78340ea98e678cc7fd3a5a18f81d41b6cb270c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt005.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 { promptAction } from '@kit.ArkUI' +import { image } from '@kit.ImageKit' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt005 { + @State imageAlt: PixelMap | undefined = undefined + + 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.imageAlt = await this.getPixmapFromMedia($r('app.media.icon')) + } + + build() { + Column() { + Text() { + ImageSpan('cat.jpg') + .alt(this.imageAlt) + .width(40) + .height(40) + .padding(10) + .border({ width: 1 }) + .onComplete((event) => { + promptAction.showToast({ message: '触发onComplete回调' }) + }) + } + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt006.ets new file mode 100644 index 0000000000000000000000000000000000000000..86c33ed06d222723d7f395d669218e6f658abf9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt006.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 { promptAction } from '@kit.ArkUI' +import { image } from '@kit.ImageKit' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt006 { + @State imageAlt: PixelMap | undefined = undefined + + 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.imageAlt = await this.getPixmapFromMedia($r('app.media.icon')) + } + + build() { + Column() { + Text() { + ImageSpan('catt.jpg') + .alt(this.imageAlt) + .width(40) + .height(40) + .padding(10) + .border({ width: 1 }) + .onError((err)=>{ + promptAction.showToast({ message: '触发onError回调' }) + }) + } + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt007.ets new file mode 100644 index 0000000000000000000000000000000000000000..fcac4f450f6ec63a661c2dcec18b091efb205e0e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt007.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 { image } from '@kit.ImageKit' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt007 { + @State imageAlt: PixelMap | undefined = undefined + + 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.imageAlt = await this.getPixmapFromMedia($r('app.media.icon')) + } + + build() { + Column() { + Text() { + ImageSpan('cat.jpg') + .width(40) + .height(40) + .border({ width: 1 }) + .margin({ right: 20 }) + + ImageSpan('catt.jpg') + .alt(this.imageAlt) + .width(40) + .height(40) + .border({ width: 1 }) + .margin({ right: 20 }) + + ImageSpan('cat.jpg') + .alt(this.imageAlt) + .width(40) + .height(40) + .border({ width: 1 }) + .margin({ right: 20 }) + + } + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface029.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f4e86c83f1280e344740d5971d37b70e6f2939d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface029.ets @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInterface029 { + build() { + Column() { + Text('这是一段测试文字') + .lineHeight(getContext().resourceManager.getStringSync($r("app.string.lineHeightSize"))) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface187.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface187.ets new file mode 100644 index 0000000000000000000000000000000000000000..35d344df795fbf0bd7c535809b694decc46aed16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface187.ets @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentTextTextInterface187 { + build() { + Column() { + Text('这是一段测试文字') + .fontSize(getContext().resourceManager.getStringSync($r("app.string.testFontSize"))) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface202.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface202.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e54ca9180237660e1d8b5f12485cdf27e42e3f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface202.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 UIComponentTextTextInterface202 { + build() { + Column() { + Text('这是一段测试文字') + .fontSize(25) + .fontWeight(undefined) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress010.ets new file mode 100644 index 0000000000000000000000000000000000000000..a9075fcdd96f896ac3e0067433891dd532f036d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress010.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 { LengthUnit } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextLongPress010 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .id('UIComponentTextTextLongPress010') + .gesture( + LongPressGesture({ repeat: true }) + .onAction((event: GestureEvent) => { + this.mutableStyledString?.replaceStyle({ + start: 0, + length: 7, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ + fontSize: { value: 200, unit: LengthUnit.PX }, + fontWeight: 400, + fontColor: Color.Green + }) + }) + this.textController.setStyledString(this.mutableStyledString); + }) + ) + .selection(0, 7) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress011.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0aeb93229db27b40a9f69462f64216ab5796502 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress011.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 UIComponentTextTextLongPress011 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .id('UIComponentTextTextLongPress011') + .gesture( + LongPressGesture({ repeat: true }) + .onActionEnd((event: GestureEvent) => { + this.mutableStyledString?.removeString(0, 6); + this.textController.setStyledString(this.mutableStyledString); + }) + ) + .selection(0, 6) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress012.ets new file mode 100644 index 0000000000000000000000000000000000000000..73966106ca37eb52d10893dacf2571e687dc70a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress012.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 UIComponentTextTextLongPress012 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .id('UIComponentTextTextLongPress012') + .selection(0, 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/UIComponentTextTextLongPress/UIComponentTextTextLongPress013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress013.ets new file mode 100644 index 0000000000000000000000000000000000000000..e55ceeb918e5e0de14d66a64c0bb7fab9ea0bec4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress013.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 UIComponentTextTextLongPress013 { + textController: TextController = new TextController(); + mutableStyledString: MutableStyledString | undefined = undefined; + + async onPageShow() { + this.mutableStyledString = new MutableStyledString('01234567', [{ + start: 0, + length: 8, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontColor: Color.Red }) + }]); + this.textController.setStyledString(this.mutableStyledString); + } + + build() { + Column() { + Text(undefined, { controller: this.textController }) + .copyOption(CopyOptions.InApp) + .id('UIComponentTextTextLongPress013') + .selection(0, 5) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee001.ets new file mode 100644 index 0000000000000000000000000000000000000000..2bb2bb1b1d11250a8a91d1169639e793ea8ae0d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee001.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 UIComponentTextTextMarquee001 { + @State overflowValue: TextOverflow = TextOverflow.None; + + build() { + Column() { + Button('Set overflow MARQUEE') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.MARQUEE; + }) + Row() { + Text() { + ImageSpan('cat.jpg') + .width(500) + .height(500) + }.textOverflow({ overflow: this.overflowValue }) + } + .width(300) + + Row() { + Text() { + Span("当文本溢出其尺寸时,文本将滚动显示。Hello worldHello worldHello worldHello worldHello worldHello worldHello world.") + }.textOverflow({ overflow: this.overflowValue }) + } + .width(300) + + Row() { + Text() { + Span("当文本溢出其尺寸时,文本将滚动显示。Hello worldHello worldHello worldHello worldHello worldHello worldHello world.") + }.textOverflow({ overflow: this.overflowValue }) + } + .width(300) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee002.ets new file mode 100644 index 0000000000000000000000000000000000000000..993735ab35d09174fb3c422a23de28325a299a93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee002.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 UIComponentTextTextMarquee002 { + @State overflowValue: TextOverflow = TextOverflow.None; + build() { + Column() { + Button('Set overflow Ellipsis') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.Ellipsis; + }) + Row() { + Text() { + ImageSpan('cat.jpg') + .width(500) + .height(500) + } + .width(300) + .textOverflow({ overflow: this.overflowValue }) + .maxLines(2) + } + + Row() { + Text() { + Span("Hello worldHello worldHello worldHello worldHello worldHello worldHello worldHello worldHello worldHello worldHello world.") + } + .textOverflow({ overflow: this.overflowValue }) + .maxLines(2) + } + .width(300) + .borderWidth(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee003.ets new file mode 100644 index 0000000000000000000000000000000000000000..9314a52d8378659f6aa0df12fb4144edcafd7968 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee003.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 UIComponentTextTextMarquee003 { + @State overflowValue: TextOverflow = TextOverflow.None; + build() { + Column() { + Button('Set overflow MARQUEE') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.MARQUEE; + }) + Row() { + Text() { + ImageSpan('cat.jpg') + .width(500) + .height(500) + } + .textOverflow({ overflow: this.overflowValue }) + } + .width(300) + + Row() { + Text() { + Span("Hello worldHello worldHello worldHello worldHello worldHello worldHello worldHello worldHello worldHello worldHello world.") + } + .textOverflow({ overflow: this.overflowValue }) + } + .width(300) + + Row() { + Text() { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(96) + } + .textOverflow({ overflow: this.overflowValue }) + } + .width(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee004.ets new file mode 100644 index 0000000000000000000000000000000000000000..58625b405fde5e8087f00bb16f361d5c9e474658 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee004.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 UIComponentTextTextMarquee004 { + @State overflowValue: TextOverflow = TextOverflow.None; + + build() { + Column() { + Button('Set overflow MARQUEE') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.MARQUEE; + }) + Row() { + Text() { + ContainerSpan() { + ImageSpan('cat.jpg') + .width('40vp') + .height('40vp') + .verticalAlign(ImageSpanAlignment.CENTER) + Span(' Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! ') + .fontSize('16fp') + .fontColor(Color.White) + } + .textBackgroundStyle({ color: "#7F007DFF", radius: "12vp" }) + } + .margin({ top: 15 }) + .textOverflow({ overflow: this.overflowValue }) + } + + Row() { + Text() { + ContainerSpan() { + ImageSpan('cat.jpg') + .width('40vp') + .height('40vp') + .verticalAlign(ImageSpanAlignment.CENTER) + Span(' Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! Hello World ! ') + .fontSize('16fp') + .fontColor(Color.White) + } + .textBackgroundStyle({ color: "#7F007DFF", radius: "12vp" }) + } + .margin({ top: 15 }) + .textOverflow({ overflow: this.overflowValue }) + } + + }.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/UIComponentTextTextMarquee/UIComponentTextTextMarquee005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee005.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1f237c27dd9134e42f5b208eb3ca887215e7b52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee005.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 UIComponentTextTextMarquee005 { + @State overflowValue: TextOverflow = TextOverflow.None; + @State textAlignValue: TextAlign = TextAlign.Center; + + build() { + Column() { + Button('Set overflow MARQUEE') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.MARQUEE; + }) + .margin({ bottom: 20 }) + Button('Set textAlign to End') + .id('setTextAlign') + .onClick(() => { + this.textAlignValue = TextAlign.End; + }) + .margin({ bottom: 20 }) + Row() { + Text() { + ImageSpan('cat.jpg') + .width('40vp') + .height('40vp') + Span("Hello world.") + } + .textOverflow({ overflow: this.overflowValue }) + .textAlign(this.textAlignValue) + .width(300) + .border({ width: 1 }) + } + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee006.ets new file mode 100644 index 0000000000000000000000000000000000000000..3d2410ac532641b8250b158e05d7fe583d0e88cb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee006.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 UIComponentTextTextMarquee006 { + @State overflowValue: TextOverflow = TextOverflow.None; + @State imageSize: number = 20; + + build() { + Column() { + Button('Set overflow MARQUEE') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.MARQUEE; + }) + .margin({ bottom: 20 }) + Button('Set image size') + .id('setSize') + .onClick(() => { + this.imageSize = 100; + }) + .margin({ bottom: 20 }) + Text() { + ImageSpan('cat.jpg') + .width(this.imageSize) + .height(this.imageSize) + Span("Hello world.") + } + .width(150) + .textOverflow({ overflow: this.overflowValue }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee008.ets new file mode 100644 index 0000000000000000000000000000000000000000..6270cb0dac035ab80ca98d730d3f23758dc890c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee008.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 UIComponentTextTextMarquee008 { + @State overflowValue: TextOverflow = TextOverflow.None; + @State paddingSize: number = 0; + + build() { + Column() { + Button('Set overflow MARQUEE') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.MARQUEE; + }) + .margin({ bottom: 20 }) + + Button('Set padding') + .id('setPadding') + .onClick(() => { + this.paddingSize = 10; + }) + .margin({ bottom: 20 }) + + Text() { + ImageSpan('cat.jpg') + .width('40vp') + .height('40vp') + Span("Hello world Hello world Hello world.") + Span("Hi Hi Hi Hi Hi Hi Hi Hi Hi Hi .") + } + .border({ width: 1 }) + .width(100) + .textOverflow({ overflow: this.overflowValue }) + .padding(this.paddingSize) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee009.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d87adbde7966dcfb3cabd261963fb3980416920 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee009.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 UIComponentTextTextMarquee009 { + @State overflowValue: TextOverflow = TextOverflow.None; + @State spanAlign: ImageSpanAlignment = ImageSpanAlignment.CENTER; + @State paddingSize: number = 0; + + build() { + Column() { + Button('Set overflow MARQUEE') + .id('setOverflow') + .onClick(() => { + this.overflowValue = TextOverflow.MARQUEE; + }) + .margin({ bottom: 20 }) + + Button('Set verticalAlign to bottom') + .id('setVerticalAlign') + .onClick(() => { + this.spanAlign = ImageSpanAlignment.BOTTOM; + }) + .margin({ bottom: 20 }) + + Text() { + ImageSpan('cat.jpg') + .width('40vp') + .height('40vp') + .verticalAlign(this.spanAlign) + Span("Hello world Hello world Hello world.") + Span("Hi Hi Hi Hi Hi Hi Hi Hi Hi Hi .") + } + .border({ width: 1 }) + .width(300) + .textOverflow({ overflow: this.overflowValue }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextPrivacyMask/UIComponentTextTextPrivacyMask028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextPrivacyMask/UIComponentTextTextPrivacyMask028.ets new file mode 100644 index 0000000000000000000000000000000000000000..795a1a46fe93d613ca149c2c135b04cd9d66b97c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextPrivacyMask/UIComponentTextTextPrivacyMask028.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 UIComponentTextTextPrivacyMask028 { + build() { + Column() { + Text('This is"遮罩Text"') + .obscured([ObscuredReasons.PLACEHOLDER]) + .copyOption(CopyOptions.InApp) + .id('UIComponentTextTextPrivacyMask028') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle006.ets new file mode 100644 index 0000000000000000000000000000000000000000..78544ad3bb294414e1bd42e38cac1952368fdb45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle006.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 UIComponentTextTextStringParagraphStyle006 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ wordBreak: WordBreak.NORMAL }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.styleString.appendStyledString(new MutableStyledString('这是一段测试中文断行的文字', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.styleString.appendStyledString(new MutableStyledString('これは日本語の断行をテストするためのテキストです', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.styleString.appendStyledString(new MutableStyledString('이것은 한글의 줄을 끊는 것을 시험하는 문장이다', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextTextStringParagraphStyle006') + .copyOption(CopyOptions.InApp) + .width(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle007.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e13ab1222812d8a45c4322e846d6eb6d1af2abc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle007.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 UIComponentTextTextStringParagraphStyle007 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ wordBreak: WordBreak.BREAK_ALL }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.styleString.appendStyledString(new MutableStyledString('这是一段测试中文断行的文字', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.styleString.appendStyledString(new MutableStyledString('これは日本語の断行をテストするためのテキストです', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.styleString.appendStyledString(new MutableStyledString('이것은 한글의 줄을 끊는 것을 시험하는 문장이다', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextTextStringParagraphStyle007') + .copyOption(CopyOptions.InApp) + .width(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle008.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e4bc3c5535d8bf262acf5d62e2b4727c47d06bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle008.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 UIComponentTextTextStringParagraphStyle008 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ wordBreak: WordBreak.BREAK_WORD }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.styleString.appendStyledString(new MutableStyledString('这是一段测试中文断行的文字', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.styleString.appendStyledString(new MutableStyledString('これは日本語の断行をテストするためのテキストです', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.styleString.appendStyledString(new MutableStyledString('이것은 한글의 줄을 끊는 것을 시험하는 문장이다', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }])) + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextTextStringParagraphStyle008') + .wordBreak(WordBreak.BREAK_WORD) + .copyOption(CopyOptions.InApp) + .width(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle009.ets new file mode 100644 index 0000000000000000000000000000000000000000..74a4dd51a2252718626cee15c1dee9a0b0f5a47e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle009.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 UIComponentTextTextStringParagraphStyle009 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ maxLines: 2, overflow: TextOverflow.None }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is test text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextTextStringParagraphStyle009') + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle010.ets new file mode 100644 index 0000000000000000000000000000000000000000..afbfda9a0fed5f871afc744a2f25578f9acb9509 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle010.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 UIComponentTextTextStringParagraphStyle010 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ maxLines: 2, overflow: TextOverflow.Clip }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is test text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .id('UIComponentTextTextStringParagraphStyle010') + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle011.ets new file mode 100644 index 0000000000000000000000000000000000000000..d7c626a63a19c970272b93a5b3af132082fa281e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle011.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 UIComponentTextTextStringParagraphStyle011 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ maxLines: 2, overflow: TextOverflow.Ellipsis }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is test text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle012.ets new file mode 100644 index 0000000000000000000000000000000000000000..94ca4138c6a1ce3d703b730ee52f503c5b521d1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle012.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 UIComponentTextTextStringParagraphStyle012 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ maxLines: 2, overflow: TextOverflow.MARQUEE }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is test text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle013.ets new file mode 100644 index 0000000000000000000000000000000000000000..758d2178b41ddab8c562772b558da167d82773ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle013.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 UIComponentTextTextStringParagraphStyle013 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Start }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is test text', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(50) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle014.ets new file mode 100644 index 0000000000000000000000000000000000000000..053cc3614ee048794b3af9b3595a23a02d520c48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle014.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 UIComponentTextTextStringParagraphStyle014 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Center }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is test text', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(50) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle015.ets new file mode 100644 index 0000000000000000000000000000000000000000..22a978662ae92c5bdb94d0e1dd0e06e74ef0b1cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle015.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 UIComponentTextTextStringParagraphStyle015 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.End }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is test text', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(50) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle016.ets new file mode 100644 index 0000000000000000000000000000000000000000..329d74a63d40e731ba53ed77a1385a97a0362143 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle016.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 UIComponentTextTextStringParagraphStyle016 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.JUSTIFY }); + + async onPageShow() { + this.styleString = + new MutableStyledString('Helloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle017.ets new file mode 100644 index 0000000000000000000000000000000000000000..496c993e569a9f225f2eaab8708bd279eefb1df9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle017.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 UIComponentTextTextStringParagraphStyle017 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: undefined }); + + async onPageShow() { + this.styleString = + new MutableStyledString('Helloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle018.ets new file mode 100644 index 0000000000000000000000000000000000000000..b2c181c98ae7f4b9f084fe82786ede79aafc90a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle018.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 { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle018 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(-100) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('Hello', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle019.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca5aa1d5aefe3890bc7fe88be7b73d651d830f1f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle019.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 { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle019 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(0) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('Hello', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle020.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e43bb6a86eba7ea8407ad9b43b60b6c8a533755 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle020.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 { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle020 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(30) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('Hello', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle021.ets new file mode 100644 index 0000000000000000000000000000000000000000..406f65f41fbdf93b9d6d431e948d514326bcafc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle021.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 { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle021 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.percent(30) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('Hello', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle022.ets new file mode 100644 index 0000000000000000000000000000000000000000..99756312e300ff0d1c14ef1cce620da0e6a22ff1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle022.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle022 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: undefined }); + + async onPageShow() { + this.styleString = + new MutableStyledString('Hello', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle023.ets new file mode 100644 index 0000000000000000000000000000000000000000..3d2fe791efc1645c6b92c1a7d6524a8b4a6fd3f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle023.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 UIComponentTextTextStringParagraphStyle023 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Center }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hellooooo\nhi', + [{ + start: 0, + length: 2, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle024.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f34d8a1b07a7944944cfc907b4d8635e677cf82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle024.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 UIComponentTextTextStringParagraphStyle024 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Center }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\nhi', + [{ + start: 1, + length: 6, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle025.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ef8e239f1c2caff56fb1a126067dda8feb18788 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle025.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 UIComponentTextTextStringParagraphStyle025 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Center }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\nhi\nhey', + [{ + start: 1, + length: 9, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle026.ets new file mode 100644 index 0000000000000000000000000000000000000000..cb200f9159ce19370babef702f3118d7b827ed40 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle026.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 UIComponentTextTextStringParagraphStyle026 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Center }); + paragraphStyleAttr1: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Start }); + paragraphStyleAttr2: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.End }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }, { + start: 0, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr1 + }, { + start: 0, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr2 + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .textAlign(TextAlign.Center) + .textAlign(TextAlign.Start) + .textAlign(TextAlign.End) + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle027.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa426f1c4af24df0587da576230379235f4c189c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle027.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 UIComponentTextTextStringParagraphStyle027 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + async onPageShow() { + this.styleString = + new MutableStyledString('hello', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: DecorationStyle + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle028.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4a7a5c7d1a70564717f58984cce1230812bc287 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle028.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 { LengthMetrics, LengthUnit } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle028 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }, { + start: 0, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(-100, LengthUnit.VP)) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle029.ets new file mode 100644 index 0000000000000000000000000000000000000000..01af3bb93dddcfc19d75b8f91a6294d9472b86eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle029.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 { LengthMetrics, LengthUnit } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle029 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }, { + start: 0, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(30, LengthUnit.VP)) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle030.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f34d6413e62f3ffbb0673e20ae32bafcba0747e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle030.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 { LengthMetrics, LengthUnit } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle030 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }, { + start: 0, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(0, LengthUnit.PX)) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .textIndent(10) + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle031.ets new file mode 100644 index 0000000000000000000000000000000000000000..7587ed6724decb20c0f5d8816e1af6fa5cb7ccf4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle031.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle031 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(15)}); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .lineHeight(undefined) + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle032.ets new file mode 100644 index 0000000000000000000000000000000000000000..46c4f89353f4ef4c96f32b9a4d81a5966cb67328 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle032.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle032 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ maxLines: undefined }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle033.ets new file mode 100644 index 0000000000000000000000000000000000000000..63e8aca4cd4232d26b728734e1e41e45a64ae6a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle033.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 { LengthMetrics, LengthUnit } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle033 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + @State fontSize: number = 16; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }, + { + start: 0, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(0, LengthUnit.VP)) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Button('Change fontSize') + .id('changeSize') + .onClick(() => { + this.fontSize = 40; + }) + .margin({ bottom: 20 }) + Text(undefined, { controller: this.controller }) { + } + .fontSize(this.fontSize) + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle034.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7a43e6a590d6b0d2dfceadf89d26187f42c45fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle034.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle034 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ leadingMargin: LengthMetrics.vp(-100) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle035.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8fe26919ff739a4fb81cbe756437bc5c1331b62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle035.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle035 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ leadingMargin: LengthMetrics.vp(0) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle036.ets new file mode 100644 index 0000000000000000000000000000000000000000..9598abc1309f1bd70773a65419ccae3505774604 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle036.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle036 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ leadingMargin: LengthMetrics.percent(80) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle037.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle037.ets new file mode 100644 index 0000000000000000000000000000000000000000..fea38b2690e34ff26e871032a6cf6828c50016dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle037.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle037 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ leadingMargin: LengthMetrics.vp(30) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle038.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle038.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a6998b182b2836260c604277193697fd36abd7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle038.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle038 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ leadingMargin: LengthMetrics.px(100) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle039.ets new file mode 100644 index 0000000000000000000000000000000000000000..2870213121fe6a2dd650e6e12a683214c689eb7b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle039.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. + */ +import { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle039 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ leadingMargin: undefined }); + + async onPageShow() { + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle040.ets new file mode 100644 index 0000000000000000000000000000000000000000..77d7fd544925c3db3712becfaa1af9e067fd9ade --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle040.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle040 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.fly')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: [50, 50] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle041.ets new file mode 100644 index 0000000000000000000000000000000000000000..7cce979421c788499596cfa7f26bae5aaa320f68 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle041.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle041 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: [50, 50] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle042.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle042.ets new file mode 100644 index 0000000000000000000000000000000000000000..7dfc4bb744061fdb3e2f12a567e0b6f49c3f3676 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle042.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle042 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.image2')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: [50, 50] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle043.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5c60f7218b8391e9173bad1f041ee8efcab86ad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle043.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle043 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.bird_people')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: [50, 50] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle044.ets new file mode 100644 index 0000000000000000000000000000000000000000..67461980ccb25dd4e057f1a5aca9c7535185cf15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle044.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle044 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.fan')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: [50, 50] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle045.ets new file mode 100644 index 0000000000000000000000000000000000000000..79d2280a1fedd6accfb94662a481b417d8a0d5eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle045.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle045 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: ['20%', '20%'] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle046.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b587da4294502a0e534701fcc24b86aeaa34dc8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle046.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle046 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: [0, 0] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle047.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle047.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad8e2444137badd00b406bb398176928828ff20e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle047.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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle047 { + controller: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + imagePixelMap: image.PixelMap | undefined = undefined; + paragraphStyleAttr: ParagraphStyle | undefined = undefined; + leadingMarginPlaceholder1: LeadingMarginPlaceholder | undefined = undefined; + + 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(); + await imageSource.release(); + return createPixelMap; + } + + async onPageShow() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.cat')).then(); + if (this.imagePixelMap !== undefined) { + this.leadingMarginPlaceholder1 = { + pixelMap: this.imagePixelMap, + size: [$r('app.string.10vp'), $r('app.string.10vp')] + } + this.paragraphStyleAttr = new ParagraphStyle({ leadingMargin: this.leadingMarginPlaceholder1 }); + this.styleString = + new MutableStyledString('hello\n' + + 'hi', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + } + + build() { + Column() { + Text(undefined, { controller: this.controller }) { + } + .width(200) + .height(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle048.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle048.ets new file mode 100644 index 0000000000000000000000000000000000000000..4cd66e486fe0e5a9e4b86060fa65569a685c6944 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle048.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 UIComponentTextTextStringParagraphStyle048 { + controller: TextController = new TextController(); + controller1: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + styleString1: MutableStyledString | undefined = undefined; + getStyle: Array = []; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.End }); + + async onPageShow() { + this.styleString = + new MutableStyledString('TextAlign as end', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Button('getStyles') + .id('getStyles') + .onClick(() => { + this.getStyle = this.styleString!.getStyles(0, 4, StyledStringKey.PARAGRAPH_STYLE); + this.styleString1 = new MutableStyledString('这是获取的返回样式', this.getStyle); + this.controller1.setStyledString(this.styleString1); + }) + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + .margin({ bottom: 20 }) + + Text(undefined, { controller: this.controller1 }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle049.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle049.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb1366c380e3bf370e7e3cbe15f2c03f32d0363b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle049.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 { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle049 { + controller: TextController = new TextController(); + controller1: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + styleString1: MutableStyledString | undefined = undefined; + getStyle: Array = []; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ textIndent: LengthMetrics.vp(30) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('TextIndent as 30vp', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Button('getStyles') + .id('getStyles') + .onClick(() => { + this.getStyle = this.styleString!.getStyles(0, 4, StyledStringKey.PARAGRAPH_STYLE); + this.styleString1 = new MutableStyledString('这是获取的返回样式', this.getStyle); + this.controller1.setStyledString(this.styleString1); + }) + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + .margin({ bottom: 20 }) + + Text(undefined, { controller: this.controller1 }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle050.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba2ffc9c6b17c3c09d035d4593c117627282aad2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle050.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 { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle050 { + controller: TextController = new TextController(); + controller1: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + styleString1: MutableStyledString | undefined = undefined; + getStyle: Array = []; + + + async onPageShow() { + this.styleString = + new MutableStyledString('LineHeight as 50', + [{ + start: 0, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(50)) + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Button('getStyles') + .id('getStyles') + .onClick(() => { + this.getStyle = this.styleString!.getStyles(0, 4, StyledStringKey.LINE_HEIGHT); + this.styleString1 = new MutableStyledString('这是获取的返回样式', this.getStyle); + this.controller1.setStyledString(this.styleString1); + }) + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + .margin({ bottom: 20 }) + + Text(undefined, { controller: this.controller1 }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle051.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle051.ets new file mode 100644 index 0000000000000000000000000000000000000000..c24b53924b1a125722e1bd1fe3ccdb10cab3b3f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle051.ets @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics } from '@kit.ArkUI' + +const canvasWidth = 1000 +const canvasHeight = 100 + +class LeadingMarginCreator { + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private offscreenCanvas: OffscreenCanvas = new OffscreenCanvas(canvasWidth, canvasHeight) + private offContext: OffscreenCanvasRenderingContext2D = this.offscreenCanvas.getContext("2d", this.settings) + public static instance: LeadingMarginCreator = new LeadingMarginCreator() + + public genSquareMark(fontSize: number): PixelMap { + this.offContext = this.offscreenCanvas.getContext("2d", this.settings) + this.clearCanvas() + const coordinate = fontSize * (1 - 1 / 1.5) / 2 + const sideLength = fontSize / 1.5 + this.offContext.fillRect(coordinate, coordinate, sideLength, sideLength) + return this.offContext.getPixelMap(0, 0, fontSize, fontSize) + } + + private clearCanvas() { + this.offContext.clearRect(0, 0, canvasWidth, canvasHeight) + } +} + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle051 { + @State overflowText: string | undefined = ''; + private leadingMarkCreatorInstance = LeadingMarginCreator.instance + leadingMarginPlaceholder1: LeadingMarginPlaceholder = { + pixelMap: this.leadingMarkCreatorInstance.genSquareMark(24), + size: [15, 15] + } + titleParagraphStyleAttr: ParagraphStyle = new ParagraphStyle({ textAlign: TextAlign.Center }); + //第一段落首行缩进15vp + paragraphStyleAttr1: ParagraphStyle = new ParagraphStyle({ textIndent: LengthMetrics.vp(15) }); + //第二段落缩进15vp且首行有placeholder占位显示 + paragraphStyleAttr2: ParagraphStyle = + new ParagraphStyle({ textAlign: TextAlign.Start, leadingMargin: this.leadingMarginPlaceholder1 }); + //第三段落不设置缩进配置最大行数及超长显示方式 + paragraphStyleAttr3: ParagraphStyle = new ParagraphStyle({ + textAlign: TextAlign.End, + maxLines: 1, + wordBreak: WordBreak.BREAK_ALL, + overflow: TextOverflow.Ellipsis + }); + //行高样式对象 + lineHeightStyle1: LineHeightStyle = new LineHeightStyle(new LengthMetrics(24)); + //创建含段落样式的对象paragraphStyledString1 + paragraphStyledString1: StyledString = + new StyledString("段落标题\n正文第一段落开始0123456789正文第一段落结束\n正文第二段落开始hello world正文第二段落结束\n正文第三段落ABCDEFGHIJKLMNOPQRSTUVWXYZ。", + [ + { + start: 0, + length: 4, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.titleParagraphStyleAttr + }, + { + start: 0, + length: 4, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: new LineHeightStyle(new LengthMetrics(50)) + }, { + start: 0, + length: 4, + styledKey: StyledStringKey.FONT, + styledValue: new TextStyle({ fontSize: LengthMetrics.vp(24), fontWeight: FontWeight.Bolder }) + }, + { + start: 5, + length: 3, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr1 + }, + { + start: 5, + length: 20, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: this.lineHeightStyle1 + }, + { + start: 32, + length: 5, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr2 + }, + { + start: 32, + length: 20, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: this.lineHeightStyle1 + }, + { + start: 60, + length: 5, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr3 + }, + { + start: 60, + length: 5, + styledKey: StyledStringKey.LINE_HEIGHT, + styledValue: this.lineHeightStyle1 + } + ]); + controller: TextController = new TextController(); + + async onPageShow() { + this.controller.setStyledString(this.paragraphStyledString1) + } + + build() { + Row() { + Column({ space: 5 }) { + Text(undefined, { controller: this.controller }) + .width(240) + .borderWidth(1) + .copyOption(CopyOptions.InApp) + .draggable(true) + + //查询段落样式 + Button('查询overflow') + .id('getStyles') + .onClick(() => { + let styles = this.paragraphStyledString1.getStyles(0, this.paragraphStyledString1.length) + if (styles.length !== 0) { + for (let i = 0; i < styles.length; i++) { + console.info('paragraphStyledString1 style object start:' + styles[i].start) + console.info('paragraphStyledString1 style object length:' + styles[i].length) + console.info('paragraphStyledString1 style object key:' + styles[i].styledKey) + if (styles[i].styledKey === 200) { + let paraAttr = styles[i].styledValue as ParagraphStyle; + console.info('paragraphStyledString1 textAlign:' + paraAttr.textAlign) + console.info('paragraphStyledString1 textIndent:' + paraAttr.textIndent) + console.info('paragraphStyledString1 maxLines:' + paraAttr.maxLines) + console.info('paragraphStyledString1 wordBreak:' + paraAttr.wordBreak) + console.info('paragraphStyledString1 leadingMargin:' + paraAttr.leadingMargin) + console.info('paragraphStyledString1 overflow:' + paraAttr.overflow) + if (paraAttr.overflow === 2){ + this.overflowText = 'TextOverflow.Ellipsis' + } + } + } + } + }) + .margin({ top: 10 }) + Text(this.overflowText) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle052.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle052.ets new file mode 100644 index 0000000000000000000000000000000000000000..4f2a3599f755f2ae5a05764247f39aa24557b716 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle052.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 UIComponentTextTextStringParagraphStyle052 { + controller: TextController = new TextController(); + controller1: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + styleString1: MutableStyledString | undefined = undefined; + getStyle: Array = []; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ wordBreak: WordBreak.BREAK_ALL }); + + async onPageShow() { + this.styleString = + new MutableStyledString('This is set wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Button('getStyles') + .id('getStyles') + .onClick(() => { + this.getStyle = this.styleString!.getStyles(0, 4, StyledStringKey.PARAGRAPH_STYLE); + this.styleString1 = + new MutableStyledString('This is get wordBreak to WordBreak text Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu', + this.getStyle); + this.controller1.setStyledString(this.styleString1); + }) + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + .margin({ bottom: 20 }) + + Text(undefined, { controller: this.controller1 }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle053.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle053.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e9bab1cc678e6f97d5a5ed554cf5649a7a0a777 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle053.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 { LengthMetrics } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentTextTextStringParagraphStyle053 { + controller: TextController = new TextController(); + controller1: TextController = new TextController(); + styleString: MutableStyledString | undefined = undefined; + styleString1: MutableStyledString | undefined = undefined; + getStyle: Array = []; + paragraphStyleAttr: ParagraphStyle = + new ParagraphStyle({ leadingMargin: LengthMetrics.vp(40) }); + + async onPageShow() { + this.styleString = + new MutableStyledString('leadingMargin as 40vp', + [{ + start: 0, + styledKey: StyledStringKey.PARAGRAPH_STYLE, + styledValue: this.paragraphStyleAttr + }]); + this.controller.setStyledString(this.styleString); + } + + build() { + Column() { + Button('getStyles') + .id('getStyles') + .onClick(() => { + this.getStyle = this.styleString!.getStyles(0, 4, StyledStringKey.PARAGRAPH_STYLE); + this.styleString1 = + new MutableStyledString('这是获取的返回样式', + this.getStyle); + this.controller1.setStyledString(this.styleString1); + }) + Text(undefined, { controller: this.controller }) { + } + .width(200) + .border({ width: 1 }) + .margin({ bottom: 20 }) + + Text(undefined, { controller: this.controller1 }) { + } + .width(200) + .border({ width: 1 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..73456f2dc7c573de3109515948aa58c5c4ba3adb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0030.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 UIComponentTextTransparency0030 { + build() { + Column() { + Text('这是一段测试文字') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..776e7cac5ebaa49552df8bedc8ade9e362ce20d1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0170.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 UIComponentTextTransparency0170 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(FontWeight.Bolder) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..02f0e026be4eb8a83538d6d4b2dc68ae3721a366 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0180.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 UIComponentTextTransparency0180 { + build() { + Column() { + Text('这是一段测试文字') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..6233a87c21987aada768561cdcc9954e47e26bb2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0190.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 UIComponentTextTransparency0190 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(-1) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..1cdcd9df49a04ed315a2df5ba355a1603303c232 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0200.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 UIComponentTextTransparency0200 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(0) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae801c30044f64a20691f76bc67be5d38e2df2ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0210.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 UIComponentTextTransparency0210 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(99) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..dcfb9bda7e389bc18057ab913b34d8cbd8a9b284 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0220.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 UIComponentTextTransparency0220 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(100) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..8175b69888297896aa011601179ff99d3603cc50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0230.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 UIComponentTextTransparency0230 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(400) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c6391b3d6d8275ea39a5972f66f9db5dbab214b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0240.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 UIComponentTextTransparency0240 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(900) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..f5e928870f01bd43d5f325bcc6bc7a1e3c58b2e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0250.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 UIComponentTextTransparency0250 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(901) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d682ab3dd0cacd36f4752fd962b42f3abd22b9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0260.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 UIComponentTextTransparency0260 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight(1000) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..4611ca4b1584692de9fc5cb9f916917cc4215e0a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0270.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 UIComponentTextTransparency0270 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight('0') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..469e4e0bf94253d82cc9a0d798da98b2c2ce31c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0280.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 UIComponentTextTransparency0280 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight('100') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..43228b1cc1028242e1d53915abf3c00892d7b38e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0290.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 UIComponentTextTransparency0290 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight('900') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a48a3b1dc28432ff6915ae0083b5c528bfa5916 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0300.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 UIComponentTextTransparency0300 { + build() { + Column() { + Text('这是一段测试文字') + .fontWeight('1000') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..f40065c49d12a3782ed01aef1e3f983b455fe72c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0310.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 UIComponentTextTransparency0310 { + build() { + Column() { + Text('这是一段测试文字') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..54c59494b1c3e8528410ed4cb1ffee18e2884238 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0320.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 UIComponentTextTransparency0320 { + build() { + Column() { + Text('这是一段测试文字') + .fontFamily('HarmonyOS Sans') + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..a7d611bf4e0c018a0a9f00977012e91f144bb552 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0330.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 UIComponentTextTransparency0330 { + build() { + Column() { + Text('这是一段测试文字') + .fontFamily($r('app.string.fontfamily_1')) + }.height('100%') + .width('100%') + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency003.ets new file mode 100644 index 0000000000000000000000000000000000000000..9585ebe056631b16ff5bd28800de16d2df64d10a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency003.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. + */ +import { ImageModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTextTransparency003 { + @State myModifier: ImageAttribute = new ImageModifier().opacity(1) + build() { + Text('这是一段测试文字') + .width('90%') + .height(50) + .id('UIComponentTextTransparency003') + .draggable(true) + .border({ width: 1 }) + .fontColor(Color.Brown) + .copyOption(CopyOptions.InApp) + .selection(0, 8) + .opacity(0.4) + .dragPreviewOptions({modifier: this.myModifier}) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..402dbb47762429ebb410f8a6a56e25f0abbc39cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0040.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 { ImageModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTextTransparency0040 { + @State myModifier: ImageAttribute = new ImageModifier().opacity(1) + + build() { + Text('这是一段测试文字') + .width('90%') + .height(50) + .id('UIComponentTextTransparency0040') + .draggable(true) + .border({ width: 1 }) + .fontColor(Color.Brown) + .copyOption(CopyOptions.InApp) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 0, + offsetY: 0 + }) + .selection(0, 8) + .opacity(0.4) + .dragPreviewOptions({ modifier: this.myModifier }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd6de8f368a57f507fd064f668aabc2da7595ff2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0050.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. + */ +import { ImageModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTextTransparency0050 { + @State myModifier: ImageAttribute = new ImageModifier().opacity(1) + + build() { + Text('这是一段测试文字') + .width('90%') + .height(50) + .id('UIComponentTextTransparency0050') + .draggable(true) + .border({ width: 1 }) + .fontColor(Color.Brown) + .copyOption(CopyOptions.InApp) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 0, + offsetY: 0 + }) + .decoration({ + type: TextDecorationType.Underline, + color: Color.Red, + style: TextDecorationStyle.WAVY + }) + .selection(0, 8) + .opacity(0.4) + .dragPreviewOptions({ modifier: this.myModifier }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..dec21d0b1e5c87f07d2a21621a7b603494b886d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0060.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 UIComponentTextTransparency0060 { + + build() { + Text('这是一段测试文字bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb') + .width('50%') + .height(50) + .id('UIComponentTextTransparency0060') + .draggable(true) + .border({ width: 1 }) + .fontColor(Color.Brown) + .copyOption(CopyOptions.InApp) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 0, + offsetY: 0 + }) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .selection(0, 20) + .opacity(0.4) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor204.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor204.ets new file mode 100644 index 0000000000000000000000000000000000000000..d528f71efc4dd912a8ace4cebcd69160e6fafee3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor204.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 UIComponentUISupportColor204 { + build() { + Column() { + Button('切换模式') + .fontSize(20) + .fontColor(Color.Blue) + .width('200px') + .id('UIComponentUISupportColor204') + .margin({ bottom: 20 }) + + Text('测试文字').fontSize(30) + }.width('100%').height('100%').backgroundColor($r('sys.color.background_primary')) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor205.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor205.ets new file mode 100644 index 0000000000000000000000000000000000000000..add3be77552cb2fe12f3b1e6ddb2b67b92ec07e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor205.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 UIComponentUISupportColor205 { + build() { + Column() { + Button('切换模式') + .fontSize(20) + .fontColor(Color.Blue) + .width('200px') + .id('UIComponentUISupportColor205') + .margin({ bottom: 20 }) + + Text('测试文字').fontSize(30) + }.width('100%').height('100%').backgroundColor($r('sys.color.background_primary')) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor206.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor206.ets new file mode 100644 index 0000000000000000000000000000000000000000..63e8ecea267aa6a36ec1454e7f1fda391fc975e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor206.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 UIComponentUISupportColor206 { + build() { + Column() { + Button('切换模式') + .fontSize(20) + .fontColor(Color.Blue) + .width('200px') + .id('UIComponentUISupportColor206') + .margin({ bottom: 20 }) + + Text('测试文字').fontSize(30) + }.width('100%').height('100%').backgroundColor($r('sys.color.background_primary')) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor207.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor207.ets new file mode 100644 index 0000000000000000000000000000000000000000..0fda8c6a449735875711bd7d23cb5208c1e408f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor207.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 UIComponentUISupportColor207 { + build() { + Column() { + Button('切换模式') + .fontSize(20) + .fontColor(Color.Blue) + .width('200px') + .id('UIComponentUISupportColor207') + .margin({ bottom: 20 }) + + Text('测试文字').fontSize(30) + }.width('100%').height('100%').backgroundColor($r('sys.color.background_primary')) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor208.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor208.ets new file mode 100644 index 0000000000000000000000000000000000000000..28aba4b399ae203af4f252060f75e807888c49a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor208.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 UIComponentUISupportColor208 { + build() { + WithTheme({ colorMode: ThemeColorMode.LIGHT }) { + Column() { + Text('测试文字').fontSize(30) + }.width('100%').height('100%').backgroundColor($r('sys.color.background_primary')) + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor209.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor209.ets new file mode 100644 index 0000000000000000000000000000000000000000..35dfa2513e7d6049ebaf8aca26665bd46f1c0777 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor209.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 UIComponentUISupportColor209 { + build() { + WithTheme({ colorMode: ThemeColorMode.DARK }) { + Column() { + Text('测试文字').fontSize(30) + }.width('100%').height('100%').backgroundColor($r('sys.color.background_primary')) + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor210.ets new file mode 100644 index 0000000000000000000000000000000000000000..35e8154d0711f0853ec57c250ab3da53b2651e98 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor210.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 UIComponentUISupportColor210 { + build() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Column() { + Text('测试文字').fontSize(30) + }.width('100%').height('100%').backgroundColor($r('sys.color.background_primary')) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..1e0a88915a2ed72159cd0b703d07b4de6d564a42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150.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 UICustomTextShortCutKeyReplacement0150 { + @State msg: string = 'HH测试223% U测72试#'; + @State start: number = 0 + @State end: number = 0 + build() { + Text(this.msg) + .width('100%') + .height(60) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b3297dd1c9c2d04c6ef603b9b3a11774d9c1426 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160.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 UICustomTextShortCutKeyReplacement0160 { + @State msg: string = 'HH测试223% U测72试#'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Text(this.msg) + .width('100%') + .height(60) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=1) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..02ff1187993515cdbd45d44fa3d25e3715689fc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170.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 UICustomTextShortCutKeyReplacement0170 { + @State msg: string = 'HH测试223% U测72试# 1/2 @&*ئاھ چوڭ \uD83D\uDE00'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Text(this.msg) + .width('100%') + .height(60) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=1) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d4b70bcec92203a56c4f2276d54ce5f92f24ba4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180.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 UICustomTextShortCutKeyReplacement0180 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试XXX2!'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=-1) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..324983114d0ac69e6e070863a14934308c34c4dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190.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 UICustomTextShortCutKeyReplacement0190 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..d663a25d6388838842e3b2268f240c7a9dfa7cd8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200.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 UICustomTextShortCutKeyReplacement0200 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..5545ddb2c8ca2e802fcbdf41dfec23b0525c5878 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210.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 UICustomTextShortCutKeyReplacement0210 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..6713c6bd51c5781fe79b3056a18e693fcbf35385 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220.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 UICustomTextShortCutKeyReplacement0220 { + @State msg: string = '测试数据12ZXC'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(1) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ddf46fe359ced1a09ae4e20d37536b399ca85ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230.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 UICustomTextShortCutKeyReplacement0230 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..6faa65631bf44f4155a342b34ced4113e2ea1051 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240.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 UICustomTextShortCutKeyReplacement0240 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0 + @State end: number = 3 + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..72d300fe02c37a7cb3a42cca9f47c52f91d5a16b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250.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 UICustomTextShortCutKeyReplacement0250 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 10; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ae850c6c627214687de1d33e10b76d04d0567e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260.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 UICustomTextShortCutKeyReplacement0260 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 10; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f6eaac819941d51db4f7c26b331db13b29fdb26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270.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 UICustomTextShortCutKeyReplacement0270 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..319067ee443cb41c7cabec8297c036e75706f904 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280.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 UICustomTextShortCutKeyReplacement0280 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b8a66b159325cad43e3a5330f6c5c22ce15ad63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300.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 UICustomTextShortCutKeyReplacement0300 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae4ce8845351e929a9b6986154bbf079153f6244 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310.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 UICustomTextShortCutKeyReplacement0310 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..d998c5ff307517770417632875e0da54bcb543ad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320.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 UICustomTextShortCutKeyReplacement0320 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..5bbc5d856ca301466c9c4453fb562611c8a41b9d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330.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 UICustomTextShortCutKeyReplacement0330 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..eaf5dd10420120e7cdfc1e90c625a95f821d4a66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340.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 UICustomTextShortCutKeyReplacement0340 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..851d4d630e8aebc108c1417e369ff10fa47b6fcb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350.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 UICustomTextShortCutKeyReplacement0350 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c71867c4fee6f34a7a69992f3a7815361f38e2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360.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 UICustomTextShortCutKeyReplacement0360 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..bfd428d2307b94a69fed5266420dde1c6088e4d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370.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 UICustomTextShortCutKeyReplacement0370 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..e147dbce219ebb3bed84c4e2a94d7510253a4cf4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380.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 UICustomTextShortCutKeyReplacement0380 { + @State msg: string = '测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0; + @State end: number = 3; + build() { + Column() { + Button('changeText') + .id('changeText') + .onClick(() => { + this.msg = '测试数据1234 数据99987@测试'; + }) + Text(this.end+'') + Text(this.msg) + .width('100%') + .height(60) + .maxLines(3) + .selection(this.start,this.end) + .copyOption(CopyOptions.InApp) + .id('text') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end!=0) + this.end-- + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..81748f789ed518dcd3af2d3327abf2370fbad060 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0400.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 UICustomTextShortCutKeyReplacement0400 { + @State msg: string = ' 1测试数据12ZXC、! 2测试KW23!数据'; + @State maxLines: number | undefined = undefined + txt: string = '测试数据1234 数据99987@测试' + @State start: number = 3 + @State end: number = 7 + isRlt: boolean = false; + isReverse: boolean = false; + + build() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('切换文字') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = + '测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试'; + }) + Button('设置单行') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.maxLines = 1 + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(300) + .height(100) + .fontSize(16) + .enabled(true) + .draggable(true) + .maxLines(this.maxLines) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + if (this.isReverse) { + if (this.end+3 <= this.txt.length + 1) { + this.end +=3 + }else { + this.end = this.txt.length + 1 + } + } else { + if (this.end = this.start) { + this.start = this.end + this.isReverse = true; + } else { + if (this.start != 0) { + this.start++ + } + } + } + }) + + + TextInput({ text: 'get:' }) + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..fab933e2d846159288e29d89d1206c1483ed8c87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0410.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 UICustomTextShortCutKeyReplacement0410 { + @State msg: string = ' 1测试数据12ZXC、! 2测试KW23!数据'; + @State maxLines: number | undefined = undefined + txt: string = '测试数据1234 数据99987@测试' + @State start: number = 0 + @State end: number = this.txt.length + isRlt:boolean = false; + isReverse:boolean = false; + + build() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('切换文字') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = + '测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试'; + }) + Button('设置单行') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.maxLines = 1 + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(300) + .height(100) + .fontSize(16) + .enabled(true) + .draggable(true) + .maxLines(this.maxLines) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end+=this.txt.length+1 + }) + + + TextInput({ text: 'get:' }) + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..df44d71f3cc937dbbb8d174b4c951f2a4350ffc6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0420.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 UICustomTextShortCutKeyReplacement0420 { + @State msg: string = ' 1测试数据12ZXC、! 2测试KW23!数据'; + @State maxLines: number | undefined = undefined + txt: string = '测试数据1234 数据99987@测试' + @State start: number = 5 + @State end: number = 10 + isRlt:boolean = false; + isReverse:boolean = false; + + build() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('切换文字') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = + '测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试'; + }) + Button('设置单行') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.maxLines = 1 + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(300) + .height(100) + .fontSize(16) + .enabled(true) + .draggable(true) + .maxLines(this.maxLines) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + if (this.isReverse) { + this.end += this.txt.length; + } else { + if (this.end = this.start) { + } else { + if (this.start != 0) { + this.start++ + } + } + } + }) + + + TextInput({ text: 'get:' }) + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0e438ba716f5c4257b00e24ee0e4c255ad82437 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0430.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0430 { + @State msg: string = ' 1测试数据12ZXC、! 2测试KW23!数据'; + @State maxLines: number | undefined = undefined + txt: string = '测试数据1234 数据99987@测试' + @State start: number = 5 + @State end: number = 10 + isRlt: boolean = true; + isReverse: boolean = false; + + build() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('切换文字') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = + '测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试'; + }) + Button('设置单行') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.maxLines = 1 + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(300) + .height(100) + .fontSize(16) + .enabled(true) + .draggable(true) + .maxLines(this.maxLines) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + if (this.isRlt) { + if (this.isReverse) { + if (this.start == 0) { + this.end = this.msg.length + } else { + this.start--; + } + } else { + if (this.end = this.start) { + this.end = this.start + this.isReverse = true; + } else { + if (this.end != 0) { + this.end-- + } + } + } + } + }) + + + TextInput({ text: 'get:' }) + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..cab8b17309d9731e26fcf7ea66688e7711a82094 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0440.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0440 { + @State msg: string = ' 1测试数据12ZXC、! 2测试KW23!数据'; + @State maxLines: number | undefined = undefined + txt: string = '测试数据1234 数据99987@测试' + @State start: number = 3 + @State end: number = 6 + + build() { + Column({ space: 10 }) { + + Row({ space: 10 }) { + Button('切换文字') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = + '测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试'; + }) + Button('设置单行') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.maxLines = 1 + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(300) + .height(100) + .fontSize(16) + .enabled(true) + .draggable(true) + .maxLines(this.maxLines) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + .keyboardShortcut(FunctionKey.DPAD_DOWN, [ModifierKey.SHIFT], () => { + this.end += this.txt.length + }) + .keyboardShortcut(FunctionKey.DPAD_UP, [ModifierKey.SHIFT], () => { + this.start -= this.txt.length + }) + + + TextInput({ text: 'get:' }) + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..33be65e4ff53ff0d729c072698bbbea1815f366a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0460.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0460 { + @State msg: string = ' 1测试数据12ZXC、! 2测试KW23!数据'; + @State maxLines: number | undefined = undefined + txt: string = '测试数据1234 数据99987@测试' + @State start: number = this.txt.length*3+5 + @State end: number = this.txt.length*3+10 + + build() { + Column({ space: 10 }) { + + Row({ space: 10 }) { + Button('切换文字') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = + '测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试'; + }) + Button('设置多行') + .id('TextShortCutKey_btn2') + .onClick(() => { + this.msg = '设置多行设置多行设置多行设置多行'; + }) + Button('设置单行') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.msg = ' 设置单行'; + this.maxLines = 1 + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(300) + .height(100) + .fontSize(16) + .enabled(true) + .draggable(true) + .maxLines(this.maxLines) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + .keyboardShortcut(FunctionKey.DPAD_DOWN, [ModifierKey.SHIFT], () => { + this.end += this.txt.length + }) + .keyboardShortcut(FunctionKey.DPAD_UP, [ModifierKey.SHIFT], () => { + this.start -= this.txt.length + }) + + + TextInput({ text: 'get:' }) + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0490.ets new file mode 100644 index 0000000000000000000000000000000000000000..9632102bbce1ad9231cb466578ec16cc06258f56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0490.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0490 { + @State msg: string = ' 1测试数据12ZXC、! 2测试KW23!数据'; + @State start: number = 0 + @State end: number = 0 + @State maxLines: number | undefined = undefined + txt: string = '测试数据1234 数据99987@测试' + + build() { + Column({ space: 10 }) { + + Row({ space: 10 }) { + Button('切换文字') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = + '测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试' + + '\n测试数据1234 数据99987@测试' + '\n测试数据1234 数据99987@测试'; + }) + Button('设置多行') + .id('TextShortCutKey_btn2') + .onClick(() => { + this.msg = '设置多行设置多行设置多行设置多行'; + }) + Button('设置单行') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.msg = ' 设置单行'; + this.maxLines = 1 + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(300) + .height(100) + .fontSize(16) + .enabled(true) + .draggable(true) + .maxLines(this.maxLines) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + .keyboardShortcut(FunctionKey.DPAD_DOWN, [ModifierKey.SHIFT], () => { + this.end += this.txt.length + }) + + + TextInput({ text: 'get:' }) + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..626ef094ec614a8b66ad8df000d606c1ed634862 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0500.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 UICustomTextShortCutKeyReplacement0500 { + @State msg: string = 'Text测试:添加子组件,span、imagespan、symbolspan、containerspan,Shift +方向键查看索引内容'; + @State start: number = 0 + @State end: number = 3 + + build() { + Column() { + Text(this.msg) { + ContainerSpan() { + ImageSpan($r('app.media.app_icon')) + .width(60) + .height(60).obscured([ObscuredReasons.PLACEHOLDER]) + Span("测试12zx!").width('90%').obscured([ObscuredReasons.PLACEHOLDER]) + }.textBackgroundStyle({color: "#7F007DFF", radius: "12vp"}) + SymbolSpan($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .effectStrategy(SymbolEffectStrategy.NONE) + } + .width('90%') + .height(100) + .enabled(true) + .draggable(true) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + + TextInput({ text: 'get:' }) + .width('90%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..6cfa9218b6f6ba08195b1e3b52a2f3158d210e08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0510.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 UICustomTextShortCutKeyReplacement0510 { + @State msg: string = 'Text:测试数据测试数据'; + @State start: number = 0 + @State end: number = 5 + @State textIndent: Length | undefined = undefined + @State txt: string = 'Text:测试数据测试数据'; + @State textOverflowOp: TextOverflowOptions | undefined = undefined + @State maxLines: number | undefined = undefined + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('TextOverflow.Ellipsis') + .id('TextShortCutKey_btn4') + .onClick(() => { + this.maxLines = 1; + this.textOverflowOp = { overflow: TextOverflow.Ellipsis } + this.msg += ' text:test TextOverflow.Ellipsis' + ' text:test TextOverflow.Ellipsis' + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(200) + .height(60) + .maxLines(this.maxLines) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_1') + .borderWidth(5) + .textIndent(this.textIndent) + .textOverflow(this.textOverflowOp) + .selection(this.start, this.end) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.txt = 'Callback onTextSelectionChange:{' + selectionStart + ',' + selectionEnd + '}'; + }) + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + .keyboardShortcut(FunctionKey.DPAD_UP, [ModifierKey.SHIFT], () => { + this.end -= 10 + }) + .keyboardShortcut(FunctionKey.DPAD_DOWN, [ModifierKey.SHIFT], () => { + this.end += 30 + }) + + RichEditor(this.options) + .onReady(() => { + }) + .id('TextShortCutKey_4') + .width('90%') + .height(100) + .borderWidth(2) + Text(this.txt).width('80%') + .height(60).borderWidth(5).borderColor(Color.Orange) + } + .width('95%') + .height('90%') + .borderWidth(2) + .borderColor(Color.Brown) + .alignItems(HorizontalAlign.Center) + .margin(10) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610.ets new file mode 100644 index 0000000000000000000000000000000000000000..c85e9fb02f5928c588bc846ec15e660e73bb9413 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0610 { + @State msg: string = 'Text:测试数据测试数据'; + @State start: number = 0 + @State end: number = 5 + @State textIndent: Length | undefined = undefined + @State txt: string = 'Text:测试数据测试数据'; + @State textOverflowOp: TextOverflowOptions | undefined = undefined + @State maxLines: number | undefined = undefined + + build() { + Column({ space: 10 }) { + + Row({ space: 10 }) { + Button('change Selection') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.start = 2; + this.end = 10; + }) + Button('设置textIndent') + .id('TextShortCutKey_btn2') + .onClick(() => { + this.msg += '\ntext:test textIndent' + '\ntext:test textIndent'; + this.textIndent = 5 + }) + Button('设置maxLines') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.msg = ' text:test maxLines' + ' text:test maxLines' + ' text:test maxLines'; + this.maxLines = 2 + }) + }.margin({ bottom: 50 }) + + Row({ space: 10 }) { + Button('TextOverflow.Ellipsis') + .id('TextShortCutKey_btn4') + .onClick(() => { + this.maxLines = 1; + this.textOverflowOp = { overflow: TextOverflow.Ellipsis } + this.msg += ' text:test TextOverflow.Ellipsis' + ' text:test TextOverflow.Ellipsis' + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width(200) + .height(60) + .maxLines(this.maxLines) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_1') + .borderWidth(5) + .textIndent(this.textIndent) + .textOverflow(this.textOverflowOp) + .selection(this.start, this.end) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + this.txt = 'Callback onTextSelectionChange:{' + selectionStart + ',' + selectionEnd + '}'; + }) + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + .keyboardShortcut(FunctionKey.DPAD_UP, [ModifierKey.SHIFT], () => { + this.end -= 10 + }) + .keyboardShortcut(FunctionKey.DPAD_DOWN, [ModifierKey.SHIFT], () => { + this.end += 30 + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + TextInput({ text: 'copy结果:' }) + .width('100%') + .height('50') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_3') + + Text(this.txt).width('80%') + .height(60).borderWidth(5).borderColor(Color.Orange) + } + .width('95%') + .height('90%') + .borderWidth(2) + .borderColor(Color.Brown) + .alignItems(HorizontalAlign.Center) + .margin(10) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0620.ets new file mode 100644 index 0000000000000000000000000000000000000000..70761e68bde6576c18961218598a15fca40a68fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0620.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0620 { + @State msg: string = 'Text:测试数据测试数据'; + @State start: number = 0 + @State end: number = 5 + @State visibilityVal: Visibility | undefined = undefined + @State txt: string = 'Text:测试数据测试数据'; + + build() { + Column({ space: 10 }) { + + Row({ space: 10 }) { + Button('Visibility.Visible') + .id('TextShortCutKey_btn8') + .onClick(() => { + this.msg = 'text:test Visibility.Visible'; + this.visibilityVal = Visibility.Visible; + this.txt = '当前Visibility.Visible' + }) + Button('Visibility.None') + .id('TextShortCutKey_btn9') + .onClick(() => { + this.msg = 'text:test Visibility.None'; + this.visibilityVal = Visibility.None; + this.txt = '当前Visibility.None,原本的Text不见啦' + }) + Button('Visibility.Hidden') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = 'text:test Visibility.Hidden'; + this.visibilityVal = Visibility.Hidden; + this.txt = '当前Visibility.Hidden,原本的Text不见啦' + }) + }.margin({ bottom: 50 }) + + Column() { + Text(this.msg) + .width(200) + .height(60) + .maxLines(1) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_1') + .visibility(this.visibilityVal) + .borderWidth(5) + .selection(this.start, this.end) + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + Text(this.txt).width('100%') + .height(60).borderWidth(5).borderColor(Color.Orange) + }.width(200) + .height(60) + } + .width('95%') + .height('90%') + .borderWidth(2) + .borderColor(Color.Brown) + .alignItems(HorizontalAlign.Center) + .margin(10) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ed4b461d8ea438b28f01863a674a10aace26fce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660.ets @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UICustomTextShortCutKeyReplacement0660 { + @State msg: string = 'Text:测试数据测试数据'; + @State start: number = 0 + @State end: number = 5 + @State directionVal: Direction | undefined = undefined + @State clipVal: boolean | undefined = undefined + @State enableVal: boolean | undefined = undefined + @State visibilityVal: Visibility | undefined = undefined + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Column({ space: 10 }) { + Row({ space: 10 }) { + Button('Direction.Ltr') + .id('TextShortCutKey_btn1') + .onClick(() => { + this.msg = 'text:test Direction.Ltr'; + this.directionVal = Direction.Ltr; + this.enableVal = true; + }) + Button('Direction.Rtl') + .id('TextShortCutKey_btn2') + .onClick(() => { + this.msg = 'text:test Direction.Rtl'; + this.directionVal = Direction.Rtl; + this.enableVal = true; + }) + Button('Direction.Auto') + .id('TextShortCutKey_btn3') + .onClick(() => { + this.msg = 'text:test Direction.Auto'; + this.directionVal = Direction.Auto; + this.enableVal = true; + }) + } + + Row({ space: 10 }) { + Button('clip=true') + .id('TextShortCutKey_btn4') + .onClick(() => { + this.msg = + 'text:testclip=truetruetruetruetruetruetruetruetruetruetruetruetruetruetruetruetruetruetruetruetrue'; + this.clipVal = true; + this.enableVal = true; + }) + Button('clip=false') + .id('TextShortCutKey_btn5') + .onClick(() => { + this.msg = + 'text:testclip=falsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefal'; + this.clipVal = false; + this.enableVal = true; + }) + } + + Row({ space: 10 }) { + Button('enableVal=true') + .id('TextShortCutKey_btn6') + .onClick(() => { + this.msg = 'text:test enableVal=true'; + this.enableVal = true; + }) + Button('enableVal=false') + .id('TextShortCutKey_btn7') + .onClick(() => { + this.msg = 'text:test enableVal=false'; + this.enableVal = false; + }) + }.margin({ bottom: 50 }) + + Text(this.msg) + .width('60%') + .height(60) + .maxLines(1) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_1') + .direction(this.directionVal) + .clip(this.clipVal) + .wordBreak(WordBreak.NORMAL) + .enabled(this.enableVal) + .borderWidth(5) + .selection(this.start, this.end) + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + + RichEditor(this.options) + .onReady(() => { + }) + .id('TextShortCutKey_3') + .width('90%') + .height(100) + .borderWidth(2) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + .width('95%') + .height('90%') + .borderWidth(2) + .borderColor(Color.Brown) + .alignItems(HorizontalAlign.Center) + .margin(10) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0670.ets new file mode 100644 index 0000000000000000000000000000000000000000..138443a6ba70c8eca635ec8d5ae17c85362b9986 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0670.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 UICustomTextShortCutKeyReplacement0670 { + @State msg: string = 'Text测试:obscured'; + @State start: number = 0 + @State end: number = 3 + + build() { + Column() { + Text(this.msg) { + ImageSpan($r('app.media.app_icon')) + .width(60) + .height(60).obscured([ObscuredReasons.PLACEHOLDER]) + Span("HelloWorld").width('90%').obscured([ObscuredReasons.PLACEHOLDER]) + } + .width('90%') + .height(100) + .enabled(true) + .draggable(true) + .copyOption(CopyOptions.InApp) + .selection(this.start, this.end) + .id('TextShortCutKey_1') + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + + TextInput({ text: 'get:' }) + .width('90%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710.ets new file mode 100644 index 0000000000000000000000000000000000000000..3f33cc6930f747cc249b8316d4f4fd03d2caf2f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710.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 UICustomTextShortCutKeyReplacement0710 { + @State msg: string = 'Text:测试数据测试数据'; + @State start: number = 0 + @State end: number = 5 + + build() { + Column() { + Column() { + Text(this.msg) + .margin(20) + .fontSize(16) + .enabled(true) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_1') + .selection(this.start, this.end) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + .keyboardShortcut(FunctionKey.DPAD_LEFT, [ModifierKey.SHIFT], () => { + if (this.end != 0) { + this.end-- + } + }) + .keyboardShortcut(FunctionKey.DPAD_RIGHT, [ModifierKey.SHIFT], () => { + this.end++ + }) + + TextInput({ text: 'get:' }) + .width('100%') + .height('50') + .margin(20) + .draggable(true) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_2') + .onDragEnter(() => { + console.log('onDragEnter'); + }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0720.ets new file mode 100644 index 0000000000000000000000000000000000000000..87292626dd3b5f3e2a2f6720da6f1482774f9eee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0720.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 UICustomTextShortCutKeyReplacement0720 { + @State msg: string = 'Text:测试数据测试数据'; + @State start: number = 0 + @State end: number = 5 + + build() { + Column() { + Column() { + Text(this.msg) + .margin(20) + .fontSize(16) + .enabled(true) + .draggable(true) + .copyOption(CopyOptions.InApp) + .id('TextShortCutKey_1') + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json index ce65c09bf1f31a1214be8ab75ed207896afea2d3..fd4e900b4c1fd4aa2703b71ddf5b5e9f6e44bdda 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json @@ -243,6 +243,14 @@ { "name": "20string", "value": "20" + }, + { + "name": "10vp", + "value": "10vp" + }, + { + "name": "20vp", + "value": "20vp" } ] } \ 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 5cc05ce92cff61b76d701a3fe495c11c73638078..ac8cfd5c9805f1da4e1c95950aa930d6ec0d5ca2 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,565 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage001", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage002", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage003", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage004", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage005", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage006", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage007", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage008", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage009", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage010", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage011", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage012", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage013", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage014", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage015", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage016", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage017", + "testability/pages/UIComponentAttributeImage/UIComponentAttributeImage018", + "testability/pages/StatusManagerBelievable/StatusManagerBelievable0010", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan010", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan011", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan013", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan014", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan017", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan019", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan024", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan050", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan056", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater006", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater007", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater008", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater009", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater010", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater011", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater012", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater014", + "testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText011", + "testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle015", + "testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle016", + "testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle022", + "testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle023", + "testability/pages/UIComponentAttributeStringModifyingStyle/UIComponentAttributeStringModifyingStyle0120", + "testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText023", + "testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0090", + "testability/pages/UIComponentAttributeStringModifyingStyleText/UIComponentAttributeStringModifyingStyleText0100", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan001", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan002", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan004", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan005", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan007", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan008", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan009", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan012", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan015", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan016", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan020", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan021", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan022", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan023", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan027", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan028", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan032", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan033", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan034", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan035", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan036", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan037", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan038", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan039", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan040", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan041", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan042", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan043", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan044", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan045", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan046", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan047", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan048", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan049", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan051", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan052", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan053", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan054", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan055", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0250", + "testability/pages/UIComponentTextCommonCustomDrawingSpan/UIComponentTextCommonCustomDrawingSpan0290", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater001", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater002", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater003", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater004", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater005", + "testability/pages/UIComponentTextCommonItscaAttributeUpdater/UIComponentTextCommonItscaAttributeUpdater013", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt004", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt005", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt006", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt007", + "testability/pages/UIComponentTextImagePrivacySensitive/UIComponentTextImagePrivacySensitive001", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable014", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable015", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable016", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable017", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable018", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable019", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable020", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable021", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable022", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable023", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable024", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable025", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable026", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle001", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle009", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle010", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle011", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle012", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle013", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle014", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle015", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle016", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle017", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle018", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle019", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle020", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle024", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle029", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle030", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle031", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle032", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle033", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle034", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle035", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle036", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle037", + + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0020", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0030", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0040", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0050", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0060", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0070", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0080", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0210", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0220", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0230", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0250", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0260", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0270", + "testability/pages/UIComponentTextTextGestureStyle/UIComponentTextTextGestureStyle0280", + + "testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface029", + "testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface187", + "testability/pages/UIComponentTextTextInterface/UIComponentTextTextInterface202", + "testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress010", + "testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress011", + "testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress012", + "testability/pages/UIComponentTextTextLongPress/UIComponentTextTextLongPress013", + "testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee002", + "testability/pages/UIComponentTextTextMarquee/UIComponentTextTextMarquee005", + "testability/pages/UIComponentTextTextPrivacyMask/UIComponentTextTextPrivacyMask028", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle006", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle007", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle008", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle009", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle010", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle011", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle012", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle013", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle014", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle015", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle016", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle017", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle018", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle019", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle020", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle021", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle022", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle023", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle024", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle025", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle026", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle027", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle028", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle029", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle030", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle031", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle032", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle033", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle034", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle035", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle036", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle037", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle038", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle039", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle040", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle041", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle042", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle043", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle044", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle045", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle046", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle047", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle048", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle049", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle050", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle051", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle052", + "testability/pages/UIComponentTextTextStringParagraphStyle/UIComponentTextTextStringParagraphStyle053", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor204", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor205", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor206", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor207", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor208", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor209", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor210", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency003", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0040", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0050", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0060", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree032", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree061", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree075", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree090", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree092", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree101", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree103", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree104", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree105", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree106", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree117", + "testability/pages/UIAttributesStateStylesInterfaceEditableTextThree/UIAttributesStateStylesInterfaceEditableTextThree120", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor001", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor002", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor003", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor004", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor006_1", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor006_2", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor006_3", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor007", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor008", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor009", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor011", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0430", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0440", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0450", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0460", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0470", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix0890", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1120", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1140", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1150", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1160", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1170", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1180", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1190", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1200", + "testability/pages/UIComponentScrollSwiperInterfacemix/UIComponentScrollSwiperInterfacemix1220", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0010", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0020", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0030", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0040", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0050", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0060", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0080", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0090", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0100", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0110", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0120", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0130", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0140", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0150", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0160", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0170", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0180", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0190", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0200", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0210", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0220", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0230", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0240", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0250", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0260", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0270", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0280", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0290", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0300", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0310", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0320", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0330", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0340", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0350", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0360", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0370", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0380", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0390", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0400", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0410", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0420", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0430", + + "testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0460", + "testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0220", + "testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0320", + "testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0330", + "testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0340", + "testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0350", + "testability/pages/UIComponentTextAttributeStringConstructs/UIComponentTextAttributeStringConstructs0360", + + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0120", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0130", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0140", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0150", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0160", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0170", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0180", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0200", + "testability/pages/UIComponentCreateColor/UIComponentCreateColor0210", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0010", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0020", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0030", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0040", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0070", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0080", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0090", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0100", + "testability/pages/UIComponentTextTextAreaAction/UIComponentTextTextAreaAction0110", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0010", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0016", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0020", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0030", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0040", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0050", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0060", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0080", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0090", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0100", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0110", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0120", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0130", + "testability/pages/UIComponentTextTextAreaEnterkeyType/UIComponentTextTextAreaEnterkeyType0140", + "testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0130", + "testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0140", + "testability/pages/UIComponentTextTextAreaEvaSaveInputMethod/UIComponentTextTextAreaEvaSaveInputMethod0150", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0010", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0020", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0030", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0040", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0050", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0060", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0070", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0300", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0320", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0330", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0340", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0350", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0360", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0370", + "testability/pages/UIComponentTextTextAreaInterActive/UIComponentTextTextAreaInterActive0380", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0670", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0680", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0690", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0700", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0710", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0720", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0730", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface0740", + "testability/pages/UIComponentTextTextAreaInterface/UIComponentTextTextAreaInterface1020", + "testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0010", + "testability/pages/UIComponentTextTextAreaLayout/UIComponentTextTextAreaLayout0020", + + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0020", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0030", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0040", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0050", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0060", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0070", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0090", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0100", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0110", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0120", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0130", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0140", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0150", + "testability/pages/UIComponentTextTextAreaSelection/UIComponentTextTextAreaSelection0160", + + "testability/pages/UIComponentTextInput/UIComponentTextInput0010", + + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0010", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0020", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0030", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0040", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0050", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0060", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0070", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0080", + "testability/pages/UIComponentTextInputNumberDecimal/UIComponentTextInputNumberDecimal0100", + + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0010", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0020", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0030", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0040", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0050", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0060", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0070", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0080", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0090", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0100", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0110", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0120", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0130", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0140", + "testability/pages/UIComponentTextInputSecurityKeyboardScroll/UIComponentTextInputSecurityKeyboardScroll0150", + + "testability/pages/UIComponentTextTextAreaUxComsistency/UIComponentTextTextAreaUxComsistency0060", + + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0440", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0450", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0460", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0470", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0480", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0490", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0500", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0510", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0520", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0530", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0540", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0550", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0560", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0570", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0600", + "testability/pages/UIComponentTextAttribute/UIComponentTextAttribute0640", + + "testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances0900", + "testability/pages/UIComponentTextTextAreaEnhances/UIComponentTextTextAreaEnhances2500", + + "testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0010", + "testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0030", + "testability/pages/UIComponentTextTextAreaInterAction/UIComponentTextTextAreaInterAction0040", + + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0010", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0020", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0030", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0040", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0050", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0180", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0060", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0070", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0080", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0090", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0100", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0110", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0120", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0130", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0140", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0150", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0160", + "testability/pages/UIComponentTextCommonCopyOptionDraggable/UIComponentTextCommonCopyOptionDraggable0170", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0030", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0170", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0180", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0190", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0200", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0210", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0220", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0230", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0240", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0250", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0260", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0270", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0280", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0290", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0300", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0310", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0320", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTransparency0330", + "testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0030", + "testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0040", + "testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0080", + "testability/pages/UIComponentTextHyperlinkInteraction/UIComponentTextHyperlinkInteraction0090", + "testability/pages/UIComponentTextInline/UIComponentTextInline0010", + "testability/pages/UIComponentTextInline/UIComponentTextInline0020", + "testability/pages/UIComponentTextInline/UIComponentTextInline0030", + "testability/pages/UIComponentTextInline/UIComponentTextInline0060", + "testability/pages/UIComponentTextInline/UIComponentTextInline0070", + "testability/pages/UIComponentTextInline/UIComponentTextInline0080", + "testability/pages/UIComponentTextInline/UIComponentTextInline0090", + "testability/pages/UIComponentTextInline/UIComponentTextInline0120", + "testability/pages/UIComponentTextInline/UIComponentTextInline0130", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0200", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0300", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0350", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0480", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0490", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0500", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0510", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0390", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0400", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0410", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0420", + "testability/pages/UIComponentTextReverseAnalysis/UIComponentTextReverseAnalysis0430", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0010", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0020", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0030", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0040", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0050", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0060", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0070", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0080", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0090", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0100", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0110", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0120", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0130", + "testability/pages/UIComponentInputKeyboardAvoidMode/UIComponentInputKeyboardAvoidMode0150", + "testability/pages/UIComponentAttributeUserData/UIComponentAttributeUserData0030", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0150", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0160", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0170", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0180", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0190", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0200", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0210", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0220", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0230", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0240", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0250", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0260", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0270", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0280", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0300", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0310", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0320", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0330", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0340", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0350", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0360", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0370", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0380", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0400", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0410", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0420", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0430", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0440", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0460", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0490", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0500", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0510", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0610", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0620", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0660", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0670", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0710", + "testability/pages/UICustomTextShortCutKeyReplacement/UICustomTextShortCutKeyReplacement0720", + "testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput001", + "testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput002", + "testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput003", + "testability/pages/UIComponentTextTextEvasiveInputMethod/UIComponentTextTextEvasiveInput004", + "testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0100", + "testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0090", + "testability/pages/UIComponentTextTextAreaOnEditChange/UIComponentTextTextAreaOnEditChange0130" ] }