diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0675f8f329877cac86ec09acd730e8ca151a07d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/function/ui_compare_rh/uicompare/build-profile.json5 diff --git a/OAT.xml b/OAT.xml index e6b5b947bba36fe1ac1eb390307a3738babad273..99d5699cebea563c267b98c8f617474a12c856b5 100644 --- a/OAT.xml +++ b/OAT.xml @@ -115,6 +115,9 @@ Note:If the text contains special characters, please escape them according to th + + + diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets index ee88d68d2a9f85cd8a8d5c04860931aa5966eed1..60e72e91e7f620e429e59d1b857a8ee1fef5827a 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -83,6 +83,7 @@ import UIComponentSymbolDisplay from './UIComponentSymbolDisplayTest/UIComponent import UIAttributeFontSupportstage from './UIAttributeFontSupportstageTest/UIAttributeFontSupportstage.test' import UIAttributeFontInterface002 from './UIAttributeFontInterfaceTest/UIAttributeFontInterface002.test' import UIAttributeFontInterface003 from './UIAttributeFontInterfaceTest/UIAttributeFontInterface003.test' + export default function testsuite() { demoTest(); UIAttributeFontInterface001(); diff --git a/function/ui_compare_rh/uicompare/build-profile.json5 b/function/ui_compare_rh/uicompare/build-profile.json5 index 25255c09b22c8ee5c92dd996d086837b3ccb6982..d6f0d2ace912e13ed3739074972a84f92f10682a 100644 --- a/function/ui_compare_rh/uicompare/build-profile.json5 +++ b/function/ui_compare_rh/uicompare/build-profile.json5 @@ -1,7 +1,6 @@ { "app": { - "signingConfigs": [ - ], + "signingConfigs": [], "products": [ { "name": "default", diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/string.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/string.json index f94595515a99e0c828807e243494f57f09251930..453f865802a010e36ee0786d61d2b963f4e3d09c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/string.json +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/base/element/string.json @@ -11,6 +11,30 @@ { "name": "EntryAbility_label", "value": "label" + }, + { + "name": "apple", + "value": "苹果" + }, + { + "name": "fruit", + "value": "水果" + }, + { + "name": "appliance", + "value": "家电" + }, + { + "name": "banana", + "value": "香蕉" + }, + { + "name": "tv", + "value": "电视" + }, + { + "name": "computer", + "value": "电脑" } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/dark/element/dark.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/dark/element/dark.json new file mode 100644 index 0000000000000000000000000000000000000000..162a7b6f4af5d7d48a35aeed67e3eadf3a019853 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/dark/element/dark.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/rawfile/font/HarmonyOS_Sans_Thin_Italic.ttf b/function/ui_compare_rh/uicompare/entry/src/main/resources/rawfile/font/HarmonyOS_Sans_Thin_Italic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..a5c4e3eccd5369aad2dd3727b65a04402ddc8261 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/main/resources/rawfile/font/HarmonyOS_Sans_Thin_Italic.ttf differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/Ability.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/Ability.test.ets index 76e140bc60b9e19df3e40c0c70b172198360e76b..611d4b29cb1448ae4cd7bd40687f06c0f1509936 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/Ability.test.ets @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; export default function abilityTest() { describe('ActsAbilityTest', () => { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets index 11de16ebb3a3e455b798f2cddc14af0bb33dd4dc..b178864be743eac768735f2603e04e9f25469add 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabScrollable() { describe('ArkUITabScrollable', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_scrollable_001 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets index 8c54c62e50087aef0663c201d92e3872ec5d61b6..3c7703df6c5961f1a40212a35bd560a6bd17a965 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets @@ -18,10 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsIconStyleSelectedColor() { describe('ArkUITabsIconStyleSelectedColor', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets index 5df21352c8310e8a539de155a98c44ffa69edaa4..d4976ecd09f021e1cf585d6e2f73005793d172c4 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets @@ -19,10 +19,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsIconStyleUnselectedColor() { describe('ArkUITabsIconStyleUnselectedColor', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets index 39aa137013fb9b01355f0d53bc35741995205ece..632d7f85a3ef768e0331131e1c92579711f80032 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsLabelStyleSelectedColor() { describe('ArkUITabsLabelStyleSelectedColor', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_027 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets index d7dd0377579ace102aa8506ceea577bf63d48457..087935900e4e52019116be1b57e44499d090b9ea 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,10 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsLabelStyleUnselectedColor() { describe('ArkUITabsLabelStyleUnselectedColor', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_026 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets index 1279dfa79c2cf91afd023b941364d0ad5a29eda1..fc963524a1b86308bf476eba322f5c1467522b4c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsLabelStylefont() { describe('ArkUITabsLabelStylefont', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_LabelStyle_font_005 * @tc.name ArkUI_Tabs_LabelStyle_font_005 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets index 50df4505f457169bd9cb023f924b37aae115f956..c8ccb5355478413f097c468173c780a451481579 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets @@ -19,10 +19,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsSingleSelectedcolor() { describe('ArkUITabsSingleSelectedcolor', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets index cb90a868a6f555e5f0c2f8ac4310ce9d9eb771ff..7cf4d893d699fa158394365d627259fb4b5bfc51 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets @@ -19,10 +19,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsSingleUnselectedcolor() { describe('ArkUITabsSingleUnselectedcolor', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 * @tc.name ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets index 60afbf12b9eabdc4f3d0fe3375a6ec0824d79360..2f432c4ea5311de7bb55cf70675dfa72d39f035f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,10 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function ArkUITabsVertical() { describe('ArkUITabsVertical', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_vertical_001 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentButtonSelectMenuItemContentModifier/ComponentButtonSelectMenuItemContentModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentButtonSelectMenuItemContentModifier/ComponentButtonSelectMenuItemContentModifier.test.ets index fb08934275a671425dda4118e6d454c7c05935b2..5e63d9bb0bc71278ae153b30eb82a855b6b8cc93 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentButtonSelectMenuItemContentModifier/ComponentButtonSelectMenuItemContentModifier.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentButtonSelectMenuItemContentModifier/ComponentButtonSelectMenuItemContentModifier.test.ets @@ -19,6 +19,8 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver , On, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * ComponentButtonSelectMenuItemContentModifier @@ -41,6 +43,51 @@ export default function ComponentButtonSelectMenuItemContentModifier() { describe('ComponentButtonSelectMenuItemContentModifier', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_BUTTON_SELECT_MENUITEMCONTENTMODIFIER_0010 * @tc.name : SUB_ACE_UI_COMPONENT_BUTTON_SELECT_MENUITEMCONTENTMODIFIER_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentFunctionLAdvancedComponentsPopupInterfaceTest/ComponentFunctionLAdvancedComponentsPopupInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentFunctionLAdvancedComponentsPopupInterfaceTest/ComponentFunctionLAdvancedComponentsPopupInterface.test.ets index 0af58cfb277aee2bfc0fc8dcfc3c40233943d15c..1b70595d8497748694bd214863b258160ed1d36f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentFunctionLAdvancedComponentsPopupInterfaceTest/ComponentFunctionLAdvancedComponentsPopupInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentFunctionLAdvancedComponentsPopupInterfaceTest/ComponentFunctionLAdvancedComponentsPopupInterface.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * Settings.createWindow(config.url): @@ -38,7 +40,51 @@ export default function ComponentFunctionLAdvancedComponentsPopupInterface() { describe('ComponentFunctionLAdvancedComponentsPopupInterface', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_COMPONENTFUNCTION_ADVANCEDCOMPONENTS_POPUP_INTERFACE_0178 * @tc.name ARKUI_COMPONENTFUNCTION_ADVANCEDCOMPONENTS_POPUP_INTERFACE_0178 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorAITest/ComponentTextRicheditorAITests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorAITest/ComponentTextRicheditorAITests.test.ets index ccf64109a71855014aa23478caa9812a07ba94e9..3072e1d70b3d81a7b18f2fb7191ad7330a506ada 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorAITest/ComponentTextRicheditorAITests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorAITest/ComponentTextRicheditorAITests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_RICHEDITOR_AI_0010:AI相关用例 @@ -40,6 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorAITests() { describe('ComponentTextRicheditorAITests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_RICHEDITOR_AI_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomColorsTest/ComponentTextRicheditorCustomColors.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomColorsTest/ComponentTextRicheditorCustomColors.test.ets index 52d51ef5aff767d6f265a10c68cc7dffa6e3376d..5a3439b14c3837f35f7eddd8cab84cbd925e7637 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomColorsTest/ComponentTextRicheditorCustomColors.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomColorsTest/ComponentTextRicheditorCustomColors.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_CUSTOMCOLORS:Colors相关自定义 @@ -40,7 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorCustomColors() { describe('ComponentTextRicheditorCustomColors', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOB_CUSTOMCOLORS_0001 *des:1、添加RichEditor组件,不设置光标、手柄、文本选中背景颜色 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomkeyBoardAvoidAnceTest/ComponentTextRicheditorCustomkeyBoardAvoidAnceTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomkeyBoardAvoidAnceTest/ComponentTextRicheditorCustomkeyBoardAvoidAnceTests.test.ets index b2d84b04a8397d09b63bff3a0dcb5dde53ac5934..aa764c7b110975da7d36855b9266582bcaab998d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomkeyBoardAvoidAnceTest/ComponentTextRicheditorCustomkeyBoardAvoidAnceTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorCustomkeyBoardAvoidAnceTest/ComponentTextRicheditorCustomkeyBoardAvoidAnceTests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_CUSTOMKEYBOARDAVOIDANCE:CustomkeyBoardAvoidAnce相关用例 @@ -41,6 +43,51 @@ export default function ComponentTextRicheditorCustomkeyBoardAvoidAnceTests() { describe('ComponentTextRicheditorCustomkeyBoardAvoidAnceTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_CUSTOMKEYBOARDAVOIDANCE_0001 *des:1、添加RichEditor组件位于页面底部 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorFontfeatureTest/ComponentTextRicheditorFontfeatures.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorFontfeatureTest/ComponentTextRicheditorFontfeatures.test.ets index 43a5f58645bb47dee6b5c60aaf5e40835b81ad5d..61ce8f9dfa5c8456db7496619dfa8981f00656e1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorFontfeatureTest/ComponentTextRicheditorFontfeatures.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorFontfeatureTest/ComponentTextRicheditorFontfeatures.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' @@ -21,6 +21,8 @@ import Utils from '../model/Utils' import { Driver, ON, On } from '@ohos.UiTest' import { KeyCode } from '@ohos.multimodalInput.keyCode' import { MouseButton } from '@kit.TestKit' + import { uiAppearance } from '@kit.ArkUI' + import { i18n } from '@kit.LocalizationKit' /* * fontfeatures cases @@ -41,7 +43,51 @@ import { MouseButton } from '@kit.TestKit' export default function ComponentTextRicheditorFontfeatures() { describe('ComponentTextRicheditorFontfeatures', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_FONTFEATURE_0001 *des:设置fontStyle 属性为FontStyle.Normal,验证效果 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorInterface/ComponentTextRicheditorInterfaceTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorInterface/ComponentTextRicheditorInterfaceTests.test.ets index 3cc60c244088d674b1f01f95400fb97fcaf1deec..74c5d1264f4e4635fada96f8cdd225dad583ac88 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorInterface/ComponentTextRicheditorInterfaceTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorInterface/ComponentTextRicheditorInterfaceTests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_INTERFACE_0340:INTERFACE相关用例 @@ -40,6 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorInterfaceTests() { describe('ComponentTextRicheditorInterfaceTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_INTERFACE_0340 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorKeyboardReinForcingTest/ComponentTextRicheditorKeyboardReinForcingTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorKeyboardReinForcingTest/ComponentTextRicheditorKeyboardReinForcingTests.test.ets index 297c9628d07fb448acb33a87463ff4e5c0973cfb..5ba70f15e8fd3d183a567a706d3ed2403f529f60 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorKeyboardReinForcingTest/ComponentTextRicheditorKeyboardReinForcingTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorKeyboardReinForcingTest/ComponentTextRicheditorKeyboardReinForcingTests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_KEYBOARDREINFORCING_0001:KEYBOARDREINFORCING相关用例 @@ -40,7 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorKeyboardReinForcingTests() { describe('ComponentTextRicheditorKeyboardReinForcingTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_KEYBOARDREINFORCING_0001 *des:1、点击RichEditor组件,激活软键盘 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacingTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacingTests.test.ets index 140efa8e6d2156cc717c4d2f7fb4847ae47d681d..79a662be8bb7a2d1bf88ebba719ec2e4ef73c65c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacingTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacingTests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING:LINEHEIGHT&LETTERSPACING相关用例 @@ -40,7 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorLineHeightLetterSpacingTests() { describe('ComponentTextRicheditorLineHeightLetterSpacingTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0014 *des:1、添加RichEditor组件 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLongPresstoselectallTest/ComponentTextRicheditorLongPresstoselectalls.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLongPresstoselectallTest/ComponentTextRicheditorLongPresstoselectalls.test.ets index af1feae37182093bb11d04726e795ea938199fcf..5128b3235641e2b33ff25dc278a8a065cd0e51c3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLongPresstoselectallTest/ComponentTextRicheditorLongPresstoselectalls.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorLongPresstoselectallTest/ComponentTextRicheditorLongPresstoselectalls.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LONGPRESSTOSELECTAIL_0001:长按选中相关用例 @@ -40,6 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorLongPresstoselectalls() { describe('ComponentTextRicheditorLongPresstoselectalls', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LONGPRESSTOSELECTAIL_0001 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChangeTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChangeTests.test.ets index f592251066066f69a70c309e3db37bf3a5f675ec..f1b6146c83ba10a3528d2c38d4e1307d43e79d91 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChangeTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChangeTests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE:onwillchange相关用例 @@ -41,6 +43,52 @@ export default function ComponentTextRicheditorOnWillChangeTests() { describe('ComponentTextRicheditorOnWillChangeTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) + /** * NO.SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0001 *des:2、富文本组件输入框无法输入, onWillChange回调中的replacedSpans中的值正常, onDidChang无回调值|,验证效果 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholderTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholderTests.test.ets index 18c12f98f608bc25d1eae78f9f40ac7b86ff55d2..302bbf189a16e9b8c1335697ac26a6cf7f745876 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholderTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholderTests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * "SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_PLACEHOLDER_0001":placeholder相关用例 @@ -40,7 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorPlaceholderTests() { describe('ComponentTextRicheditorPlaceholderTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_PLACEHOLDER_0001 *des:1、添加RichEditor组件. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorShortKcutKeys/ComponentTextRicheditorShortKcutKeysTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorShortKcutKeys/ComponentTextRicheditorShortKcutKeysTests.test.ets index 5adf8f6929a886e52cbfcda19fc26c82cf02dc78..9ec3f3595c37874e8218c3bc0834e0bb9b8909df 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorShortKcutKeys/ComponentTextRicheditorShortKcutKeysTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorShortKcutKeys/ComponentTextRicheditorShortKcutKeysTests.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' @@ -21,6 +21,8 @@ import Utils from '../model/Utils' import { Driver, ON, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' import { MouseButton } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDIT0R_SHORTKCUTKEYS_0010:SHORTKCUTKEYS相关用例 @@ -41,7 +43,51 @@ import { MouseButton } from '@kit.TestKit' export default function ComponentTextRicheditorShortKcutKeysTests() { describe('ComponentTextRicheditorShortKcutKeysTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDIT0R_SHORTKCUTKEYS_0010 *des:1、第一个输入框中输入长文本,设置字体样式为红色、料体、较粗;使用快捷键ctrl+c复制ctrl+v粘贴到另一个输入框中 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformanceTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformanceTests.test.ets index c33d01b5f19061279baa229c523d05297559db91..36286c311b6af8f8680ee8ac16b5b76855183665 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformanceTests.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformanceTests.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0006:UXCONFORMANCE相关用例 @@ -40,6 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorUxConformanceTests() { describe('ComponentTextRicheditorUxConformanceTests', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0006 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorWordbreakTest/ComponentTextRicheditorWordbreaks.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorWordbreakTest/ComponentTextRicheditorWordbreaks.test.ets index 747d60888c73b40d62ebaa983fd15794b3343990..b4183f3cd5c78f73ad96ad2fff382d94e58656ee 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorWordbreakTest/ComponentTextRicheditorWordbreaks.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorWordbreakTest/ComponentTextRicheditorWordbreaks.test.ets @@ -13,13 +13,15 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, On } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_WORDBREAK:设置断行规则 @@ -40,6 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function ComponentTextRicheditorWordbreaks() { describe('ComponentTextRicheditorWordbreaks', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_WORDBREAK_0001 *des:wordBreak不设置属性,验证效果 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJiChuSR000HUB4KTest/FunctionJiChuSR000HUB4K.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJiChuSR000HUB4KTest/FunctionJiChuSR000HUB4K.test.ets index 29b6f449b96ef01b33ea44107f15f38ca6116e83..d81168c96f2c604e6b91c8cc67db36c8ed2cc680 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJiChuSR000HUB4KTest/FunctionJiChuSR000HUB4K.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJiChuSR000HUB4KTest/FunctionJiChuSR000HUB4K.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * Settings.createWindow(config.url): @@ -37,6 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' export default function FunctionJiChuSR000HUB4K() { describe('FunctionJiChuSR000HUB4K', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets index e2b67bdc172852aa4e57d4a08a69a6c80abed03b..5d427686c3ae7fd25710830a3166147f72a3dc76 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function FunctionJichuWaterFlow() { describe('FunctionJichuWaterFlow', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_FUNCTION_JICHU_WATERFLOW_0350 * @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 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..4b1160986ea97b60bf0c766d4d1886c5024fe6f6 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 @@ -118,7 +118,6 @@ import UIComponentButtonSelectControlSize import UIComponentButtonSelectDivider from './UIComponentButtonSelectDivider/UIComponentButtonSelectDivider.test'; import UITestCaseTest from './UITestCaseTest/UITestCaseTest.test'; import FunctionJiChuSR000HUB4K from './FunctionJiChuSR000HUB4KTest/FunctionJiChuSR000HUB4K.test'; -import UIComponentUISupportColor from './UIComponentUISupportColorTest/UIComponentUISupportColor.test'; import UIComponentButtonCommonButton from './UIComponentButtonCommonButtonTest/UIComponentButtonCommonButton.test' import ComponentButtonSelectMenuItemContentModifier from './ComponentButtonSelectMenuItemContentModifier/ComponentButtonSelectMenuItemContentModifier.test'; @@ -149,6 +148,30 @@ import UIComponentPopupBoxToastStyleInterface001 from './UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test'; import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import UIComponentCommonAttrCom from './UIComponentCommonAttrComTest/UIComponentCommonAttrCom.test'; +import UIComponentRichEditorSymbolShuffleEditing from './UIComponentRichEditorSymbolShuffleEditingTest/UIComponentRichEditorSymbolShuffleEditing.test'; +import UIComponentTextHyperlinkInterface from './UIComponentTextHyperlinkInterfaceTest/UIComponentTextHyperlinkInterface.test'; +import UIComponentTextTextImageSpanAlt from './UIComponentTextTextImageSpanAltTest/UIComponentTextTextImageSpanAlt.test'; +import UIComponentSearchSearchUxconsistency from './UIComponentSearchSearchUxconsistencyTest/UIComponentSearchSearchUxconsistency.test'; +import UIComponentLineHeightDecorationLetterSpacing from './UIComponentLineHeightDecorationLetterSpacingTest/UIComponentLineHeightDecorationLetterSpacing.test'; +import UIComponentSoftKeyBoardOptimize from './UIComponentSoftKeyBoardOptimizeTest/UIComponentSoftKeyBoardOptimize.test'; +import UIWindowFocusSwitchTest from './UIWindowFocusSwitchTest/UIWindowFocusSwitch.test'; +import UIComponentTextHyperlinkLayout from './UIComponentTextHyperlinkLayoutTest/UIComponentTextHyperlinkLayout.test'; +import UIAiParticiple from './UIAiParticipleTest/UIAiPariticiple.test'; +import UIComponentSpanBaselineoffset from './UIComponentSpanBaselineoffsetTest/UIComponentSpanBaselineoffset.test'; +import UIComponentImageAicontrollerTest from './UIComponentImageAicontrollerTest/UIComponentImageAicontroller.test'; +import UIComponentTextTransparencyTest from './UIComponentTextTransparencyTest/UIComponentTextTransparency.test'; +import UIComponentUISupportColor from './UIComponentUISupportColorTest/UIComponentUISupportColor.test'; +import UIComonentMediaImagespanErrorTest from './UIComonentMediaImagespanErrorTest/ComonentMediaImagespanError.test' +import UIComponentUiFontConfigFontList from './UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList.test'; +import UIComponentMagnifyingGlass from './UIComponentMagnifyingGlassTest/UIComponentMagnifyingGlass.test'; +import UIComponentTextCommonClick from './UIComponentTextCommonClickTest/UIComponentTextCommonClick.test'; +import UIComponentInfomationMarqueeAnimation from './UIComponentInfomationMarqueeAnimationTest/UIComponentInfomationMarqueeAnimation.test'; +import UIComponentInfomationMarqueeDirection from './UIComponentInfomationMarqueeDirectionTest/UIComponentInfomationMarqueeDirection.test'; +import UIComponentTextCommontextMinfontSizeReplacement + from './UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement.test'; +import UIComponentTextSupportfont from './UIComponentTextSupportfont/UIComponentTextSupportfont.test'; +import UIComponentTextTextSupportfont from './UIComponentTextTextSupportfontTest/UIComponentTextTextSupportfont.test'; export default function testsuite() { ComponentTextRicheditorFontfeatures(); @@ -225,7 +248,6 @@ export default function testsuite() { UIComponentButtonSelectDivider(); UITestCaseTest(); FunctionJiChuSR000HUB4K(); - UIComponentUISupportColor(); UIComponentButtonCommonButton(); ComponentButtonSelectMenuItemContentModifier(); UiComponentButtonSelectEnhancement(); @@ -239,6 +261,29 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); -} + UIComponentTextCommontextMinfontSizeReplacement(); + UIComponentTextSupportfont(); + UIComponentCommonAttrCom(); + UIComponentRichEditorSymbolShuffleEditing(); + UIComponentTextHyperlinkInterface(); + UIComponentTextHyperlinkLayout(); + UIComponentTextTextImageSpanAlt(); + UIComponentSearchSearchUxconsistency(); + UIComponentLineHeightDecorationLetterSpacing(); + UIComponentSoftKeyBoardOptimize(); + UIWindowFocusSwitchTest(); + UIAiParticiple(); + UIComponentImageAicontrollerTest(); + UIComponentTextTransparencyTest(); + UIComonentMediaImagespanErrorTest(); + UIComponentUiFontConfigFontList(); + UIComponentMagnifyingGlass(); + UIComponentSpanBaselineoffset(); + UIComponentUISupportColor(); + UIComponentTextCommonClick(); + UIComponentInfomationMarqueeAnimation(); + UIComponentInfomationMarqueeDirection(); + UIComponentTextTextSupportfont(); +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/TsComponentSR000HRP34Test/TsComponentSR000HRP34Test.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/TsComponentSR000HRP34Test/TsComponentSR000HRP34Test.test.ets index 598039d5eecc36bea43452748148796b6d1280ff..93886f0158c23ecdc71c8058628f3aafb0294f32 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/TsComponentSR000HRP34Test/TsComponentSR000HRP34Test.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/TsComponentSR000HRP34Test/TsComponentSR000HRP34Test.test.ets @@ -21,6 +21,9 @@ import Utils from '../model/Utils' import { Driver, ON } from '@kit.TestKit' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + /* * TsComponentSR000HRP34 * @@ -40,7 +43,51 @@ import { KeyCode } from '@kit.InputKit' export default function TsComponentSR000HRP34() { describe('TsComponentSR000HRP34', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_TS_COMPONENT_SR000HRP34_124 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAiParticipleTest/UIAiPariticiple.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAiParticipleTest/UIAiPariticiple.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..84151663ffdf2f2af5d0ddd8f792db3f78500b8b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAiParticipleTest/UIAiPariticiple.test.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIAiParticiple() { + describe('UIAiParticiple', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_AI_PARTICIPLE_0050 + * @tc.name SUB_ACE_UI_AI_PARTICIPLE_0050 + * @tc.desc RichEditor图文混排 + */ + it('SUB_ACE_UI_AI_PARTICIPLE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_AI_PARTICIPLE_0050.`); + Settings.createWindow("testability/pages/UIAiParticiple/UIAiParticiple0050"); + await Utils.sleep(1000); + let driver = await Driver.create(); + let richEditor: Component = await driver.findComponent(ON.id('UIAiParticiple005_001')); + let rect = await richEditor.getBounds(); + await driver.doubleClick(rect.left + 100, rect.top); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_AI_PARTICIPLE_0050 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComonentMediaImagespanErrorTest/ComonentMediaImagespanError.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComonentMediaImagespanErrorTest/ComonentMediaImagespanError.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..8fc936a8f05a35a6e61016b7678ca7b096d1e258 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComonentMediaImagespanErrorTest/ComonentMediaImagespanError.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 Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, ON, Component } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function ComonentMediaImagespanError() { + describe('ComonentMediaImagespanError', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_COMFONENT_MEDIA_IMAGESPAN_ERROR_0100 + * @tc.name SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0100 + * @tc.desc 设置错误路径的图片资源,实现png图片加载失败 + */ + it('SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0100 start.`); + Settings.createWindow("testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + const driver = Driver.create(); + await Utils.sleep(1000); + const png = await driver.findComponent(ON.id('png')); + await png.click(); + await Utils.sleep(2000); + await windowSnap.snapShot('1'); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0110 + * @tc.name SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0110 + * @tc.desc 设置错误路径的图片资源,实现bmp图片加载失败 + */ + it('SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0110 start.`); + Settings.createWindow("testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + const driver = Driver.create(); + await Utils.sleep(1000); + const bmp = await driver.findComponent(ON.id('bmp')); + await bmp.click(); + await Utils.sleep(2000); + await windowSnap.snapShot('1'); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0120 + * @tc.name SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0120 + * @tc.desc 设置错误路径的图片资源,实现svg图片加载失败 + */ + it('SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0120 start.`); + Settings.createWindow("testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + const driver = Driver.create(); + await Utils.sleep(1000); + const svg = await driver.findComponent(ON.id('svg')); + await svg.click(); + await Utils.sleep(2000); + await windowSnap.snapShot('1'); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0130 + * @tc.name SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0130 + * @tc.desc 设置错误路径的图片资源,实现gif图片加载失败 + */ + it('SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0130 start.`); + Settings.createWindow("testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + const driver = Driver.create(); + await Utils.sleep(1000); + const gif = await driver.findComponent(ON.id('gif')); + await gif.click(); + await Utils.sleep(2000); + await windowSnap.snapShot('1'); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMFONENT_MEDIA_IMAGESPAN_ERROR_0130 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonCommonButtonTest/UIComponentButtonCommonButton.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonCommonButtonTest/UIComponentButtonCommonButton.test.ets index f0efa3c97bfacd96c3d9e5e209bda39d486bd476..f3f64502d44426543ea410c5fcdd93bad499453d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonCommonButtonTest/UIComponentButtonCommonButton.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonCommonButtonTest/UIComponentButtonCommonButton.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * UIComponentButtonCommonButton @@ -39,7 +41,51 @@ import { Driver, ON } from '@ohos.UiTest' export default function UIComponentButtonCommonButton() { describe('UIComponentButtonCommonButton', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_COMMON_BUTTON_0330 * @tc.name : SUB_ACE_UI_COMPONENT_BUTTON_COMMON_BUTTON_0330 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCheckMarkTest/UIComponentButtonRadioCheckMark.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCheckMarkTest/UIComponentButtonRadioCheckMark.test.ets index 733cd861823dfc0c13becfe22e5d7a38edf581b5..a7bd26fe0d70dc77adb31b3666826cddb0a79369 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCheckMarkTest/UIComponentButtonRadioCheckMark.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCheckMarkTest/UIComponentButtonRadioCheckMark.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * Settings.createWindow(config.url): @@ -38,7 +40,51 @@ export default function UIComponentButtonRadioCheckMark() { describe('UIComponentButtonRadioCheckMark', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_RADI0_CHECKMARK_0030 * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_RADI0_CHECKMARK_0030 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCustonmizingTest/UIComponentButtonRadioCustonmizing.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCustonmizingTest/UIComponentButtonRadioCustonmizing.test.ets index 7bb67ae5dd534e63672608028d4fb1292b804d54..1e741498b3e8878b4e0c62970c97d3bfefaccd1e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCustonmizingTest/UIComponentButtonRadioCustonmizing.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioCustonmizingTest/UIComponentButtonRadioCustonmizing.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' @@ -21,6 +21,8 @@ import Utils from '../model/Utils' import { Driver, ON } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' import { BusinessError, screenLock } from '@kit.BasicServicesKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * Settings.createWindow(config.url): @@ -39,7 +41,51 @@ import { BusinessError, screenLock } from '@kit.BasicServicesKit' export default function UIComponentButtonRadioCustonmizing() { describe('UIComponentButtonRadioCustonmizing', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_RADIO_CUSTONMIZING_003 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioLConicTest/UIComponentButtonRadioLConic.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioLConicTest/UIComponentButtonRadioLConic.test.ets index 9eb3d8b32cf50994d20f21728f5625f9d2599524..89ec519745a1fe04c6a52bd61321643958a5b3cd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioLConicTest/UIComponentButtonRadioLConic.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonRadioLConicTest/UIComponentButtonRadioLConic.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' @@ -21,6 +21,8 @@ import Utils from '../model/Utils' import { Driver, ON } from '@ohos.UiTest' import { BusinessError, screenLock } from '@kit.BasicServicesKit' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * Settings.createWindow(config.url): @@ -39,7 +41,51 @@ import { KeyCode } from '@kit.InputKit' export default function UIComponentButtonRadioLConic() { describe('UIComponentButtonRadioLConic', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_RADIO_LCONIC_013 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectAttributeTest/UIComponentButtonSelectAttribute.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectAttributeTest/UIComponentButtonSelectAttribute.test.ets index 4829146bb2250917c0b73161b49b8de7038b2d58..f82f8c57af82a164d7222ad128d68111984f2f80 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectAttributeTest/UIComponentButtonSelectAttribute.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectAttributeTest/UIComponentButtonSelectAttribute.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * Settings.createWindow(config.url): @@ -38,7 +40,51 @@ export default function UIComponentButtonSelectAttribute() { describe('UIComponentButtonSelectAttribute', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_SELECT_ATTRIBUTE_0320_1 * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_SELECT_ATTRIBUTE_0320_1 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize.test.ets index b9bf9012ec41351d96528bd05ca298b03a970b1f..72fb34b3e0277781fce998baca14ab92f5b44d81 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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 { Component, Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * UIComponentButtonSelectControlSize @@ -39,7 +41,51 @@ import { Component, Driver, ON } from '@ohos.UiTest' export default function UIComponentButtonSelectControlSize() { describe('UIComponentButtonSelectControlSize', () => { - + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_BUTTON_SELECT_CONTROLSIZE_0020 * @tc.name : SUB_ACE_UI_COMPONENT_BUTTON_SELECT_CONTROLSIZE_0020 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectDivider/UIComponentButtonSelectDivider.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectDivider/UIComponentButtonSelectDivider.test.ets index 333000e8dcb33e1575f39d4ad703240f558fab92..cc1f4de91654c01927c5b488281ef27bddd0db2e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectDivider/UIComponentButtonSelectDivider.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonSelectDivider/UIComponentButtonSelectDivider.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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 { Component, Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * UIComponentButtonSelectDivider @@ -39,7 +41,51 @@ import { Component, Driver, ON } from '@ohos.UiTest' export default function UIComponentButtonSelectDivider() { describe('UIComponentButtonSelectDivider', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_SELECT_DIVIDER_0010 * @tc.name : SUB_ACE_UI_COMPONENT_BUTTON_SELECT_DIVIDER_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonStyleTest/UIComponentButtonStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonStyleTest/UIComponentButtonStyle.test.ets index 2a1735642225454f0b6c2f4d37c91715d145b1e2..e57a89f1b48eadf907c3acde693763eae06cd59f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonStyleTest/UIComponentButtonStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonStyleTest/UIComponentButtonStyle.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * Settings.createWindow(config.url): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' export default function UIComponentButtonStyle() { describe('UIComponentButtonStyle', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_STYLE_0540 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCommonAttrComTest/UIComponentCommonAttrCom.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCommonAttrComTest/UIComponentCommonAttrCom.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2eacfb912fe27939b1c66a07e23c8a5042d555de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCommonAttrComTest/UIComponentCommonAttrCom.test.ets @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { 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 UIComponentCommonAttrCom() { + describe('UIComponentCommonAttrCom', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_COMMONATTR_COM_0010 + * @tc.name SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0010 + * @tc.desc Menu组件的font属性支持Style样式 + */ + it('SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0010 start.`); + Settings.createWindow("testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom001"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0020 + * @tc.name SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0020 + * @tc.desc Hyperlink组件设置color为Color.Pink + */ + it('SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0020 start.`); + Settings.createWindow("testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom002"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0030 + * @tc.name SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0030 + * @tc.desc Hyperlink组件设置color为0xff0000 + */ + it('SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0030 start.`); + Settings.createWindow("testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom003"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0040 + * @tc.name SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0040 + * @tc.desc Hyperlink组件设置color为#008800 + */ + it('SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0040 start.`); + Settings.createWindow("testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom004"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0050 + * @tc.name SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0050 + * @tc.desc Hyperlink组件设置color为rgba(0,255,0,1) + */ + it('SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0050 start.`); + Settings.createWindow("testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom005"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0060 + * @tc.name SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0060 + * @tc.desc Hyperlink组件设置color为rgb(0,0,255) + */ + it('SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0060 start.`); + Settings.createWindow("testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom006"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0070 + * @tc.name SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0070 + * @tc.desc Hyperlink组件设置color为$r("app.color.ColorRed") + */ + it('SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0070 start.`); + Settings.createWindow("testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom007"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_COMMONATTR_COM_0070 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFunctionSelectSymbol/UIComponentFunctionSelectSymbol.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFunctionSelectSymbol/UIComponentFunctionSelectSymbol.test.ets index 9be823c88a86c47cdb06cd67549fd16ee28fc402..a32c631c9acdacdb2eabe9e22a7ed87ec08c192b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFunctionSelectSymbol/UIComponentFunctionSelectSymbol.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentFunctionSelectSymbol/UIComponentFunctionSelectSymbol.test.ets @@ -19,8 +19,9 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' -import { uiAppearance } from '@kit.ArkUI' import { BusinessError } from '@kit.BasicServicesKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * UIComponentFunctionSelectSymbol @@ -41,7 +42,51 @@ import { BusinessError } from '@kit.BasicServicesKit' export default function UIComponentFunctionSelectSymbol() { describe('UIComponentFunctionSelectSymbol', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : ARKUI_COMPONENTFUNCTION_SELECT_SYMBOL_0010 * @tc.name : ARKUI_COMPONENTFUNCTION_SELECT_SYMBOL_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentImageAicontrollerTest/UIComponentImageAicontroller.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentImageAicontrollerTest/UIComponentImageAicontroller.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d3f61a822cfc68a5faf494b0176a245d7875d1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentImageAicontrollerTest/UIComponentImageAicontroller.test.ets @@ -0,0 +1,615 @@ + +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, ON, Component } from '@ohos.UiTest'; +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentImageAicontrollerTest () { + describe('UIComponentImageAicontrollerTest', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_IMAGE_AICONTROLLER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010 + * @tc.desc Image组件,enableAnalyzer设置为true,imageAIOptions改变type值 + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_1 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0010"); + await Utils.sleep(1000); + const driver = Driver.create(); + const image1 = await driver.findComponent(ON.id('image_1')); + await Utils.sleep(500); + await image1.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_1 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010 + * @tc.desc Image组件,enableAnalyzer设置为true,imageAIOptions改变type值 + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_2 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0010"); + await Utils.sleep(1000); + const driver = Driver.create(); + const image1 = await driver.findComponent(ON.id('image_2')); + await Utils.sleep(500); + await image1.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_2 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010 + * @tc.desc Image组件,enableAnalyzer设置为true,imageAIOptions改变type值 + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_3 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0010"); + await Utils.sleep(1000); + const driver = Driver.create(); + const image1 = await driver.findComponent(ON.id('image_3')); + await Utils.sleep(500); + await image1.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0010_3 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0020 + * @tc.desc Image组件,enableAnalyzer设置为true,imageAIOptions设置aiController + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0020 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0020"); + await Utils.sleep(1000); + const driver = Driver.create(); + const image1 = await driver.findComponent(ON.id('image_1')); + await Utils.sleep(500); + await image1.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0030 + * @tc.desc Image组件,enableAnalyzer设置为true,设置getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0030"); + await Utils.sleep(1000); + const driver = Driver.create(); + const bt1 = await driver.findComponent(ON.id('button_1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1500); + const image1 = await driver.findComponent(ON.id('image_1')); + await Utils.sleep(500); + await image1.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0040 + * @tc.desc Image组件,enableAnalyzer设置为false,设置imageAIOptions和getImageAnalyzerSupportTypeS + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0040"); + await Utils.sleep(1000); + const driver = Driver.create(); + const bt1 = await driver.findComponent(ON.id('button_1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1500); + const image1 = await driver.findComponent(ON.id('image_1')); + await Utils.sleep(500); + await image1.longClick(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0050 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0050 + * @tc.desc Video组件,enableAnalyzer设置为true,imageAIOptions改变type值 + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0050 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0050"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.text('pause')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0080 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0080 + * @tc.desc Video组件,enableAnalyzer设置为false,设置imageAIOptions和getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0080 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0080"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.text('getTypes')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.text('pause')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0060 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0060 + * @tc.desc Video组件,enableAnalyzer设置为true,imageAIOptions设置aiController + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0060 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0060"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.text('pause')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0060 finish.`); + done(); + }) + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0070 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0070 + * @tc.desc Video组件,enableAnalyzer设置为true,设置getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0070 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0070"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.text('getTypes')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.text('pause')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0090 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0090 + * @tc.desc XComponent组件,enableAnalyzer设置为true,imageAIOPtions改变type值 + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0090 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0090"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0120 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0120 + * @tc.desc XComponent组件,enableAnalyzer设置为false,设置imageAIOptions和getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0120 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0120"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt3 = await driver.findComponent(ON.id('button3')); + await Utils.sleep(500); + await bt3.click(); + await Utils.sleep(500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0110 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0110 + * @tc.desc XComponent组件,enableAnalyzer设置为true,设置getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0110 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0110"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt3 = await driver.findComponent(ON.id('button3')); + await Utils.sleep(500); + await bt3.click(); + await Utils.sleep(500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0100 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0100 + * @tc.desc XComponent组件,enableAnalyzer设置为true,imageAIOptions设置aiController + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0100 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0100"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0200 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0200 + * @tc.desc 使用DrawingRenderingContext在Canvas组件进行绘制时,enableAnalyzer设置true,设置getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0200 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0200"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0180 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0180 + * @tc.desc 使用DrawingRenderingContext在Canvas组件进行绘制时,enableAnalyzer设置为true,imageAIOptions改变type值 + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0180 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0180"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0210 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0210 + * @tc.desc 使用DrawingRenderingContext在Canvas组件进行绘制时,enableAnalyzer设置为false,设置imageAIOptions和getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0210 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0210"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0190 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0190 + * @tc.desc 使用DrawingRenderingContext在Canvas组件进行绘制时,enableAnalyzer设置为true,imageAIOptions设置aiController + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0190 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0190"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0130 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0130 + * @tc.desc 使用RenderingContext在Canvas组件进行绘制时,enableAnalyzer设置为true,imageAIOptions改变type值 + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0130 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0130"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0140 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0140 + * @tc.desc 使用RenderingContext在Canvas组件进行绘制时,enableAnalyzer设置为true,imageAIOptions设置aiController + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0140 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0140"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0150 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0150 + * @tc.desc 使用RenderingContext在Canvas组件进行绘制时,enableAnalyzer设置为true,设置getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0150 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0150"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0160 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0160 + * @tc.desc 使用RenderingContext在Canvas组件进行绘制时,enableAnalyzer设置为false,设置imageAIOptions和getImageAnalyzerSupportTypes + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0160 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0160"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0170 + * @tc.name SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0170 + * @tc.desc 使用RenderingContext在Canvas组件进行绘制时,使用createImageData创建新的imagedata对象,动态切换enableAnalyzer、imageAIOptions + */ + it('SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0170 start.`); + Settings.createWindow("testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0170"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + const bt2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(500); + await bt2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_IMAGE_AICONTROLLER_0170 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInfomationMarqueeAnimationTest/UIComponentInfomationMarqueeAnimation.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInfomationMarqueeAnimationTest/UIComponentInfomationMarqueeAnimation.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9eb3240305e50bd8e55607be71ea366b11fd531a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInfomationMarqueeAnimationTest/UIComponentInfomationMarqueeAnimation.test.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentInfomationMarqueeAnimation() { + describe('UIComponentInfomationMarqueeAnimation', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_INFOMATION_MARQUEE_ANIMATION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0090 + * @tc.desc 设置Marquee参数: src, 文本长度小于Marquee宽度 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0090', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0090"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + windowSnap.snapShot('1'); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0100 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0100 + * @tc.desc 设置Marquee参数:start为flase + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0100', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0100"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + windowSnap.snapShot('1'); + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0070 + * @tc.desc Normal replacement of some string styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0070") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_ANIMATION_0070 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInfomationMarqueeDirectionTest/UIComponentInfomationMarqueeDirection.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInfomationMarqueeDirectionTest/UIComponentInfomationMarqueeDirection.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..209f2ab6b9c71424fcf2dae0101249c1c804a679 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentInfomationMarqueeDirectionTest/UIComponentInfomationMarqueeDirection.test.ets @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentInfomationMarqueeDirection() { + describe('UIComponentInfomationMarqueeDirection', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_INFOMATION_MARQUEE_DIRECTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0010 + * @tc.desc 系统语言设置中文,同时设置Rtl,验证短文本的静止效果 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0010', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('button1')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + let button2 = await driver.findComponent(ON.id('button2')); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0040 + * @tc.desc 系统语言设置中文,同时设置Ltr,验证短文本的静止效果 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0040', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0040"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('button1')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + let button2 = await driver.findComponent(ON.id('button2')); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0050 + * @tc.desc 系统语言设置中文,同时设置Auto,验证短文本的静止效果 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0050', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0050"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('button1')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + let button2 = await driver.findComponent(ON.id('button2')); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0070 + * @tc.desc 系统语言设置维吾尔语,同时设置Rt1,验证短文本的静止效果 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0070', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0070"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + let button2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(1000); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0130 + * @tc.desc 系统语言设置维吾尔语,同时设置Ltr以及fromStart,验证短文本的静止效果 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0130', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0130"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + let button2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(1000); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0150 + * @tc.desc 系统语言设置维吾尔语,同时设置Auto,验证短文本的静止效果 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_MARQUEE_DIRECTION_0150', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0150"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + let button2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(1000); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentLineHeightDecorationLetterSpacingTest/UIComponentLineHeightDecorationLetterSpacing.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentLineHeightDecorationLetterSpacingTest/UIComponentLineHeightDecorationLetterSpacing.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..20f2594031faef7347d3a4887b34e0c1641e8524 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentLineHeightDecorationLetterSpacingTest/UIComponentLineHeightDecorationLetterSpacing.test.ets @@ -0,0 +1,385 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON } from '@ohos.UiTest'; + +export default function UIComponentLineHeightDecorationLetterSpacing() { + describe('UIComponentLineHeightDecorationLetterSpacing', () => { + afterEach(async (done: Function) => { + await Settings.initEnv(); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0640 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0640 + * @tc.desc Search修饰线,改变输入框内容 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0640', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0640"); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('searchId')); + await search.click(); + await driver.triggerKey(2024); + await driver.triggerKey(2010); + await driver.triggerKey(2050); + await driver.triggerKey(2006); + let typeButton = await driver.findComponent(ON.id('typeButtonId')); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('1'); + await Utils.sleep(700); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('2'); + await Utils.sleep(700); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('3'); + await Utils.sleep(700); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('4'); + await Utils.sleep(700); + let colorButton = await driver.findComponent(ON.id('colorButtonId')); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('5'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('6'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('7'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('8'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('9'); + await Utils.sleep(700); + let textButton = await driver.findComponent(ON.id('textButtonId')); + await textButton.click(); + await driver.triggerKey(2010); + await driver.triggerKey(2050); + await windowSnap.snapShot('10'); + await Utils.sleep(700); + await driver.triggerKey(2055); + await driver.triggerKey(2055); + await driver.triggerKey(2055); + await driver.triggerKey(2055); + await driver.triggerKey(2055); + await driver.triggerKey(2055); + await windowSnap.snapShot('11'); + await Utils.sleep(700); + await driver.triggerKey(2024); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0660 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0660 + * @tc.desc Search修饰线,空文本,显示提示文本 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0660', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0660"); + await Utils.sleep(1000); + let driver = Driver.create(); + let typeButton = await driver.findComponent(ON.id('typeButtonId')); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('1'); + await Utils.sleep(700); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('2'); + await Utils.sleep(700); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('3'); + await Utils.sleep(700); + await typeButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('4'); + await Utils.sleep(700); + let colorButton = await driver.findComponent(ON.id('colorButtonId')); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('5'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('6'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('7'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('8'); + await Utils.sleep(700); + await colorButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0670 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0670 + * @tc.desc Search修饰线,改变输入框类型 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0670', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0670"); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('searchId')); + await search.click(); + let typeButton = await driver.findComponent(ON.id('typeButtonId')); + await typeButton.click(); + await typeButton.click(); + await typeButton.click(); + await typeButton.click(); + let colorButton = await driver.findComponent(ON.id('colorButtonId')); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + await driver.triggerKey(2010); + await driver.triggerKey(2050); + let keyButton = await driver.findComponent(ON.id('keyButtonId')); + await keyButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(700); + await keyButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(700); + await keyButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('3'); + await Utils.sleep(700); + await keyButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0680 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0680 + * @tc.desc Search修饰线,改变文本对齐方式 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0680', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0680"); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('searchId')); + await search.click(); + await driver.triggerKey(2024); + await driver.triggerKey(2006); + let typeButton = await driver.findComponent(ON.id('typeButtonId')); + await typeButton.click(); + await typeButton.click(); + await typeButton.click(); + await typeButton.click(); + let colorButton = await driver.findComponent(ON.id('colorButtonId')); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + let alignButton = await driver.findComponent(ON.id('alignButtonId')); + await alignButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await alignButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('2'); + await Utils.sleep(1000); + await alignButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0690 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0690 + * @tc.desc Search修饰线,动态改变字体大小 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0690', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0690"); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('searchId')); + await search.click(); + await driver.triggerKey(2024); + await driver.triggerKey(2006); + let typeButton = await driver.findComponent(ON.id('typeButtonId')); + await typeButton.click(); + await typeButton.click(); + await typeButton.click(); + await typeButton.click(); + let colorButton = await driver.findComponent(ON.id('colorButtonId')); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + await colorButton.click(); + let fontButton = await driver.findComponent(ON.id('fontButtonId')); + await fontButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await fontButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('2'); + await Utils.sleep(1000); + await fontButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0710 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0710 + * @tc.desc Search字符间距,不设置字符间距属性 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0710', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0710"); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('searchId')); + await search.click(); + await driver.triggerKey(2024); + await Utils.sleep(500); + await driver.triggerKey(2010); + await Utils.sleep(500); + await driver.triggerKey(2050); + await Utils.sleep(500); + await driver.triggerKey(2006); + await Utils.sleep(500); + await driver.triggerKey(2025); + await Utils.sleep(500); + await driver.triggerKey(2006); + await Utils.sleep(500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0730 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0730 + * @tc.desc Search字符间距,不同字符间距的输入框,拖拽、粘贴文本 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0730', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0730"); + await Utils.sleep(1000); + let driver = Driver.create(); + let searchA = await driver.findComponent(ON.id('searchId1')); + await searchA.longClick(); + await Utils.sleep(2000); + let selectAAll: Component = await driver.findComponent(ON.text('全选')); + await selectAAll.click(); + await Utils.sleep(2000); + let copy: Component = await driver.findComponent(ON.text('复制')); + await copy.click(); + await Utils.sleep(2000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + let searchB = await driver.findComponent(ON.id('searchId2')); + await searchB.longClick(); + await Utils.sleep(3000); + let selectBAll: Component = await driver.findComponent(ON.text('粘贴')); + await selectBAll.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0770 + * @tc.name SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0770 + * @tc.desc Search字符间距,动态改变字体大小 + */ + it('SUB_ACE_UI_COMPONENT_LINEHEIGHT_DECORATION_LETTERSPACING_0770', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0770"); + await Utils.sleep(1000); + let driver = Driver.create(); + let search = await driver.findComponent(ON.id('searchId')); + await search.click(); + await driver.triggerKey(2024); + await Utils.sleep(500); + await driver.triggerKey(2010); + await Utils.sleep(500); + await driver.triggerKey(2050); + await Utils.sleep(500); + await driver.triggerKey(2006); + await Utils.sleep(500); + await driver.triggerKey(2025); + await Utils.sleep(500); + await driver.triggerKey(2006); + await Utils.sleep(500); + let spacingButton = await driver.findComponent(ON.id('spacingButtonId')); + await spacingButton.click(); + await spacingButton.click(); + await spacingButton.click(); + await spacingButton.click(); + await spacingButton.click(); + let fontButton = await driver.findComponent(ON.id('fontButtonId')); + await fontButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + await fontButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('2'); + await Utils.sleep(2000); + await fontButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot('3'); + await Utils.sleep(2000); + await fontButton.click(); + await Utils.sleep(700); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets index 60f88eae7f2cd19c24f4b358609875b5c652dbe9..e25cf5fcca30fa8ce8bef482f0cba9e5e666d8fc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridWaterFlowAdd() { describe('UIComponentListAndGridWaterFlowAdd', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets index 0bd9f7c778dbe844413096c0c1d2d53ffcbd3ec4..7cf64f077a95384888e1ccd2156d819a450d63ed 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentListAndGridWaterSections() { describe('UIComponentListAndGridWaterSections', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentMagnifyingGlassTest/UIComponentMagnifyingGlass.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentMagnifyingGlassTest/UIComponentMagnifyingGlass.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..284746a92912dc001cd816d102cf98ef69f3d85c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentMagnifyingGlassTest/UIComponentMagnifyingGlass.test.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Utils from '../model/Utils'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { KeyCode } from '@kit.InputKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' +import Logger from '../model/Logger'; + +export default function UIComponentMagnifyingGlass() { + describe('UIComponentMagnifyingGlass', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_MAGNIFYING_GLASS_0010 + * @tc.name SUB_ACE_UI_COMPONENT_MAGNIFYING_GLASS_0010 + * @tc.desc 输入框出现放大镜,继续输入字符 + */ + it('SUB_ACE_UI_COMPONENT_MAGNIFYING_GLASS_0010', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentMagnifyingGlass/UIComponentMagnifyingGlass0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button1 = await driver.findComponent(ON.id('UIComponentMagnifyingGlass0010_001')); + await button1.longClick(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_A); + await driver.triggerKey(KeyCode.KEYCODE_A); + await driver.triggerKey(KeyCode.KEYCODE_A); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets index 12e9b46a299fc7bf8c4a3c3f58caf88fc3e9c9d5..0ebea370ca41abeaa3e88729f22ca56b0c5c1a5f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -19,9 +19,57 @@ import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + export default function UIComponentNavModifier() { describe('UIComponentNavModifier', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets index 9c7a17f444b30e9d3ddceef1830970449312938a..6571e436e7fadf17bd198beced406830ac02d89f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsAction() { describe('UIComponentNavTabsAction', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets index e5dabdb4539a51fcdee9aad9e8d08db5c89be36e..886d1afbde81113b6990ebd476fbb86e211c1cfd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsBlurStyle() { describe('UIComponentNavTabsBlurStyle', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets index 764434b8c2b2c931b4e999d6ff9f380ce62b05fb..d08978185a58d988735012f263063cc449a6b02c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsCachedCount() { describe('UIComponentNavTabsCachedCount', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets index 2cf0a074255dab4bb0c450dc5eb0aca3e305bd01..9d9ca715187e5d79b7635f3e86f00314d7ee12cb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsContentAdapt() { describe('UIComponentNavTabsContentAdapt', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets index c40fb8c1875d17bc8c262d644cbe1c6663924561..bb729a9bb7252a4cbf8f073c6a123ecc8c9d05cc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsEdgeeffect() { describe('UIComponentNavTabsEdgeeffect', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets index 48b15dd262f8ad2dd0b7efab5b306eed1b0bdd05..1b07c238ec898368adc0ca60bdc29103d03ae38c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets @@ -18,10 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsExpandsafearea() { describe('UIComponentNavTabsExpandsafearea', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets index aad3189a1be0291fbf0d0170441db0c00781eb86..0e93a8e74b85a7a0634823be652746c1a791a3c8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsHeight() { describe('UIComponentNavTabsHeight', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets index ebabf71df0bd7811fd4ea809df34b7dce2e32766..cc2ef0b16ee7aa39e83586f3a467910dd09a04f3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsImproTrace() { describe('UIComponentNavTabsImproTrace', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets index e30fe0a5afa1508c0979cc14c8e1a4cf22feb6db..b69df1bf8dc9424e5d6114e55f0bd1d18dc7052f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsInterception() { describe('UIComponentNavTabsInterception', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets index 826714182f47bfdb0b6470b6407a34dc0c625ce6..d7965a2cb03639d81d714c965ae8b30853e883d3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,59 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + export default function UIComponentNavTabsInterface() { describe('UIComponentNavTabsInterface', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets index 66e339f31b8f9cc6d50f0b85ff6ea41ee5e74db9..7990d8bea8ab3b89d3b50c08b007d7bcc4b2cfda 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsMirror() { describe('UIComponentNavTabsMirror', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets index acfc595c35a3fcee873ac41bd734968ed43fc563..a7feff91723eed07b6fb3d483a3ad6e3f0caf186 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsOnWillShow() { describe('UIComponentNavTabsOnWillShow', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets index 577359a2b716e31c682a93610342017ec229f0fc..ea623c1906254b7c8740b987c0c9ee13c802eaa3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsSubTabbarStyle() { describe('UIComponentNavTabsSubTabbarStyle', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets index 54b79ec31f3f5ba9066214dd83618a1c419187a7..213118524ebc2672a18fa8e149506b71af0fe6ef 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentNavTabsWidth() { describe('UIComponentNavTabsWidth', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets index a86014eb02d477754646809d0d45533d8da4a822..a2b5ae8911cde9bd8c147362e0214cb153351d10 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,13 +18,59 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshAbility() { describe('UIComponentOtherRefreshAbility', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_OTHER_REFRESH_ABILITY_0080 * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets index 5982175f3a3a9ba4c186c19b9337d12d3bae81f1..c8c7f32eb19199747ab4dff9f62a4f5448988a8f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshInterAction() { describe('UIComponentOtherRefreshInterAction', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets index 5243db1f0b868ca6b54197d73bfb65d499e168e5..25b7b90fbdfd2b7eacb957b327322d87e46d300f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshInterface() { describe('UIComponentOtherRefreshInterface', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets index f1c73b54f9e9d514fe6d425f5bc1449316efd3d7..2e293c16e5c5cbe31533c83fdbe3ec4216d5af6f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,12 +18,58 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentOtherRefreshPromptText() { describe('UIComponentOtherRefreshPromptText', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_OTHER_REFRESH_PROMPTTEXT_0110 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxAttributeTest/UIComponentPopupBoxAttribute.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxAttributeTest/UIComponentPopupBoxAttribute.test.ets index 6a9868b22c0ccbf3c0ab3d0e84df9218e05bf226..55d8e020682e1bde09fe93b03b215c56fb40c478 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxAttributeTest/UIComponentPopupBoxAttribute.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxAttributeTest/UIComponentPopupBoxAttribute.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, expect, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, expect, 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' /* * Settings.createWindow(config.url): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' export default function UIComponentPopupBoxAttribute() { describe('UIComponentPopupBoxAttribute', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_POPUPBOX_ATTRIBUTE_0510 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test.ets index eb02ccf53794e15cc33243ad16576e4b5e7a0c72..5911454402b47a0b82403c686a47a2eefecc5726 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test.ets @@ -19,6 +19,8 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * @@ -38,7 +40,51 @@ import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' export default function UIComponentPopupBoxFullDialogInterface001() { describe('UIComponentPopupBoxFullDialogInterface001', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_POPUPBOX_FULLDIALOG_0350 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupInterfaceTest/UIComponentPopupBoxPopupInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupInterfaceTest/UIComponentPopupBoxPopupInterface001.test.ets index 049f8800687b8e445e67cb8225fdebada1034d31..797885dd235aec00c67e390bcfc13142f6a3482d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupInterfaceTest/UIComponentPopupBoxPopupInterface001.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupInterfaceTest/UIComponentPopupBoxPopupInterface001.test.ets @@ -19,6 +19,8 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * @@ -38,7 +40,51 @@ import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' export default function UIComponentPopupBoxPopupInterface001() { describe('UIComponentPopupBoxPopupInterface001', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_ANALYSE_UI_COMPONENT_POPUPBOX_POPUP_0020 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPromptToastSequenceTest/UIComponentPopupBoxPromptToastSequence.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPromptToastSequenceTest/UIComponentPopupBoxPromptToastSequence.test.ets index a5589bad6bf1432e1c40456152c8fb24fc1f4949..acecf84242900b051fb86580970757ec73cc0f18 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPromptToastSequenceTest/UIComponentPopupBoxPromptToastSequence.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPromptToastSequenceTest/UIComponentPopupBoxPromptToastSequence.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, expect, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, expect, 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' /* * Settings.createWindow(config.url): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' export default function UIComponentPopupBoxPromptToastSequence() { describe('UIComponentPopupBoxPromptToastSequence', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_Ul_COMPONENT_POPUPBOX_PROMPT_TOASTSEQUENCE_0020 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsPopupTest/UIComponentPopupBoxSpecificationsPopup.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsPopupTest/UIComponentPopupBoxSpecificationsPopup.test.ets index 4b584d61470bf4bdb306a6f24f40bfd5df091b91..c81a5f527bc6deec05c727420456044f307755de 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsPopupTest/UIComponentPopupBoxSpecificationsPopup.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsPopupTest/UIComponentPopupBoxSpecificationsPopup.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, expect, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, expect, 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' /* * Settings.createWindow(config.url): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' export default function UIComponentPopupBoxSpecificationsPopup() { describe('UIComponentPopupBoxSpecificationsPopup', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_POPUPBOX_SPECIFICATIONS_POPUP_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsShadowTest/UIComponentPopupBoxSpecificationsShadow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsShadowTest/UIComponentPopupBoxSpecificationsShadow.test.ets index d1ef9fb3eb5b5fd0fd601ff3a9108f0bbdf14aec..3e7b639d17eb72f375e7652c7adb3ebb78fc6b39 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsShadowTest/UIComponentPopupBoxSpecificationsShadow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsShadowTest/UIComponentPopupBoxSpecificationsShadow.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * Settings.createWindow(config.url): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' export default function UIComponentPopupBoxSpecificationsShadow() { describe('UIComponentPopupBoxSpecificationsShadow', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_POPUPBOX_SPECIFICATIONS_SHADOW_0200 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsTest/UIComponentPopupBoxSpecifications.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsTest/UIComponentPopupBoxSpecifications.test.ets index df8f62febaa7068ff33755e9427ac27829cdfb9c..df701a4c4129101a4636bc4609ecb41c24963a2d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsTest/UIComponentPopupBoxSpecifications.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxSpecificationsTest/UIComponentPopupBoxSpecifications.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * Settings.createWindow(config.url): @@ -38,6 +40,51 @@ export default function UIComponentPopupBoxSpecifications() { describe('UIComponentPopupBoxSpecifications', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_POPUPBOX_SPECIFICATIONS_0610 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test.ets index 4ba11fad1d659f692e0920ed9c71ee9f8e36897b..328ae4bb0198889c18717c968282bec6d7aee841 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test.ets @@ -21,6 +21,8 @@ import Utils from '../model/Utils' import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' import uiAppearance from '@ohos.uiAppearance' +import { i18n } from '@kit.LocalizationKit' + /* * * Settings.createWindow(config.url): @@ -39,7 +41,51 @@ import uiAppearance from '@ohos.uiAppearance' export default function UIComponentPopupBoxToastStyleInterface001() { describe('UIComponentPopupBoxToastStyleInterface001', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_Ul_COMPONENT_POPUPBOX_PROMPT_TOASTSTYLE_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupPromptInterfaceTest/UIComponentPopupPromptInterface001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupPromptInterfaceTest/UIComponentPopupPromptInterface001.test.ets index f6d927187a6c1ecb829392b3e1f08aeb7b95a4cb..a9bcaa8f8b2bae54f5809c081761087501e092fd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupPromptInterfaceTest/UIComponentPopupPromptInterface001.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupPromptInterfaceTest/UIComponentPopupPromptInterface001.test.ets @@ -19,6 +19,8 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * @@ -38,7 +40,51 @@ import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' export default function UIComponentPopupPromptInterface001() { describe('UIComponentPopupPromptInterface001', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_POPUPBOX_PROMPT_INTERFACE_0290 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxCalendarpickerInterfaceTest/UIComponentPopupboxCalendarpickerInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxCalendarpickerInterfaceTest/UIComponentPopupboxCalendarpickerInterface.test.ets index 56efac85bdcdde66b20abef1be9ebb5a36e2bfd4..a5461b03a1fe13622aa8531f6f5569d729c997de 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxCalendarpickerInterfaceTest/UIComponentPopupboxCalendarpickerInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxCalendarpickerInterfaceTest/UIComponentPopupboxCalendarpickerInterface.test.ets @@ -20,10 +20,57 @@ import Logger from '../model/Logger' import Utils from '../model/Utils' import { Driver, MouseButton, ON } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + export default function UIComponentPopupboxCalendarpickerInterface() { describe('UIComponentPopupboxCalendarpickerInterface', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_POPUPBOX_CALENDARPICKER_INTERFACE_0070 * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_CALENDARPICKER_INTERFACE_0070 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxDatepickerDialogLanguageHabitTest/UIComponentPopupboxDatepickerDialogLanguageHabit.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxDatepickerDialogLanguageHabitTest/UIComponentPopupboxDatepickerDialogLanguageHabit.test.ets index e7bd7e98d0e917bfce122b159cc5e012722dc7cd..eec40787d10cd7fcde3a7ae775e877a4765d2a85 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxDatepickerDialogLanguageHabitTest/UIComponentPopupboxDatepickerDialogLanguageHabit.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxDatepickerDialogLanguageHabitTest/UIComponentPopupboxDatepickerDialogLanguageHabit.test.ets @@ -19,11 +19,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Driver, MouseButton, ON } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentPopupboxDatepickerDialogLanguageHabit() { describe('UIComponentPopupboxDatepickerDialogLanguageHabit', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_POPUPBOX_DATEPICKERDIALOG_LANGUAGEHABIT_0050 * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_DATEPICKERDIALOG_LANGUAGEHABIT_0050 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRichEditorSymbolShuffleEditingTest/UIComponentRichEditorSymbolShuffleEditing.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRichEditorSymbolShuffleEditingTest/UIComponentRichEditorSymbolShuffleEditing.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1913a4432f6c288ffeb788a332a7dd65c53c1de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentRichEditorSymbolShuffleEditingTest/UIComponentRichEditorSymbolShuffleEditing.test.ets @@ -0,0 +1,358 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, ON, Component, Point, Rect } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentRichEditorSymbolShuffleEditing() { + describe('UIComponentRichEditorSymbolShuffleEditing', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0240 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0240 + * @tc.desc 添加symbolspan,动态切换effectStrategy + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0240 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing024"); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + const driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing024_001')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + 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_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0260 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0260 + * @tc.desc 更新symbolspan属性,动态切换start、end + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0260 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing026"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let updateButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing026_001')); + //start与end一致 + let button2: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing026_002')); + await button2.click(); + await Utils.sleep(1000); + await updateButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot('1'); + await Utils.sleep(1000); + //start为负数 + let button3: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing026_003')); + await button3.click(); + await Utils.sleep(1000); + await updateButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot('2'); + await Utils.sleep(1000); + //end超出最大长度 + let button4: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing026_004')); + await button4.click(); + await Utils.sleep(1000); + await updateButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0270 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0270 + * @tc.desc 手势选中,更新symbolspan属性 + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0270 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing027"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let richEditor: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing027_002')); + let setButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing027_001')); + let updateButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing027_003')); + await richEditor.click(); + await Utils.sleep(1000); + await setButton.click(); + await Utils.sleep(1000); + await updateButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0280 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0280 + * @tc.desc 动态改变start、end,删除内容 + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0280 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing028"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let deleteButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing028_001')); + //start与end一致 + let button2: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing028_002')); + await button2.click(); + await Utils.sleep(1000); + await deleteButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot('1'); + await Utils.sleep(1000); + //start为负数 + let button3: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing028_003')); + await button3.click(); + await Utils.sleep(1000); + await deleteButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot('2'); + await Utils.sleep(1000); + //end超出最大长度 + let button4: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing028_004')); + await button4.click(); + await Utils.sleep(1000); + await deleteButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0290 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0290 + * @tc.desc 手势选中,删除内容 + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0290 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing029"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let richEditor: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing029_002')); + let setButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing029_001')); + let deleteButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing029_003')); + await richEditor.click(); + await Utils.sleep(1000); + await setButton.click(); + await Utils.sleep(1000); + await deleteButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0300 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0300 + * @tc.desc 动态改变start、end,获取内容 + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0300 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing030"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + let getButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing030_001')); + //start与end一致 + let button2: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing030_002')); + await button2.click(); + await Utils.sleep(1000); + await getButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot('1'); + await Utils.sleep(1000); + //start为负数 + let button3: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing030_003')); + await button3.click(); + await Utils.sleep(1000); + await getButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot('2'); + await Utils.sleep(1000); + //end超出最大长度 + let button4: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing030_004')); + await button4.click(); + await Utils.sleep(1000); + await getButton.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0320 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0320 + * @tc.desc 对symbolspan进行增删改查 + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0320 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing032"); + await Utils.sleep(1000); + const driver = Driver.create(); + let addTextButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing032_001')); + await addTextButton.click(); + let addImageButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing032_002')); + await addImageButton.click(); + await Utils.sleep(100); + windowSnap.snapShot('1'); + await Utils.sleep(1000); + let addSymbolButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing032_003')); + await addSymbolButton.click(); + await Utils.sleep(100); + windowSnap.snapShot('2'); + await Utils.sleep(1000); + let updateSymbolButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing032_004')); + await updateSymbolButton.click(); + await Utils.sleep(100); + windowSnap.snapShot('3'); + await Utils.sleep(1000); + let deleteSymbolButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing032_005')); + await deleteSymbolButton.click(); + await Utils.sleep(100); + windowSnap.snapShot('4'); + await Utils.sleep(1000); + let getSymbolButton: Component = await driver.findComponent(ON.id('UIComponentRichEditorSymbolShuffleEditing032_006')); + await getSymbolButton.click(); + await Utils.sleep(100); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0310 + * @tc.name SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0310 + * @tc.desc 获取选中位置的内容 + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0320 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing0310"); + await Utils.sleep(1000); + const driver = Driver.create(); + let addTextButton: Component = await driver.findComponent(ON.id('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0310_button')); + await addTextButton.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_symbol_symbol_COLOURRENDERING_011 +* @tc.name SUB_ACE_UI_COMPONENT_symbol_symbol_COLOURRENDERING_011 +* @tc.desc 获焦在searchbutton键上 +*/ + it('SUB_ACE_UI_COMPONENT_symbol_symbol_COLOURRENDERING_011', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_symbol_symbol_COLOURRENDERING_011 start.`); + Settings.createWindow("testability/pages/UIComponentRichEditorSymbolShuffleEditing/UiComponentSymbolSymbolColoirrendering011"); + await Utils.sleep(1000); + const driver = Driver.create(); + let addTextButton: Component = await driver.findComponent(ON.id('UiComponentSymbolSymbolColoirrendering011_button')); + await addTextButton.click(); + await Utils.sleep(500); + await addTextButton.click(); + await Utils.sleep(500); + await addTextButton.click(); + await addTextButton.click(); + windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + }) + + + + + + + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperAcrossTest/UIComponentScrollSwiperAcross.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperAcrossTest/UIComponentScrollSwiperAcross.test.ets index 77c7949e6e7fe062286012c99cf86d77ba3f1087..ed27c05f6e4cd91a68f39cddfc68b019a2c08e44 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperAcrossTest/UIComponentScrollSwiperAcross.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperAcrossTest/UIComponentScrollSwiperAcross.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,9 +18,56 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON, PointerMatrix } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperAcross() { describe('UIComponentScrollSwiperAcross', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_ACROSS_0010 */ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperArrowHeadTest/UIComponentScrollSwiperArrowHead.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperArrowHeadTest/UIComponentScrollSwiperArrowHead.test.ets index 1169f15bc574347f786ff4b08e067cb9c29150c0..7627c6e3acaf023a6d2ba151e453e81a0ad8f567 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperArrowHeadTest/UIComponentScrollSwiperArrowHead.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperArrowHeadTest/UIComponentScrollSwiperArrowHead.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,10 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, ON, MouseButton, PointerMatrix } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperArrowHead() { describe('UIComponentScrollSwiperArrowHead', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_ARROWHEAD_0010', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_ARROWHEAD_0010 start.`); Settings.createWindow("testability/pages/UIComponentScrollSwiperArrowHead/UIComponentScrollSwiperArrowHead0010") diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperDisplaycountTest/UIComponentScrollSwiperDisplaycount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperDisplaycountTest/UIComponentScrollSwiperDisplaycount.test.ets index d814c97a0e1cfcd9e1d41e2ad91f718b472128da..ca1d8d5f9990a34797a5311ca62e8ff6d8166784 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperDisplaycountTest/UIComponentScrollSwiperDisplaycount.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperDisplaycountTest/UIComponentScrollSwiperDisplaycount.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,9 +18,56 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON, PointerMatrix } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperDisplaycount() { describe('UIComponentScrollSwiperDisplaycount', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_DISPLAYCOUNT_0140 */ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperInterfaceTest/UIComponentScrollSwiperInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperInterfaceTest/UIComponentScrollSwiperInterface.test.ets index 3611b9713ea70203d241ba3138eefe536e5adbcd..ea509358cf769ef1e20cbf36ffbdb9cb5a8ca4d3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperInterfaceTest/UIComponentScrollSwiperInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperInterfaceTest/UIComponentScrollSwiperInterface.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,9 +18,56 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON, PointerMatrix } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperInterface() { describe('UIComponentScrollSwiperInterface', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_INTERFACE_0040', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_INTERFACE_0040 start.`); Settings.createWindow("testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0040") diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperLayoutTest/UIComponentScrollSwiperLayout.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperLayoutTest/UIComponentScrollSwiperLayout.test.ets index 445abeb08c950163382684dac11f370114b09185..5c6f5ece8024b724aa98878240eebde74a18036a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperLayoutTest/UIComponentScrollSwiperLayout.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperLayoutTest/UIComponentScrollSwiperLayout.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,9 +18,56 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { UiComponent, Component, Driver, ON, BY, MouseButton } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperLayout() { describe('UIComponentScrollSwiperLayout', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_LAYOUT_0010 * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_LAYOUT_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets index 45774daa06b73cc24a86ec09b5236769d0be1526..4aa897e23ec2bee57748494c1bba989a590751a1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperTeaceTest/UIComponentScrollSwiperTeace.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,9 +18,56 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON, PointerMatrix } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperTeace() { describe('UIComponentScrollSwiperTeace', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0070 */ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperUxTest/UIComponentScrollSwiperUx.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperUxTest/UIComponentScrollSwiperUx.test.ets index 47cb0da7dbf8ad263f98c1a06e64617a281db99f..caf03918172f3c44f521be571a8bdd06c9ef3249 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperUxTest/UIComponentScrollSwiperUx.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperUxTest/UIComponentScrollSwiperUx.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,10 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON, PointerMatrix } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentScrollSwiperUx() { describe('UIComponentScrollSwiperUx', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_UX_0520 */ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSearchSearchUxconsistencyTest/UIComponentSearchSearchUxconsistency.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSearchSearchUxconsistencyTest/UIComponentSearchSearchUxconsistency.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e59842ac46e643794aae53cc0c1a268c83da908a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSearchSearchUxconsistencyTest/UIComponentSearchSearchUxconsistency.test.ets @@ -0,0 +1,281 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Driver } from '@ohos.UiTest'; +import systemCapability from '@ohos.systemCapability'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentSearchSearchUxconsistency() { + describe('UIComponentSearchSearchUxconsistency', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_SEARCH_SEARCH_UXCONSISTENCY_001 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_001 + * @tc.desc 初始焦点在search上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_001', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_001 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency001"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 3; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_001 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_002 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_002 + * @tc.desc 初始焦点在删除键上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_002', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_002 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency002"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 2; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_002 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_003 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_003 + * @tc.desc 初始焦点在文本上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_003', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_003 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency003"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + driver.triggerKey(2049); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_003 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_004 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_004 + * @tc.desc 初始焦点落在search上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_004', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_004 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency004"); + const driver = Driver.create(); + for (let i = 0; i < 8; i++) { + await Utils.sleep(1000); + await driver.triggerKey(2049); //tab; + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_004 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_005 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_005 + * @tc.desc 初始焦点落在删除键上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_005', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_005 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency005"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 7; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); //tab; + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_005 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_006 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_006 + * @tc.desc 初始焦点落在文本上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_006', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_006 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency006"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 4; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); //tab; + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_006 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_007 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_007 + * @tc.desc 初始焦点落在文本内容上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_007', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_007 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency007"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 6; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); //tab; + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_007 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_008 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_008 + * @tc.desc 初始获焦焦点落在search上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_008', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_008 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency008"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 2; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); //tab; + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_008 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_009 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_009 + * @tc.desc 初始获焦焦点落在文本上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_009', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_009 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency009"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 3; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); //tab; + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_009 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_010 + * @tc.name SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_010 + * @tc.desc 多行搜索框初始焦点落在文本上 + */ + it('SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_010 start.`); + Settings.createWindow("testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency010"); + await Utils.sleep(1000); + const driver = Driver.create(); + for (let i = 0; i < 9; i++) { + await Utils.sleep(1000); + driver.triggerKey(2049); //tab; + } + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SEARCH_SEARCH_UXCONSISTENCY_010 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSoftKeyBoardOptimizeTest/UIComponentSoftKeyBoardOptimize.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSoftKeyBoardOptimizeTest/UIComponentSoftKeyBoardOptimize.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ddf0da93d49718c820b7f45fb17eeedf57c16e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSoftKeyBoardOptimizeTest/UIComponentSoftKeyBoardOptimize.test.ets @@ -0,0 +1,876 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { router } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentSoftKeyBoardOptimize() { + describe('UIComponentSoftKeyBoardOptimize', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_SOFTKEYBOARD_OPTIMIZE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0010 + * @tc.desc 应用内,同一页面,组件内切换焦点,系统键盘切换到自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0010"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0020 + * @tc.desc 应用内,同一页面,组件内切换焦点,自定义键盘切换到自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + let textInputC: Component = await driver.findComponent(ON.id('TextInputC')); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + await textInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0030 + * @tc.desc 应用内,同一页面,组件内切换焦点,自定义键盘切换到系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0030"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputC: Component = await driver.findComponent(ON.id('TextInputC')); + let textInputD: Component = await driver.findComponent(ON.id('TextInputD')); + await textInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + await textInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0040 + * @tc.desc 应用内,同一页面,组件内切换焦点,系统键盘切换到系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0040"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputD: Component = await driver.findComponent(ON.id('TextInputD')); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0050 + * @tc.desc 应用内,不同页面间切换,页面1的系统盘切换到页面2系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0050"); + let driver1: Driver = Driver.create(); + let textInputA: Component = await driver1.findComponent(ON.id('TextInputA')); + await Utils.sleep(1000); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0050' + }); + let driver2: Driver = Driver.create(); + let textInputD: Component = await driver2.findComponent(ON.id('TextInputD')); + await textInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0060 + * @tc.desc 应用内,不同页面间切换,页面1的自定义键盘切换到页面2自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0060"); + let driver1: Driver = Driver.create(); + let textInputB: Component = await driver1.findComponent(ON.id('TextInputB')); + await Utils.sleep(1000); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0060' + }); + let driver2: Driver = Driver.create(); + let textInputC: Component = await driver2.findComponent(ON.id('TextInputC')); + await textInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0070 + * @tc.desc 应用内,不同页面间切换,页面1的系统键盘切换到页面2自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0070"); + let driver1: Driver = Driver.create(); + let textInputD: Component = await driver1.findComponent(ON.id('TextInputD')); + await Utils.sleep(1000); + textInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0070' + }); + let driver2: Driver = Driver.create(); + let textInputB: Component = await driver2.findComponent(ON.id('TextInputB')); + textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0080 + * @tc.desc 应用内,不同页面间切换,页面1的自定义键盘切换到页面2系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0080"); + let driver1: Driver = Driver.create(); + let textInputC: Component = await driver1.findComponent(ON.id('TextInputC')); + await Utils.sleep(1000); + await textInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0080' + }); + let driver2: Driver = Driver.create(); + let textInputD: Component = await driver2.findComponent(ON.id('TextInputD')); + await textInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0090 + * @tc.desc 应用内,不同页面间切换,页面2的自定义键盘切换到页面3非输入框 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0090 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0090"); + let driver1: Driver = Driver.create(); + let textInputC: Component = await driver1.findComponent(ON.id('TextInputC')); + await Utils.sleep(1000); + await textInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton' + }); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0100 + * @tc.desc 应用内,不同页面间切换,页面1的系统键盘切换到页面3非输入框 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0100"); + let driver1: Driver = Driver.create(); + let textInputA: Component = await driver1.findComponent(ON.id('TextInputA')); + await Utils.sleep(1000); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton' + }); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0110 + * @tc.desc 应用内,不同页面间切换,页面3的无键盘切换到页面1系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0110 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton"); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0110' + }); + let driver1: Driver = Driver.create(); + let textInputA: Component = await driver1.findComponent(ON.id('TextInputA')); + await Utils.sleep(1000); + await textInputA.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0120 + * @tc.desc 应用内,不同页面间切换,页面3的无键盘切换到页面2自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0120 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton"); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0120' + }); + let driver1: Driver = Driver.create(); + let textInputB: Component = await driver1.findComponent(ON.id('TextInputB')); + await Utils.sleep(1000); + await textInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0200 + * @tc.desc 应用与窗口之间切换焦点,应用拉起输入法,窗口获焦使用输入法 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0200 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0200"); + let driver1: Driver = Driver.create(); + let textInputA: Component = await driver1.findComponent(ON.id('TextInputA')); + await Utils.sleep(1000); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup' + }); + let driver2: Driver = Driver.create(); + let textInputB: Component = await driver2.findComponent(ON.id('TextInputB')); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0210 + * @tc.desc 应用与窗口之间切换焦点,应用拉起输入法,窗口获焦不使用输入法 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0210 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0210"); + let driver1: Driver = Driver.create(); + let textInputA: Component = await driver1.findComponent(ON.id('TextInputA')); + await Utils.sleep(1000); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton' + }); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0220 + * @tc.desc 应用与窗口之间切换焦点,窗口拉起输入法,应用获焦使用输入法 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0220 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup",); + let driver2: Driver = Driver.create(); + let textInputB: Component = await driver2.findComponent(ON.id('TextInputB')); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0220' + }); + let driver1: Driver = Driver.create(); + let textInputA: Component = await driver1.findComponent(ON.id('TextInputA')); + await Utils.sleep(1000); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0230 + * @tc.desc 应用与窗口之间切换焦点,窗口拉起输入法,应用获焦不使用输入法 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0230 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup"); + let driver2: Driver = Driver.create(); + let textInputB: Component = await driver2.findComponent(ON.id('TextInputB')); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0230' + }); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0240 + * @tc.desc 应用与窗口之间切换焦点,应用未拉起输入法,窗口获焦使用输入法 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0240 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0240"); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup' + }); + let driver2: Driver = Driver.create(); + let textInputB: Component = await driver2.findComponent(ON.id('TextInputB')); + await textInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0250 + * @tc.desc 应用与窗口之间切换焦点,窗口未拉起输入法,应用获焦使用输入法 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0250 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton"); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0250' + }); + let driver2: Driver = Driver.create(); + let textInputA: Component = await driver2.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0520 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0520 + * @tc.desc dialog页面,应用内切换焦点,页面组件系统键盘切换到dialog组件系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0520 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0520"); + let driver2: Driver = Driver.create(); + let textInputA: Component = await driver2.findComponent(ON.id('TextInputA')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputA.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + let dialogTextInputD: Component = await driver2.findComponent(ON.id('dialogTextInputD')); + await dialogTextInputD.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0520 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0530 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0530 + * @tc.desc dialog页面,应用内切换焦点,页面组件自定义键盘切换到dialog组件自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0530 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0530"); + let driver2: Driver = Driver.create(); + let textInputB: Component = await driver2.findComponent(ON.id('TextInputB')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(1000); + let dialogTextInputC: Component = await driver2.findComponent(ON.id('dialogTextInputC')); + await dialogTextInputC.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0530 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0540 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0540 + * @tc.desc dialog页面,应用内切换焦点,页面组件系统键盘切换到dialog组件自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0540 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0540"); + let driver2: Driver = Driver.create(); + let textInputD: Component = await driver2.findComponent(ON.id('TextInputD')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(1000); + let dialogTextInputB: Component = await driver2.findComponent(ON.id('dialogTextInputB')); + await dialogTextInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0540 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0550 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0550 + * @tc.desc dialog页面,应用内切换焦点,页面组件自定义键盘切换到dialog组件系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0550 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0550"); + let driver2: Driver = Driver.create(); + let textInputC: Component = await driver2.findComponent(ON.id('TextInputC')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(1000); + let dialogTextInputD: Component = await driver2.findComponent(ON.id('dialogTextInputD')); + await dialogTextInputD.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0550 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0560 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0560 + * @tc.desc dialog页面,应用内切换焦点,dialog组件自定义键盘切换到页面3不需要键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0560 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0560"); + let driver2: Driver = Driver.create(); + let button: Component = await driver2.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let dialogtextInputC: Component = await driver2.findComponent(ON.id('dialogTextInputC')); + await dialogtextInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton' + }); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0560 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0570 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0570 + * @tc.desc dialog页面,应用内切换焦点,dialog组件系统键盘切换到页面3不需要键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0570 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0570"); + let driver2: Driver = Driver.create(); + let button: Component = await driver2.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let dialogtextInputD: Component = await driver2.findComponent(ON.id('dialogTextInputD')); + await dialogtextInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(2000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton' + }); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0570 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0400 + * @tc.desc popup页面,应用内切换焦点,页面组件系统键盘切换到popup组件系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0400 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0400"); + let driver2: Driver = Driver.create(); + let textInputA: Component = await driver2.findComponent(ON.id('TextInputA')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(1000); + let popupInputD: Component = await driver2.findComponent(ON.id('popupTextInputD')); + await popupInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0400 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0410 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0410 + * @tc.desc popup页面,应用内切换焦点,页面组件自定义键盘切换到popup组件自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0410 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0410"); + let driver2: Driver = Driver.create(); + let textInputB: Component = await driver2.findComponent(ON.id('TextInputB')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(2000); + let popupInputC: Component = await driver2.findComponent(ON.id('popupTextInputC')); + await popupInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0410 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0420 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0420 + * @tc.desc popup页面,应用内切换焦点,页面组件系统键盘切换到popup组件自定义键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0420 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0420"); + let driver2: Driver = Driver.create(); + let textInputD: Component = await driver2.findComponent(ON.id('TextInputD')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(2000); + let popupInputB: Component = await driver2.findComponent(ON.id('popupTextInputB')); + await popupInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0420 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0430 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0430 + * @tc.desc popup页面,应用内切换焦点,页面组件自定义键盘切换到popup组件系统键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0430 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0430"); + let driver2: Driver = Driver.create(); + let textInputC: Component = await driver2.findComponent(ON.id('TextInputC')); + let button: Component = await driver2.findComponent(ON.id('button')); + await textInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('2'); + await Utils.sleep(1000); + let popupInputD: Component = await driver2.findComponent(ON.id('popupTextInputD')); + await popupInputD.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0430 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0440 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0440 + * @tc.desc popup页面,应用内切换焦点,popup组件自定义键盘切换到页面3不需要键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0430 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0440"); + let driver2: Driver = Driver.create(); + let button: Component = await driver2.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let popupInputC: Component = await driver2.findComponent(ON.id('popupTextInputC')); + await popupInputC.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton' + }); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0440 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0450 + * @tc.name SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0450 + * @tc.desc popup页面,应用内切换焦点,popup组件系统键盘切换到页面3不需要键盘 + */ + it('SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0450 start.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0450"); + let driver2: Driver = Driver.create(); + let button: Component = await driver2.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let popupInputD: Component = await driver2.findComponent(ON.id('popupTextInputD')); + await popupInputD.click(); + await Utils.sleep(1000); + await windowSnap.snapShot('1'); + await Utils.sleep(1000); + router.pushUrl({ + url: 'testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton' + }); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SOFTKEYBOARD_OPTIMIZE_0450 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpanBaselineoffsetTest/UIComponentSpanBaselineoffset.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpanBaselineoffsetTest/UIComponentSpanBaselineoffset.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bee3d3086b55f938a679158fe7a04d26a48ac57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpanBaselineoffsetTest/UIComponentSpanBaselineoffset.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Driver } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentSpanBaselineoffset() { + describe('UIComponentSpanBaselineoffset', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_0150 + * @tc.name SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0150 + * @tc.desc ImageSpan设置padding,动态改变偏移量 + */ + it('SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0150 start.`); + Settings.createWindow("testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0150"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0160 + * @tc.name SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0160 + * @tc.desc 预览器测试 + */ + it('SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0160 start.`); + Settings.createWindow("testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0160"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0160 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFormComponentTransparentTest/UIComponentSpecialComponentsFormComponentTransparent.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFormComponentTransparentTest/UIComponentSpecialComponentsFormComponentTransparent.test.ets index 12c11f63f67cd94f3bfcf75b4f3b7c5f2f53145d..d92710f450d1cd149d34137be8be9831ad99edbe 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFormComponentTransparentTest/UIComponentSpecialComponentsFormComponentTransparent.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFormComponentTransparentTest/UIComponentSpecialComponentsFormComponentTransparent.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +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' /* * @@ -39,7 +41,51 @@ export default function UIComponentSpecialComponentsFormComponentTransparent() { describe('UIComponentSpecialComponentsFormComponentTransparent', () => { - + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_SPECIALCOMPONENTS_FORMCOMPONENT_TRANSPARENT_1260 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsUIExtensionComponentPopupChangeTest/UIComponentSpecialComponentsUIExtensionComponentPopupChange.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsUIExtensionComponentPopupChangeTest/UIComponentSpecialComponentsUIExtensionComponentPopupChange.test.ets index d0b2c2a21c446ab01b898448c730df1a43340e7d..b3edba5d3c1ad0ac3a4d09b9a15db6274998cd4f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsUIExtensionComponentPopupChangeTest/UIComponentSpecialComponentsUIExtensionComponentPopupChange.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsUIExtensionComponentPopupChangeTest/UIComponentSpecialComponentsUIExtensionComponentPopupChange.test.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium' +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' import Settings from '../model/Settings' import windowSnap from '../model/snapShot' import Logger from '../model/Logger' @@ -21,6 +21,8 @@ import Utils from '../model/Utils' import { Driver, ON } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' import Window from '@ohos.window' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * Settings.createWindow(config.url): @@ -39,7 +41,51 @@ import Window from '@ohos.window' export default function UIComponentSpecialComponentsUIExtensionComponentPopupChange() { describe('UIComponentSpecialComponentsUIExtensionComponentPopupChange', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_SPECIALCOMPONENTS_UIEXTENSIONCOMPONENT_POPUPCHANGE_0050 * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_UIEXTENSIONCOMPONENT_POPUPCHANGE_0050 @@ -129,7 +175,7 @@ export default function UIComponentSpecialComponentsUIExtensionComponentPopupCha await driver.findComponent(ON.id("UIComponentSpecialComponentsUIExtensionComponentPopupChange0020")); let pointButtonCenter = await ButtonCom.getBoundsCenter(); await driver.click(pointButtonCenter.x, pointButtonCenter.y); - await Utils.sleep(1000); + await Utils.sleep(3000); await driver.triggerKey(KeyCode.KEYCODE_A); await Utils.sleep(2000); windowSnap.snapShot(); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets index 17371bd33b6103d8cb1a19d02cc62a1ef53345e1..900b5d130fdf07fca761e5d8ff406ea0e4d11b5e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -18,11 +18,57 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' export default function UIComponentTabTabBarSymbol() { describe('UIComponentTabTabBarSymbol', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_TAB_TABBAR_TABBARSYMBOL_0040 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonClickTest/UIComponentTextCommonClick.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonClickTest/UIComponentTextCommonClick.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..663bb4755e414132c9bea50e4863f84a8f0c1eb6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommonClickTest/UIComponentTextCommonClick.test.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import text from '@ohos.graphics.text'; +import { Driver, ON } from '@kit.TestKit'; +import { Point } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextCommonClick() { + describe('UIComponentTextCommonClick', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090 + * @tc.desc ImageSpan设置padding,动态改变偏移量 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0090"); + await Utils.sleep(2000); + const driver = Driver.create(); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('textArea1')); + await Utils.sleep(1000); + let pointArea: Point = await textArea.getBoundsCenter() as Point; + for (let i = 0; i < 3; i++) { + await driver.click(pointArea.x, pointArea.y); + } + await textArea.inputText('英雄末路当磨折。莽红尘,何处觅知音?青衫湿!') + await Utils.sleep(1000); + for (let i = 0; i < 3; i++) { + await driver.click(pointArea.x, pointArea.y); + } + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100 + * @tc.desc ImageSpan设置padding,动态改变偏移量 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_CLICK_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0100"); + await Utils.sleep(2000); + const driver = Driver.create(); + await Utils.sleep(1000); + let textArea = await driver.findComponent(ON.id('textArea1')); + let text = await driver.findComponent(ON.id('text1')); + await Utils.sleep(1000); + let pointArea: Point = await textArea.getBoundsCenter() as Point; + for (let i = 0; i < 3; i++) { + await driver.click(pointArea.x, pointArea.y); + } + await text.click();//切换横竖屏幕 + await Utils.sleep(3000); + for (let i = 0; i < 3; i++) { + await driver.click(pointArea.x, pointArea.y); + } + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPAN_BASELINEOFFSET_0150 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..be00e938d69796e1c43ac4bd2d30514aadda10f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement.test.ets @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextCommontextMinfontSizeReplacement() { + describe('UIComponentTextCommontextMinfontSizeReplacement', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_TEXT_MINFONTSIZE_039 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_039 + * @tc.desc textInput + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_039', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_039.`); + Settings.createWindow("testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement039"); + await Utils.sleep(1000); + let driver = await Driver.create(); + let textInput = await driver.findComponent(ON.id('textinput')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_039 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_040 + * @tc.desc textInput + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_040.`); + Settings.createWindow("testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement040"); + await Utils.sleep(1000); + let driver = await Driver.create(); + let textInput = await driver.findComponent(ON.id('textinput')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_041 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_041 + * @tc.desc textInput + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_041', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_041.`); + Settings.createWindow("testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement041"); + await Utils.sleep(1000); + let driver = await Driver.create(); + let textInput = await driver.findComponent(ON.id('textinput')); + await textInput.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_TEXT_MINFONTSIZE_041 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkInterfaceTest/UIComponentTextHyperlinkInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkInterfaceTest/UIComponentTextHyperlinkInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e38352c57b9383fe097fb64184591b3cc7d7d22 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkInterfaceTest/UIComponentTextHyperlinkInterface.test.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 { 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, ON } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextHyperlinkInterface() { + describe('UIComponentTextHyperlinkInterface', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_INTERFACE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0110 + * @tc.desc 设置address异常值 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface011"); + await Utils.sleep(1000); + const driver = Driver.create(); + const hyperlink = await driver.findComponent(ON.id('UIComponentTextHyperlinkInterface011_001')); + hyperlink.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0120 + * @tc.desc 设置address为Resource类型 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface012"); + await Utils.sleep(1000); + const driver = Driver.create(); + const hyperlink = await driver.findComponent(ON.id('UIComponentTextHyperlinkInterface012_001')); + hyperlink.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0140 + * @tc.desc 设置enable参数 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface014"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_INTERFACE_0140 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkLayoutTest/UIComponentTextHyperlinkLayout.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkLayoutTest/UIComponentTextHyperlinkLayout.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..47046cfc902a7de93c944ce1cc7da60d16ba6738 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextHyperlinkLayoutTest/UIComponentTextHyperlinkLayout.test.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 { 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, ON } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextHyperlinkLayout() { + describe('UIComponentTextHyperlinkLayout', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_LAYOUT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_LAYOUT_0010 + * @tc.desc 多行span内含有超链接组件,可以正常跳转 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_LAYOUT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_LAYOUT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTextHyperlinkLayout/UIComponentTextHyperlinkLayout001"); + await Utils.sleep(1000); + const driver = Driver.create(); + const hyperlink = await driver.findComponent(ON.id('UIComponentTextHyperlinkLayout001_001')); + hyperlink.click(); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_HYPERLINK_LAYOUT_0010 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSupportfont/UIComponentTextSupportfont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSupportfont/UIComponentTextSupportfont.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..85433e5e5902e5df5bb3de763e7ac8586f35f4b8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextSupportfont/UIComponentTextSupportfont.test.ets @@ -0,0 +1,187 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextSupportfont() { + describe('UIComponentTextSupportfont', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0030 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0030.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0030"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0040 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0040.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0040"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0050 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0050.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0050"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0050 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0060 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0060.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0060"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0070 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0070.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0070"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0080 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0080.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0080"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0080 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0090 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0090.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0090"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0090 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0100 + * @tc.desc text + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0100.`); + Settings.createWindow("testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0100"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0100 finish.`); + 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..3719ae8b427a65173d38c17b29219f94dc3d6e75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextImageSpanAltTest/UIComponentTextTextImageSpanAlt.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 Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, ON } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0100 + * @tc.desc 主图设置网络图片,不联网时查看占位图显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt010"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0130 + * @tc.desc ImageSpan设置隐私遮罩后占位图不显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt013"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0150 + * @tc.desc 设置imagespan私有属性baselineOffset,textBackgroundstyle等,这些属性对占位图生效 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt015"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0160 + * @tc.desc 占位图使用PixelMap类型,图片格式为png、jpg、bmp、svg、gif + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt016"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1000); + const switchButton = await driver.findComponent(ON.id('UIComponentTextTextImageSpanAlt016_001')); + for (let index = 0; index < 5; index++) { + switchButton.click(); + await Utils.sleep(700); + if (index < 4) { + windowSnap.snapShot(`${index + 1}`); + await Utils.sleep(1000); + } + } + windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_IMAGESPAN_ALT_0160 finish.`); + 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..e56909fcf7202443b2aa3f2db243165fb4d98b7c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTextSupportfontTest/UIComponentTextTextSupportfont.test.ets @@ -0,0 +1,206 @@ + +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger'; +import Settings from '../model/Settings'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; +import { Driver, ON, Component } from '@ohos.UiTest'; +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; +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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0110 + * @tc.desc Text组件font不设置FontWeight,字体粗细默认FontWeight.Normal + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0110"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0120 + * @tc.desc Text组件weight设置FontWeight:设置Lighter,字体较细显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0120"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0130 + * @tc.desc Text组件weight设置FontWeight:设置Normal,字体粗细正常显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0130"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0140 + * @tc.desc Text组件weight设置FontWeight:设置Regular,字体粗细正常显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0140"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0150 + * @tc.desc Text组件weight设置FontWeight:设置Medium,字体粗细适中显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0150"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0160 + * @tc.desc Text组件weight设置FontWeight:设置Bold,字体较粗显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0160"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0160 finish.`); + done(); + }) + + /* + * @tc.number UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0340 + * @tc.name UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0340 + * @tc.desc Text组件style不设置,显示标准的字体样式 + */ + it('UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0340', 0, async (done: Function) => { + Logger.info('TEST', `UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0340 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0340"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0340 finish.`); + done(); + }) + + /* + * @tc.number UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0350 + * @tc.name UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0350 + * @tc.desc Text组件style设置Normal,显示标准的字体样式 + */ + it('UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0350', 0, async (done: Function) => { + Logger.info('TEST', `UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0350"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0350 finish.`); + done(); + }) + + /* + * @tc.number UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0360 + * @tc.name UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0360 + * @tc.desc Text组件style设置Italic,显示斜体的字体样式 + */ + it('UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0360', 0, async (done: Function) => { + Logger.info('TEST', `UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0360 start.`); + Settings.createWindow("testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0360"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `UB_ACE_UI_COMPONENT_TEXT_TEXT_SUPPORTFONT_0360 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..65d3674cc81fa6e65d281c3021d17738821a986d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTextTransparencyTest/UIComponentTextTransparency.test.ets @@ -0,0 +1,163 @@ + +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } 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, ON, Component } from '@ohos.UiTest'; +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentTextTransparencyTest () { + describe('UIComponentTextTransparencyTest', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0070 + * @tc.desc RichEditor组件,选中图片进行拖拽 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0070"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await driver.drag(vp2px(100), vp2px(100), vp2px(300), vp2px(600)) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0080 + * @tc.desc RichEditor组件,选中文字内容,发起拖拽 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0080"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await driver.drag(vp2px(100), vp2px(100), vp2px(300), vp2px(600)) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0090 + * @tc.desc RichBditor组件,选中图片和文字进行拖拽 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0090"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await driver.drag(vp2px(100), vp2px(100), vp2px(300), vp2px(600)) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0100 + * @tc.name SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0100 + * @tc.desc RichEditor组件,文本带有装饰线,选中带装饰线文本,发起拖拽 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0100 start.`); + Settings.createWindow("testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0100"); + await Utils.sleep(1000); + const driver = Driver.create(); + await Utils.sleep(1500); + const bt1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(500); + await bt1.click(); + await Utils.sleep(1000); + await driver.drag(vp2px(100), vp2px(100), vp2px(300), vp2px(600)) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TRANSPARENCY_0100 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..a247b43468f68fd8ca920e3d8ca104a3ccb8095a 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,33 +13,65 @@ * limitations under the License. */ -import { describe, afterEach, it } from '@ohos/hypium'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import Settings from '../model/Settings'; import windowSnap from '../model/snapShot'; import Logger from '../model/Logger'; import Utils from '../model/Utils'; import uiAppearance from '@ohos.uiAppearance'; -import { Driver ,ON } from '@ohos.UiTest' +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { BusinessError } from '@kit.BasicServicesKit'; -/* - * UIComponentUISupportColor - * - * Settings.createWindow(config.url): - * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 - * - * windowSnap.snapShot(globalThis.context): - * 窗口截屏&图片文件保存,存储在设备端 - * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 - * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 - * - * Logger日志使用方法: - * import Logger form './model/Logger' - * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) - * */ +import { i18n } from '@kit.LocalizationKit' 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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() + }) /* @@ -390,5 +422,332 @@ export default function UIComponentUISupportColor() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0950 finish.`); done(); }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1340 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1340 + * @tc.desc Search ThemColorMode LIGHT MODE to LIGHT MODE + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1340 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1340") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + await Utils.sleep(1000); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1340 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1350 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1350 + * @tc.desc Search ThemColorMode LIGHT MODE to DARK MODE + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1350 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1350") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + await Utils.sleep(1000); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1350 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1360 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1360 + * @tc.desc Search ThemColorMode DARK MODE to LIGHT MODE + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1360 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1360") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + await Utils.sleep(1000); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1360 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1370 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1370 + * @tc.desc Search ThemColorMode DARK MODE to DARK MODE + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1370 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1370") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + await Utils.sleep(1000); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1370 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1380 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1380 + * @tc.desc The component is fixed to use light mode. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1380 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1380") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + await Utils.sleep(1000); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1390 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1390 + * @tc.desc The component is fixed to use dark mode. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1380 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1390") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1400 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1400 + * @tc.desc The components change according to the dark and light color of the system + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1380 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1400") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1550 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1550 + * @tc.desc The component shows light mode and the layout is normal. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1550 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1550") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1550 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1560 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1560 + * @tc.desc The component interface switches from light mode to dark mode, and the layout is normal. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1560 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1560") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1560 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1570 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1570 + * @tc.desc The component mask switches to light mode, and the layout is normal. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1570 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1570") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1570 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1580 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1580 + * @tc.desc The component display interface is in dark mode, and the layout is normal. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1580 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1580") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1580 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1590 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1590 + * @tc.desc The component is fixed to use light mode. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1590 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1590") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1590 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1600 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1600 + * @tc.desc The component is fixed to use dark mode. + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1600 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1600") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1600 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1610 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1610 + * @tc.desc The components change according to the dark and light color of the system + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1610 start.`); + Settings.createWindow("testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1610") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + const driver: Driver = Driver.create(); + await windowSnap.snapShot("1"); + const changeLightBt: Component = await driver.findComponent(ON.id('change_theme_button')); + await Utils.sleep(1000) + await changeLightBt.click(); + await Utils.sleep(1000); + await windowSnap.snapShot("2"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1610 finish.`); + done() + }) }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..252211b4292f6fdff12a56f3f9a76edb9bce33c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList.test.ets @@ -0,0 +1,118 @@ + +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } 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, ON, Component } from '@ohos.UiTest'; +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentUiFontConfigFontList () { + describe('UIComponentUiFontConfigFontList', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_UIFONTCONFIG_FONTLIST_0010 + * @tc.name SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0010 + * @tc.desc 获取类型与系统类型一致,显示测试通过 + */ + it('SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0010"); + await Utils.sleep(1000); + const driver = Driver.create(); + const button = await driver.findComponent(ON.id('UIComponentUiFontConfigFontList0010_button')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `UIComponentUiFontConfigFontList0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0020 + * @tc.name SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0020 + * @tc.desc 查看log:获取到正确的系统字体 + */ + it('SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0020 start.`); + Settings.createWindow("testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0020"); + await Utils.sleep(1000); + const driver = Driver.create(); + const button = await driver.findComponent(ON.id('UIComponentUiFontConfigFontList0020_button')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UIFONTCONFIG_FONTLIST_0020 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITestCaseTest/UITestCaseTest.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITestCaseTest/UITestCaseTest.test.ets index 3eb298841d45ba5327799ebf74cac6a88d27c69a..410de2c5377300c6c14bbb025173fb0cee8f174f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITestCaseTest/UITestCaseTest.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UITestCaseTest/UITestCaseTest.test.ets @@ -13,12 +13,14 @@ * limitations under the License. */ -import { afterEach, describe, it } from '@ohos/hypium'; +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' /* * Settings.createWindow(config.url): @@ -38,7 +40,51 @@ import { Driver, ON } from '@ohos.UiTest'; export default function UITestCaseTest() { describe('UITestCaseTest', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number TestCase_6eb28b4e7e20410ea8a92fc7bb5809fc_1 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIWindowFocusSwitchTest/UIWindowFocusSwitch.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIWindowFocusSwitchTest/UIWindowFocusSwitch.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d61cc9ef2fe03b05b0f1063032bd9b60e2957de5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIWindowFocusSwitchTest/UIWindowFocusSwitch.test.ets @@ -0,0 +1,563 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON } from '@ohos.UiTest'; +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIWindowFocusSwitch() { + describe('UIWindowFocusSwitch', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_WINDOW_FOCUS_SWITCH_0010 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0010 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,输入框B需要软键盘 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0010 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0010"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputA.click(); + await Utils.sleep(1000); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0020 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0020 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,不需要拉起键盘 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0020 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0030 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0030 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,Normal类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0030 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0030"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0040 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0040 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,Password类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0040 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0040"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0050 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0050 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,Email类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0050 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0050"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0060 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0060 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,Nunber类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0060 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0060"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0070 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0070 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,PhoneNunber类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0070 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0070"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0080 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0080 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,USER_NANE类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0080 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0080"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0090 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0090 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,NEW_PASSWORD类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0090 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0090"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0100 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0100 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,NUMBER_PASSWORD类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0100 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0110 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0110 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextInput输入框,需要拉起键盘,SCREEN_LOCK_PASSWORD类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0110 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0110"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0120 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0120 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextArea输入框,需要拉起键盘,Normal类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0120 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0120"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0130 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0130 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextArea输入框,需要拉起键盘,Email类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0130 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0140 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0140 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextArea输入框,需要拉起键盘,Number类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0140 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0150 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0150 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,TextArea输入框,需要拉起键盘,PhoneNumber类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0150 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0160 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0160 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,Bearch输入框,需要拉起键盘,Normal类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0160 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0160"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0170 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0170 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,Search输入框,需要拉起键盘,Email类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0170 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0180 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0180 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,Search输入框,需要拉起键盘,Nunber类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0180 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0190 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0190 + * @tc.desc 应用内切换焦点,输入框A拉起软件盘,Search输入框,需要拉起键盘,PhoneNunber类型 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0190 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + await textInputA.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0200 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0200 + * @tc.desc 应用内切换焦点,输入框A拉起软键盘,输入框B需要自定义键盘 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0200 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputA.click(); + await Utils.sleep(1000); + await textInputB.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0210 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0210 + * @tc.desc 应用内切换焦点,输入框A拉起自定义键盘,输入框B需要软键盘 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0210 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputA.click(); + await Utils.sleep(1000); + await textInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0220 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0220 + * @tc.desc 应用内切换焦点,输入框A拉起自定义键盘,输入框B需要自定义键盘 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0220 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0220"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputA.click(); + await Utils.sleep(1000); + await textInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0230 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0230 + * @tc.desc 应用内切换焦点,TextInput输入框,不需要拉起键盘,输入框B需要自定义键盘 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0230 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0230"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0240 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0240 + * @tc.desc 应用内切换焦点,TextInput输入框,不需要拉起键盘,输入框B 需要软键盘 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0240 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0240"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0250 + * @tc.name SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0250 + * @tc.desc 应用内切换焦点,输入框位置偏下时,切换窗口获焦,键盘避让 + */ + it('SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0250 start.`); + Settings.createWindow("testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0250"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let textInputA: Component = await driver.findComponent(ON.id('TextInputA')); + let textInputB: Component = await driver.findComponent(ON.id('TextInputB')); + await textInputA.click(); + await Utils.sleep(1000); + await textInputB.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_WINDOW_FOCUS_SWITCH_0250 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectAlign/UiComponentButtonSelectAlign.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectAlign/UiComponentButtonSelectAlign.test.ets index a09b5277a3b64943ed6dd032dd72a0cf3d92d9ee..87db73a38eaaabbdd2075a1833c3ac3e06b2e9ad 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectAlign/UiComponentButtonSelectAlign.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectAlign/UiComponentButtonSelectAlign.test.ets @@ -19,6 +19,8 @@ import windowSnap from '../model/snapShot' import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * UiComponentButtonSelectAlign @@ -39,7 +41,51 @@ import { Component, Driver ,ON } from '@ohos.UiTest' export default function UiComponentButtonSelectAlign() { describe('UiComponentButtonSelectAlign', () => { - + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_BUTTON_SELECT_ALIGN_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement.test.ets index 4fbfa47e38af2ff483dc2cfc63041a4ea34fb578..b82454eab3eb64bcaef438b4a3b38d7131e63c69 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement.test.ets @@ -21,6 +21,8 @@ import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' import { KeyCode } from '@kit.InputKit' import Window from '@ohos.window' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * UiComponentButtonSelectEnhancement @@ -41,7 +43,51 @@ import Window from '@ohos.window' export default function UiComponentButtonSelectEnhancement() { describe('UiComponentButtonSelectEnhancement', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + 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_BUTTON_SELECT_ENHANCEMENT_0030 * @tc.name : SUB_ACE_UI_COMPONENT_BUTTON_SELECT_ENHANCEMENT_0030 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogInterface/UiComponentPopupboxDatePickerDialogInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogInterface/UiComponentPopupboxDatePickerDialogInterface.test.ets index bc20143f7a22bcbe35428a3620cd11a3941b5309..9b2601b9100b02c9e58f539d99f10cdd722b6537 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogInterface/UiComponentPopupboxDatePickerDialogInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogInterface/UiComponentPopupboxDatePickerDialogInterface.test.ets @@ -20,6 +20,8 @@ import Logger from '../model/Logger' import Utils from '../model/Utils' import { Driver, ON } from '@kit.TestKit' import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' /* * UiComponentPopupboxDatePickerDialogInterface @@ -40,7 +42,51 @@ import { KeyCode } from '@kit.InputKit' export default function UiComponentPopupboxDatePickerDialogInterface() { describe('UiComponentPopupboxDatePickerDialogInterface', () => { - + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_POPUPBOX_DATEPICKERDIALOG_INTERFACE_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogScenarios/UiComponentPopupboxDatePickerDialogScenarios.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogScenarios/UiComponentPopupboxDatePickerDialogScenarios.test.ets index b505ee8b3feae25d89a2138e5b25a5361f1c8eb8..1c92cb30584c86cf14b80f5941c4f79c3af13c3c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogScenarios/UiComponentPopupboxDatePickerDialogScenarios.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxDatePickerDialogScenarios/UiComponentPopupboxDatePickerDialogScenarios.test.ets @@ -23,6 +23,8 @@ import { KeyCode } from '@kit.InputKit' import { uiAppearance } from '@kit.ArkUI' import Window from '@ohos.window' +import { i18n } from '@kit.LocalizationKit' + /* * UiComponentPopupboxDatePickerDialogScenarios * @@ -42,7 +44,51 @@ import Window from '@ohos.window' export default function UiComponentPopupboxDatePickerDialogScenarios() { describe('UiComponentPopupboxDatePickerDialogScenarios', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_POPUPBOX_DATEPICKERDIALOG_SCENARIOS_0010 * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_DATEPICKERDIALOG_SCENARIOS_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxZero/UiComponentPopupboxZero.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxZero/UiComponentPopupboxZero.test.ets index e74f0b0b0a85f524fdef6269946388faeba8c80f..d9f0009675b7361e7ec89acee73c09d386029634 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxZero/UiComponentPopupboxZero.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxZero/UiComponentPopupboxZero.test.ets @@ -19,6 +19,8 @@ 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' /* * UiComponentPopupboxZero @@ -40,6 +42,51 @@ export default function UiComponentPopupboxZero() { describe('UiComponentPopupboxZero', () => { + 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; + } + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + 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_POPUPBOX_ZERO_0010 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Logger.ts b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Logger.ts index d8e65ace14fe8912c61a0b31c60ba5c767f116f1..af1e3824e9145fad9306c9ca13b3f73e8d6c8ad9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Logger.ts +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Logger.ts @@ -16,30 +16,30 @@ import hilog from '@ohos.hilog'; class Logger { - private domain: number; - private prefix: string; - private format: string = "%{public}s, %{public}s"; - - constructor(prefix: string) { - this.prefix = prefix; - this.domain = 0xFF00; - } - - debug(...args: any[]) { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: any[]) { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: any[]) { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: any[]) { - hilog.error(this.domain, this.prefix, this.format, args); - } + private domain: number; + private prefix: string; + private format: string = "%{public}s, %{public}s"; + + constructor(prefix: string) { + this.prefix = prefix; + this.domain = 0xFF00; + } + + debug(...args: any[]) { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]) { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]) { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]) { + hilog.error(this.domain, this.prefix, this.format, args); + } } -export default new Logger('[Screenshot]'); \ No newline at end of file +export default new Logger('[Screenshot]'); 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..1c9e29b3586f6fc9fd6e41e0fcb1c4e7fba4cb78 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 @@ -16,12 +16,14 @@ import screen from '@ohos.screen'; import window from '@ohos.window'; import Logger from './Logger'; -import { GlobalThis } from './globalThis' -import { BusinessError } from '@ohos.base' -import Window from '@ohos.window' +import { GlobalThis } from './globalThis'; +import { BusinessError } from '@ohos.base'; +import Window from '@ohos.window'; import common from '@ohos.app.ability.common'; import { i18n } from '@kit.LocalizationKit'; -import { router } from '@kit.ArkUI'; +import { router, uiAppearance } from '@kit.ArkUI'; +import { ConfigurationConstant } from '@kit.AbilityKit'; +import Utils from './Utils'; import { systemDateTime } from '@kit.BasicServicesKit'; const TAG: string = '[TEST]'; @@ -29,28 +31,28 @@ const TAG: string = '[TEST]'; async function sleep(time: number): Promise { const result: string = await new Promise((resolve: Function) => { setTimeout(() => { - resolve('sleep ok') - }, time) + resolve('sleep ok'); + }, time); }); console.info(result); } 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 portrait: boolean = true + 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) { //为悬浮窗设置位置 windowClass.moveWindowTo(X, Y, (err) => { if (err.code) { - Logger.error(TAG, `Failed to move the window. Cause : ${JSON.stringify(err)}`) + Logger.error(TAG, `Failed to move the window. Cause : ${JSON.stringify(err)}`); return; } Logger.info(TAG, 'Succeed moveWindowTo.'); @@ -61,7 +63,7 @@ class Settings { //为悬浮窗设置大小 windowClass.resize(width, height, (err) => { if (err.code) { - Logger.error(TAG, `Failed to change the window size. Cause : ${JSON.stringify(err)}`) + Logger.error(TAG, `Failed to change the window size. Cause : ${JSON.stringify(err)}`); return; } Logger.info(TAG, 'Succeed changeWindowSize'); @@ -72,15 +74,14 @@ class Settings { //为悬浮窗加载对应的目标页面 windowClass.setUIContent(pageURI, (err) => { if (err.code) { - Logger.error(TAG, `Failed to load the window. Cause : ${JSON.stringify(err)}`) + Logger.error(TAG, `Failed to load the window. Cause : ${JSON.stringify(err)}`); return; } Logger.info(TAG, `Succeeded in loading the content.`); - //显示悬浮窗 windowClass.showWindow((err) => { if (err.code) { - Logger.error(TAG, `Failed to show the window. Cause : ${JSON.stringify(err)}`) + Logger.error(TAG, `Failed to show the window. Cause : ${JSON.stringify(err)}`); return; } Logger.info(TAG, `Succeeded in showing the window.`); @@ -92,11 +93,10 @@ class Settings { //为悬浮窗加载对应的目标页面 windowClass.setUIContent(pageURI, (err) => { if (err.code) { - Logger.error(TAG, `Failed to load the window. Cause : ${JSON.stringify(err)}`) + Logger.error(TAG, `Failed to load the window. Cause : ${JSON.stringify(err)}`); return; } Logger.info(TAG, `Succeeded in loading the content.`); - }) } @@ -108,12 +108,11 @@ class Settings { return; } Logger.info(TAG, `Succeeded in getting all screens. Data:${JSON.stringify(data)}`); - screenClass = data[0]; //设置设备dpi screenClass.setDensityDpi(dpi, (err: BusinessError) => { if (err.code) { - Logger.error(TAG, `Failed to set the pixel density. Code : ${JSON.stringify(err)}`) + Logger.error(TAG, `Failed to set the pixel density. Code : ${JSON.stringify(err)}`); return; } Logger.info(TAG, `Succeeded in setting the pixel density`); @@ -125,7 +124,7 @@ class Settings { windowClass.setWindowSystemBarEnable(names, (err: BusinessError) => { const errCode: number = err.code; if (errCode) { - Logger.error(TAG, 'Failed to set the system bar to be invisible. Cause:' + JSON.stringify(err)) + Logger.error(TAG, 'Failed to set the system bar to be invisible. Cause:' + JSON.stringify(err)); return; } Logger.info(TAG, `Succeeded in set the system bar to be invisible`); @@ -145,6 +144,43 @@ class Settings { } } + async initEnv() { + let context = getContext() + let promise = await Window.getLastWindow(context); + let orientation = Window.Orientation.PORTRAIT; + try { + getContext().getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); + getContext(this).getApplicationContext().setLanguage('zh-Hans-CN'); + await promise.setPreferredOrientation(orientation); + Utils.sleep(1000); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (this.windowClass == undefined) { + return + } + + this.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); + } + /* * 窗口页面更新 * Setting.createWindow(pageURI: String, {X,Y,width,height,dpi}?:{X?:number,Y?:number,width?:number,height?:number,dpi?:number}):void 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..2d02986d8c4b624d9d90a19f98cb51172c2bf52d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -13,35 +13,27 @@ * limitations under the License. */ -import {Driver , ON} from '@ohos.UiTest' +import { Driver, ON } from '@ohos.UiTest'; export default class Utils { - - static async sleep(time : number) :Promise { - const result:string = await new Promise((resolve:Function)=>{ - setTimeout(()=> { - resolve('sleep ok') - },time) + static async sleep(time: number): Promise { + const result: string = await new Promise((resolve: Function) => { + setTimeout(() => { + resolve('sleep ok'); + }, time); }); console.info(result); } - static async waitAsync (ms:number):Promise{ - return new Promise((resolve)=>{ - setTimeout(resolve,ms) - }) + static async waitAsync(ms: number): Promise { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }) } - static async clickComponentByKey (componentKey :string){ - let driver = Driver.create(); - let component = await driver.findComponent(ON.id(componentKey)) - await component.click(); - + static async clickComponentByKey(componentKey: string) { + let driver = Driver.create(); + let component = await driver.findComponent(ON.id(componentKey)); + await component.click(); } - - } - - - - diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/globalThis.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/globalThis.ets index 1fa18fbd244d65f4c78213b89d9d01e29e01eae6..adffab9fbe3b12218449db00c2489ff00f3d1bcb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/globalThis.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/globalThis.ets @@ -13,37 +13,30 @@ * limitations under the License. */ -import common from '@ohos.app.ability.common' +import common from '@ohos.app.ability.common'; // 构造单例对象 - -export class GlobalThis { - +export class GlobalThis { private constructor() { } - private static instance:GlobalThis; - - private _uiContexts = new Map (); - - public static getInstance():GlobalThis { + private static instance: GlobalThis; + private _uiContexts = new Map(); + public static getInstance(): GlobalThis { if (!GlobalThis.instance) { - GlobalThis.instance = new GlobalThis(); - + GlobalThis.instance = new GlobalThis(); } - - return GlobalThis.instance - + return GlobalThis.instance; } - getContext(key:string):common.UIAbilityContext | undefined { + getContext(key: string): common.UIAbilityContext | undefined { return this._uiContexts.get(key); } - setContext(key:string, value:common.UIAbilityContext) :void { - this._uiContexts.set(key,value); + setContext(key: string, value: common.UIAbilityContext): void { + this._uiContexts.set(key, value); } // 其他需要传递的类依次扩展 -} \ No newline at end of file +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/snapShot.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/snapShot.ets index 773f21352336973e8a11bce347632a45bd62dd62..4f372d574556a4b8c2496fa872349e1f95c04cd3 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/snapShot.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/snapShot.ets @@ -17,17 +17,16 @@ import window from '@ohos.window'; import Logger from './Logger'; import image from '@ohos.multimedia.image'; import fs from '@ohos.file.fs'; -import common from '@ohos.app.ability.common' -import { GlobalThis } from './globalThis' -import screenshot from '@ohos.screenshot' -import { BusinessError } from '@ohos.base' +import common from '@ohos.app.ability.common'; +import { GlobalThis } from './globalThis'; +import screenshot from '@ohos.screenshot'; +import { BusinessError } from '@ohos.base'; import Settings from './Settings'; import { Driver } from '@kit.TestKit'; import { display } from '@kit.ArkUI'; const TAG: string = '[TEST]'; - class windowSnap { filePath(suffix: string, pageName ?: string) { let context: common.UIAbilityContext | undefined = GlobalThis.getInstance().getContext('context') @@ -41,46 +40,45 @@ class windowSnap { } let displayName = `IMG_${name}.${suffix}` let filePath: string = pathDir + "/" + displayName; - Logger.info(TAG, 'createFile filePath = ${filePath}') + Logger.info(TAG, 'createFile filePath = ${filePath}'); return filePath; - } async deleteFile(filePath: string) { - let exists = await fs.access(filePath) - Logger.info(TAG, `oldFile exists = ${exists}`) + let exists = await fs.access(filePath); + Logger.info(TAG, `oldFile exists = ${exists}`); if (exists) { - fs.unlinkSync(filePath) - Logger.info(TAG, `remove file succeed`) + fs.unlinkSync(filePath); + Logger.info(TAG, `remove file succeed`); } } createFile(filePath: string) { - return fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE) + return fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); } async save(filePath: string, data: image.PixelMap) { let packOpts: image.PackingOption = { format: "image/webp", quality: 100 } - let imagePackerApi = image.createImagePacker() - let arrayBuffer = await imagePackerApi.packing(data, packOpts) + let imagePackerApi = image.createImagePacker(); + let arrayBuffer = await imagePackerApi.packing(data, packOpts); let file: fs.File | null = null; while (file == null) { - file = this.createFile(filePath) + file = this.createFile(filePath); } - let exists = await fs.access(file.path) - Logger.info(TAG, `createFile exists = ${exists}`) - let fd = file.fd - Logger.info(TAG, `createFile fd = ${fd}`) - imagePackerApi.release() + let exists = await fs.access(file.path); + Logger.info(TAG, `createFile exists = ${exists}`); + let fd = file.fd; + Logger.info(TAG, `createFile fd = ${fd}`); + imagePackerApi.release(); try { - await fs.write(fd, arrayBuffer) + await fs.write(fd, arrayBuffer); } catch (err) { - Logger.error(TAG, `write failed code is ${err.code},message is ${err.message}`) + Logger.error(TAG, `write failed code is ${err.code},message is ${err.message}`); } - fs.closeSync(file) - Logger.info(TAG, `write picture done`) + fs.closeSync(file); + Logger.info(TAG, `write picture done`); } async saveLog(content: string, name: string) { @@ -265,4 +263,4 @@ class windowSnap { } } -export default new windowSnap() \ No newline at end of file +export default new windowSnap(); \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets index 5b2992dcb24394039f4c71907479c34895c1a73a..e605ef6c85de2e0535604686554f35d83763ad11 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -59,13 +59,27 @@ export default class TestAbility extends UIAbility { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); GlobalThis.getInstance().setContext("context", this.context) - windowStage.loadContent('testability/pages/Index', (err) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; + let atManager = abilityAccessCtrl.createAtManager(); + let appFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION; + let permissionFlags = 0; + bundleManager.getBundleInfoForSelf(appFlags, (err, data) => { + if (err) { + Logger.error(TAG, 'getAllApplicationInfo failed: %{public}s', err.message); + console.error("") } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); - }); + let tokenID = + data.appInfo.accessTokenId; //系统应用可以通过bundleManager.getApplicationInfo获取,普通应用可以通过bundleManager.getBundleInfoForSelf获取 + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.READ_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.WRITE_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + }) } onWindowStageDestroy() { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAiParticiple/UIAiParticiple0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAiParticiple/UIAiParticiple0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ee03246fc25de4985a2e36451cb3b1f8eafbc7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAiParticiple/UIAiParticiple0050.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 UIAiParticiple005 { + controller: RichEditorController = new RichEditorController() + option: RichEditorOptions = { controller: this.controller } + + build() { + Column() { + RichEditor(this.option) + .onReady(() => { + this.controller.addTextSpan( + '这是一个测试文本', + { + style: { fontColor: Color.Orange, fontSize: 30 } + } + ) + + this.controller.addImageSpan( + 'cat.jpg', + { + imageStyle: { size: ["150px", "150px"] } + } + ) + + }) + .backgroundColor(Color.Red) + .id('UIAiParticiple005_001') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAlertDialog/UIComponentPopupboxAlrertdialogInterface0660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAlertDialog/UIComponentPopupboxAlrertdialogInterface0660.ets new file mode 100644 index 0000000000000000000000000000000000000000..d155dcb3382124aa746ac8b5e0028a11e187b3e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAlertDialog/UIComponentPopupboxAlrertdialogInterface0660.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 UIComponentPopupboxAlrertdialogInterface0660 { + build() { + Row() { + Button('one button dialog') + .id('AlertDialogParamWithConfirm') + .onClick(() => { + AlertDialog.show( + { + title: 'title', + message: 'message', + confirm: { + value: getContext().resourceManager.getStringSync($r('app.string.message')), + action: () => { + console.info('Button-clicking callback') + } + }, + }) + }) + }.width('100%').justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIButton/UIComponentUIsupportColor0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIButton/UIComponentUIsupportColor0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..4eb19269760c93ac9531d5ceced02499b1fa3f2d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIButton/UIComponentUIsupportColor0130.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 UIComponentUIsupportColor0130 { + build() { + Column() { + // 设置组件为深色模式 + WithTheme({ colorMode: ThemeColorMode.DARK }) { + Column() { + Button('WithTheme 布局高度 30%') + .margin(20) + } + .height('30%') + .justifyContent(FlexAlign.Center) + .backgroundColor($r('sys.color.background_primary')) + } + } + .width('100%') + .height('100%') + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.END, SafeAreaEdge.BOTTOM, SafeAreaEdge.START]) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll.ets new file mode 100755 index 0000000000000000000000000000000000000000..f719cf1c1c636fd3272aba4048b07fe332650a78 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll.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 ComonentMediaImagespanError { + @State imageSpan :string = "图片状态" + @State src: ResourceStr | string= "ssssssssssssss"; + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Row({space:20}){ + Button('PNG').id("png").onClick(()=>{ + this.src = './resources/base/media/closeeye.png' + }) + Button('BMP').id("bmp").onClick(()=>{ + this.src = './resources/base/media/dragon.bmp' + }) + Button('SVG').id("svg").onClick(()=>{ + this.src = './resources/base/media/vegetable.svg' + }) + Button('GIF').id("gif").onClick(()=>{ + this.src = './resources/base/media/misato.gif' + }) + } + Text(this.imageSpan) + .width('100%') + .textAlign(TextAlign.Center) + Text() { + ImageSpan(this.src) + .objectFit(ImageFit.Fill) + .verticalAlign(ImageSpanAlignment.CENTER) + .width(300) + .height(300) + .onError((err)=>{ + console.log("onError:" + err.message) + this.imageSpan = err.message + }) + .onComplete((event)=>{ + console.log("loadingStatus: " + event.loadingStatus+",,contentWidth=="+event.contentWidth+",,contentHeight=="+event.contentHeight) + if (event.loadingStatus = 1) { + this.imageSpan = "contentWidth=="+event.contentWidth+",,contentHeight=="+event.contentHeight + } + }) + } + .width('100%').textAlign(TextAlign.Center) + .textIndent(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/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0020.ets index 8f94a66cdabdd87c205a1772b39b3a08779ec5aa..a5001f450a16a5ee8ae9874447f2fbc85b58f780 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0020.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0020.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0020 { - build() { Row() { Column() { @@ -29,7 +28,7 @@ struct UIComponentButtonSelectControlSize0020 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0030.ets index 677f4acaa42c15ec2652d317a55fe3cea889288e..fe009c2d3161107e545bef6e8457db0a7f17371d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0030.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0030.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0030 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0030 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0040.ets index 4e6852fff5aa3e56479faa4b8d21706919769fe1..3add37e2c5854f641a65876e9b1ee44f78095ffa 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0040.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0040.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0040 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0040 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0050.ets index 8af8a70b7c52193e608c310833b9d93cba4f91e8..bb2bd04649063b3e9bebfe5632d7e3cbb59751b6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0050.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0050.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0050 { - build() { Row() { Column() { @@ -39,7 +38,7 @@ struct UIComponentButtonSelectControlSize0050 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0060.ets index 920a0e924e58fe6fbf831f3e72e661bdafbddba6..f173b1b876f190be8603905cefc8c729402d7411 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0060.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0060.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0060 { - build() { Row() { Column() { @@ -32,7 +31,7 @@ struct UIComponentButtonSelectControlSize0060 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0070.ets index ab77b0dd7fc8ab46e3703150e0e4343d4c739264..7766c5c087e267742ed370c3669d05c978d6fbc2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0070.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0070.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0070 { - build() { Row() { Column() { @@ -29,7 +28,7 @@ struct UIComponentButtonSelectControlSize0070 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0080.ets index e6b928aa4374fb99ea58ba7fed4ff24219256a9d..854151e161bac1e6c6bb463639b2ac867071886d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0080.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0080.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0080 { - build() { Row() { Column() { @@ -28,7 +27,7 @@ struct UIComponentButtonSelectControlSize0080 { right: BorderStyle.Dashed, top: BorderStyle.Dashed, bottom: BorderStyle.Dashed - }) + }) } .width('100%') .height('100%') @@ -36,7 +35,7 @@ struct UIComponentButtonSelectControlSize0080 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0090.ets index 662f00e9b593f57035392f0eb90e33d31c6bd9f8..e1d108fca20497e56ae2625b9a1d2448fe33d450 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0090.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0090.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0090 { - build() { Row() { Column() { @@ -28,7 +27,7 @@ struct UIComponentButtonSelectControlSize0090 { right: BorderStyle.Solid, top: BorderStyle.Dotted, bottom: BorderStyle.Dashed - }) + }) } .width('100%') .height('100%') @@ -36,7 +35,7 @@ struct UIComponentButtonSelectControlSize0090 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0100.ets index 97e2d6db1cd6d506ac7e62dd155d0cd18576bd0f..134a6fbe887970d84f75c6d3a0e0372f16d151d0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0100.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0100.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0100 { - build() { Row() { Column() { @@ -34,7 +33,7 @@ struct UIComponentButtonSelectControlSize0100 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0110.ets index 3f2d24c293cd9da67b2229d14d7e9595a7838970..7b2fe27dad98b903fbc1005f30c04b12c7d3212b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0110.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0110.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0110 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0110 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0120.ets index b27e5fc6cc6f9bc6f6bc5ee9c4fc3d1c5510761f..373fe485dac160d937a7b59111c5dbf9e532ccbb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0120.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0120.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0120 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0120 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0130.ets index 781645c06a28b4514d1c673caf0ece7f54b0571c..ddd0e16e4a80dad4414358baa01c0de2ad9b855d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0130.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0130.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0130 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0130 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0140.ets index 58b8dfe9ddfba1c9c9537292e2c8a21be9020227..b28d626e2068a632b16569414d661efea60b42ad 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0140.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0140.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0140 { - build() { Row() { Column() { @@ -33,7 +32,7 @@ struct UIComponentButtonSelectControlSize0140 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0150.ets index 52c5fbc85daf6161168e9cd468cd5479726172f8..b0eded5806c4725cedc81a687c11b43e124d9323 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0150.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0150.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0150 { - build() { Row() { Column() { @@ -33,7 +32,7 @@ struct UIComponentButtonSelectControlSize0150 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0160.ets index 1a976f06c15fc0d737f3af612f6b70802d6859dc..b4fe74e6d9412ac8707f6610fd36c557f85a4031 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0160.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0160.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0160 { - build() { Row() { Column() { @@ -32,7 +31,7 @@ struct UIComponentButtonSelectControlSize0160 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0170.ets index 333f42417a212c78501ad2bcbbd6de8a3c6078d1..547b028b9dae70ee42fbda2b02650cf20adab8c1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0170.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0170.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0170 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0170 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0180.ets index 8f02a8d103b8843cd7b735011f269700343ce9b1..274457a9a1349f52011196c1adb1a8e5a6e578bf 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0180.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0180.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0180 { - build() { Row() { Column() { @@ -39,7 +38,7 @@ struct UIComponentButtonSelectControlSize0180 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0190.ets index a9dcdb2479eb284b9b985c08c4264fad49a724cb..f0b048c8f08d7fe53401c591f71604389b264738 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0190.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0190.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0190 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0190 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0200.ets index 35604723b14029f622c16ffe3241c9b02a4dc264..6624d807c6fbe5dba5edf66a84a9fdc65a2705d5 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0200.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0200.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0200 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -35,7 +36,7 @@ struct UIComponentButtonSelectControlSize0200 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0210.ets index 7552f1a5ce1ea32eead440a6d03302ff35095862..e38372460bc93a8d1208959465ebeeb6eae2d306 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0210.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0210.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0210 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -35,7 +36,7 @@ struct UIComponentButtonSelectControlSize0210 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0220.ets index 90fc8ed08252f3ba29d46fa12d3d1812a77418ae..aba553a5f6dcaeb777a0413df09dc82620fce265 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0220.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0220.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0220 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -34,7 +35,7 @@ struct UIComponentButtonSelectControlSize0220 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0230.ets index 00a103d33f4c90be2ec24116d14bedff573645ad..36832ffcffc09573b330218ecf79cf5994d66427 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0230.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0230.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0230 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0230 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0240.ets index 376f2a5c4f79ba47d9247705ae1023d41abcf50f..994acaef278f4754875d789218dee07484ba3077 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0240.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0240.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0240 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0240 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0250.ets index e7a5a7eb2d734a282338c68d45ceccb23f368fe1..218366e38d247fac34e4f3e5be1473b5c9165b11 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0250.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0250.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0250 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0250 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0260.ets index d032ff4771541d3e4ebef6a6884dd44451b52bba..d3b522973d176cc2f680f97845b6b184fd029125 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0260.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0260.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0260 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0260 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0270.ets index 6bd7ffd20f29ac11fd1894866d3df5005dfe3225..6474279a617b031f821c1bcf2d893730f6b9632d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0270.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0270.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0270 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -47,7 +48,7 @@ struct UIComponentButtonSelectControlSize0270 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0280.ets index 1eab9672df58c690a9fd40626829c11d61b8ccce..2bc0d291f1c9ea9e280c1a3fd4f4c7c4a34ced54 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0280.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0280.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0280 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0280 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0290.ets index 13d07c2334371b0bf959d1888d9ad28c74a33b7c..975898351753afa21d7d85e58f5bc8aae1d250fa 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0290.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0290.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0290 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -34,7 +35,7 @@ struct UIComponentButtonSelectControlSize0290 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0300.ets index e993e25a902e387c9129dec0e4de13af03be9414..f9e3baa51952d72da735a7568fe451e4ffc143cc 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0300.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0300.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0300 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -30,7 +31,7 @@ struct UIComponentButtonSelectControlSize0300 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0310.ets index e87e90e8f5fcb470c944852a2bbb72ac081c035d..635cb18f4f8d40c2b21651937e752180f2ab1147 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0310.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0310.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0310 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0310 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0320.ets index c248a063abe0f6cdbefc9a13ee6147bd37f24c01..ab9da902908251225ac0eb2dc7de5a660cf92332 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0320.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0320.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0320 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0320 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0330.ets index e4ccbe6b49bd3c2ab64317c7b7ce10b8ebf445a8..ed7bef3e26ad71f8c1fa3e83d113e3e0df6b86af 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0330.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0330.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0330 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0330 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0340.ets index b7345220991d6a77a91e62dc7554a218c2f7042b..d57e0e583b1b1a534d14e6be68bee6cb13dc7554 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0340.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0340.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0340 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0340 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0350.ets index e99d7b4cba5776f32990b496ec75e3cdbd53072b..bad34e32a2cb3588ac2b158448b0c1d301b4a9b2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0350.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0350.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0350 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -47,7 +48,7 @@ struct UIComponentButtonSelectControlSize0350 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0360.ets index 4c53312e3ec376eba2fe3b13e7a72b6ef0129fa5..b6ef6557e758a3ad20472fbfdfc5ddb1bb1103a8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0360.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0360.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0360 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -35,7 +36,7 @@ struct UIComponentButtonSelectControlSize0360 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0370.ets index 3d3d527e7fd6e5087b4dcb89ab059539d9858d97..bd3fc889de1adecc50035e0adfea4b180b986d51 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0370.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0370.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0370 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -34,7 +35,7 @@ struct UIComponentButtonSelectControlSize0370 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0380.ets index 0b1d4552c56d5248b52d69869fff23ca3b7dbdb1..a4745b1e565669957fde803dd708630fcda2cdb1 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0380.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0380.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0380 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -30,7 +31,7 @@ struct UIComponentButtonSelectControlSize0380 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0390.ets index 0f726cb217981c6c9b011a46ad98a7c046fa993d..6feb8aaeb072333725d1f806b5268d405b3ab037 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0390.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0390.ets @@ -21,7 +21,12 @@ struct UIComponentButtonSelectControlSize0390 { Column() { Select(this.getOptions()) .controlSize(ControlSize.NORMAL) - .padding({ top: 8, left: 16, bottom:8, right: 16 }) + .padding({ + top: 8, + left: 16, + bottom: 8, + right: 16 + }) } .width('100%') .height('100%') @@ -29,7 +34,7 @@ struct UIComponentButtonSelectControlSize0390 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0400.ets index 67bebde895c323c5e3a43829b48f34244e2ac1a4..5fd5760a265aef6d259778f713e8faf24277ac91 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0400.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0400.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0400 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0400 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0410.ets index 720f69da841cb69faef83a2042d8257658228e0f..082ca2827009e3b1934c6a0296f676facdcd690c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0410.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0410.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0410 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0410 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0420.ets index 5af0aab2d10ec3d39f7b9f0f7b262e3d3984fd4e..f5ca46e25b0787837c137511ddb6c44605649c49 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0420.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0420.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0420 { - build() { Row() { Column() { @@ -24,7 +23,12 @@ struct UIComponentButtonSelectControlSize0420 { .controlSize(ControlSize.NORMAL) Select(this.getOptions()) .controlSize(ControlSize.NORMAL) - .padding({top: 8, left: 16, bottom: 8, right: 16}) + .padding({ + top: 8, + left: 16, + bottom: 8, + right: 16 + }) } .width('100%') .height('100%') @@ -32,7 +36,7 @@ struct UIComponentButtonSelectControlSize0420 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0430.ets index 6f390512898ffc371da7f6b88a926239f8fca2f5..2f694ad2a2be30ebc8b61780833a5b728be25a57 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0430.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0430.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0430 { - build() { Row() { Column() { @@ -32,7 +31,7 @@ struct UIComponentButtonSelectControlSize0430 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0450.ets index 542dacf9f992490f8f661bd04d1117b8b3e23c36..0425d585f3286a75a8e46c1f5b2dc80ecf6eccac 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0450.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0450.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0450 { @State bgColor: ResourceColor = Color.Blue @State text: string = "" + build() { Row() { Column() { @@ -47,7 +48,7 @@ struct UIComponentButtonSelectControlSize0450 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0470.ets index c8d6b399fdb947f4b25c2b9e40ed5bf9f15b2575..c92df42c41c0aaedb4fef7097cc0f4d840053a30 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0470.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0470.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0470 { - build() { Row() { Column() { @@ -29,7 +28,7 @@ struct UIComponentButtonSelectControlSize0470 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0480.ets index 146e5bd6edf856878904269c61901a99b59b9b1b..7ed7e83a09b2635e0cf57a33db0edd9ad995a1e8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0480.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0480.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0480 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0480 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0490.ets index edf8bc77e95d53108b909077bb4f8d5dc5f964d3..c19928aad1ac6887e8fc85e64b22bfc3b9057310 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0490.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0490.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0490 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0490 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0500.ets index 0c3c6c3ea5fc2fd467cb877906f1cda8a083b27d..ebaee59bfc5a41a544edfc2620529150bb1b5d79 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0500.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0500.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0500 { - build() { Row() { Column() { @@ -39,7 +38,7 @@ struct UIComponentButtonSelectControlSize0500 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0510.ets index 39954515a249ff0379cdb65e56bf13f3f9b57b6a..d73ec1e23cfc7872d1f96fffbb417fb66c9b3c91 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0510.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0510.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0510 { - build() { Row() { Column() { @@ -32,7 +31,7 @@ struct UIComponentButtonSelectControlSize0510 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0520.ets index af78aa90b34344ad8435cfccb14faaa01fbcfbe7..03efee6ea0850a50b27afe1bb6754364c3beb0f6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0520.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0520.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0520 { - build() { Row() { Column() { @@ -28,7 +27,7 @@ struct UIComponentButtonSelectControlSize0520 { right: BorderStyle.Dotted, top: BorderStyle.Dotted, bottom: BorderStyle.Dotted - }) + }) } .width('100%') .height('100%') @@ -36,7 +35,7 @@ struct UIComponentButtonSelectControlSize0520 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0530.ets index bfcffd51cee003d241874be4e03ed15fbd5298c2..a533bfefec54c46bfa3882fa5efa3abe68cc7b57 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0530.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0530.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0530 { - build() { Row() { Column() { @@ -28,7 +27,7 @@ struct UIComponentButtonSelectControlSize0530 { right: BorderStyle.Dotted, top: BorderStyle.Solid, bottom: BorderStyle.Dashed - }) + }) } .width('100%') .height('100%') @@ -36,7 +35,7 @@ struct UIComponentButtonSelectControlSize0530 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0540.ets index 756265a746e0d6418679e83d95c9084a037a09ce..b77199a31ad04faab2115fb025c8de3861a96fef 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0540.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0540.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0540 { - build() { Row() { Column() { @@ -34,7 +33,7 @@ struct UIComponentButtonSelectControlSize0540 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0550.ets index 3676d33d1b4636779c63d17f5f99e8f5412f9677..4e7881971f892074f36f1c5a8509eb323cc67fbd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0550.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0550.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0550 { - build() { Row() { Column() { @@ -29,7 +28,7 @@ struct UIComponentButtonSelectControlSize0550 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0560.ets index 3dc41d0ff6df88e184de6356ffc8c95b2bc66274..26d3073991a11831d520a33999572e4dd0651519 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0560.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0560.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0560 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0560 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0570.ets index f640cdd59ad5cce49e68cad88d571425a927e1aa..ba35a0d9ff5669a18102fbcc8acdd184dc03b970 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0570.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0570.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0570 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0570 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0580.ets index 485aa5964a2d0ea16017117b1516029ff6b33c99..a48f01a02fc5138a638fb36fa6a235e9a324db5f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0580.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0580.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0580 { - build() { Row() { Column() { @@ -33,7 +32,7 @@ struct UIComponentButtonSelectControlSize0580 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0590.ets index 81db79de2545b35232cb672582f2e08c0810cbc2..d8633618d2b4a58952adcd5e1de563c076997fef 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0590.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0590.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0590 { - build() { Row() { Column() { @@ -33,7 +32,7 @@ struct UIComponentButtonSelectControlSize0590 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0600.ets index 2721958edba82caab500437bd88600223f7ce515..545fddc0ef1700ac88a3a27a3eb25925b61a8f54 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0600.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0600.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0600 { - build() { Row() { Column() { @@ -32,7 +31,7 @@ struct UIComponentButtonSelectControlSize0600 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0610.ets index 0ef6660a7955e3324d0b3e2c99a9d7111e886004..f0ac51fc628a08794f456c2217fdd6e114ee9c3d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0610.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0610.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0610 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0610 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0620.ets index 85a2818f897a6835d4c5147dfd7a574653f1e279..a08a0d91c5897ef18027a6a11fc50e598ec97d0f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0620.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0620.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0620 { - build() { Row() { Column() { @@ -39,7 +38,7 @@ struct UIComponentButtonSelectControlSize0620 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0630.ets index 1b59b7bac88f4e362b11a66fd41483c7ebe94fd8..e2a0abd2453d61a980dfd037f9d35ceca40a30ea 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0630.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0630.ets @@ -16,7 +16,6 @@ @Entry @Component struct UIComponentButtonSelectControlSize0630 { - build() { Row() { Column() { @@ -30,7 +29,7 @@ struct UIComponentButtonSelectControlSize0630 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0640.ets index 5fd234ce1275d6f4083c719bba4de049ac460628..6d584483d7871dc9aae882d5340ddbcda09f94ae 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0640.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0640.ets @@ -17,17 +17,18 @@ @Component struct UIComponentButtonSelectControlSize0640 { @State text: string = "TTTTT" + build() { Row() { Column() { Select(this.getOptions()) .controlSize(ControlSize.SMALL) .value(this.text) - .font({ weight: -10}) + .font({ weight: -10 }) Select(this.getOptions()) .controlSize(ControlSize.SMALL) .value(this.text) - .font({ weight: '10%'}) + .font({ weight: '10%' }) } .width('100%') .height('100%') @@ -35,7 +36,7 @@ struct UIComponentButtonSelectControlSize0640 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0650.ets index b3d05edbc7127731040b29693980664b6ded46ba..8919bbbd87095ec4f967bee4674036411ef873c2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0650.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0650.ets @@ -17,21 +17,22 @@ @Component struct UIComponentButtonSelectControlSize0650 { @State text: string = "TTTTT" + build() { Row() { Column() { Select(this.getOptions()) .controlSize(ControlSize.SMALL) .value(this.text) - .font({ weight: null}) + .font({ weight: null }) Select(this.getOptions()) .controlSize(ControlSize.SMALL) .value(this.text) - .font({ weight: undefined}) + .font({ weight: undefined }) Select(this.getOptions()) .controlSize(ControlSize.SMALL) .value(this.text) - .font({ weight: FontWeight.Medium}) + .font({ weight: FontWeight.Medium }) } .width('100%') .height('100%') @@ -39,7 +40,7 @@ struct UIComponentButtonSelectControlSize0650 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0660.ets index 31bf89b8c0a35fd5f2993bf2d62896a941b0215e..e5cfd39fc77c1eb2253873edc5453cfac4ecdc24 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0660.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0660.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0660 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -26,7 +27,7 @@ struct UIComponentButtonSelectControlSize0660 { Select(this.getOptions()) .controlSize(ControlSize.SMALL) .value(this.text) - .font({ size: 16, weight: FontWeight.Medium}) + .font({ size: 16, weight: FontWeight.Medium }) } .width('100%') .height('100%') @@ -34,7 +35,7 @@ struct UIComponentButtonSelectControlSize0660 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0670.ets index ab64d011268e11b1e36e310503c3538ef18bb8ce..ae3341bd050d13e7344273be830a2f62827a1f8f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0670.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0670.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0670 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0670 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0680.ets index 474a2c6aa0970d0370be21171ac43f5cd2089fa3..b664ea9062310b5f1cf26b1cee44f441a4dda601 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0680.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0680.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0680 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0680 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0690.ets index 54c714caaa07070be3f030dc17003e9baf00ee06..92ab6183e20aacf6ffb0bfccb54388c9fd66e03a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0690.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0690.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0690 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0690 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0700.ets index ff167961a7ca74be9541eb2a8cd4a4477b3cb303..9a46a867460fc461d0248680c0e91def4c573b2b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0700.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0700.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0700 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0700 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0710.ets index b961501056f7907c3046f7b288e6b2c36f904f22..35487d09ac7a2b933ea2f93e7968733349abdff6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0710.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0710.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0710 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -47,7 +48,7 @@ struct UIComponentButtonSelectControlSize0710 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0720.ets index 9d06cad3cf6931b585aaf518e7581cf0f0dbd01c..4f558f1d32e83f3b56c2330eccb20bfb5efc42c8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0720.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0720.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0720 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0720 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0730.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0730.ets index a627db05c2f6f49b9aefd93ad72dac0048542656..a9828795d39b103340eb20d209fedd7567d68226 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0730.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0730.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0730 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -34,7 +35,7 @@ struct UIComponentButtonSelectControlSize0730 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0740.ets index c4e55045b603afa48bb32508f41b61879c8cba16..cf67bd41cc7b25a51d437fd5fd23502718355657 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0740.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0740.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0740 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0740 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0750.ets index 18d4d90aff77f73a77e6fca51830e359448a2093..66a241c27c3bd24cd64684f808da237e0dab8945 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0750.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0750.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0750 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0750 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0760.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0760.ets index e9cb80faa787d4a59d05ea14258febebb609daff..bcc583e8e340f54567ab7209dc23c8f9dfa90850 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0760.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0760.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0760 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0760 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0770.ets index 66f2d698ea3c18b18f7e46e9a4950db9375a8b44..6eb6b328c69b53b27fdbc2c5a7c19c72c3193050 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0770.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0770.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0770 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -31,7 +32,7 @@ struct UIComponentButtonSelectControlSize0770 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0780.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0780.ets index aa1eec49dfe7f8047ac7578f2bc3102864f5f636..2efb7188e048fdf336d39a4d92a7dacc585e2caf 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0780.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0780.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0780 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -47,7 +48,7 @@ struct UIComponentButtonSelectControlSize0780 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0790.ets index 9cec4110f7ef3796a1aa953f3e174e688bcd9528..8221a022241ff4bacb13c68111f7ac36a140afec 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0790.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0790.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0790 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -35,7 +36,7 @@ struct UIComponentButtonSelectControlSize0790 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0800.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0800.ets index 1c85a911a36afda7b6c0eb08b13384162d7e729c..244892bd1b3f52d72eedb1c7cab74fbb5e0d623a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0800.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0800.ets @@ -17,6 +17,7 @@ @Component struct UIComponentButtonSelectControlSize0800 { @State text: string = "TTTTT" + build() { Row() { Column() { @@ -34,7 +35,7 @@ struct UIComponentButtonSelectControlSize0800 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0810.ets index 56cf5860c52247cfde1fb6f6b42432899281014a..3d80612e845d42a39518dc1be9bf106c5dde1eeb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0810.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0810.ets @@ -21,7 +21,12 @@ struct UIComponentButtonSelectControlSize0810 { Column() { Select(this.getOptions()) .controlSize(ControlSize.SMALL) - .padding({ top: 8, left: 16, bottom:8, right: 16 }) + .padding({ + top: 8, + left: 16, + bottom: 8, + right: 16 + }) } .width('100%') .height('100%') @@ -29,7 +34,7 @@ struct UIComponentButtonSelectControlSize0810 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0820.ets index 26bf15aac66dfec53d4b84cf87ea6d4193e6402e..3f4cdb804d5be0a3832fb3a49939a64fac307437 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0820.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0820.ets @@ -29,7 +29,7 @@ struct UIComponentButtonSelectControlSize0820 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0830.ets index 3b169d5f54743bb0440227850caaacc9df983a1e..8eec48fd838b76b8f8f550911890f7057ec844c6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0830.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0830.ets @@ -32,7 +32,7 @@ struct UIComponentButtonSelectControlSize0830 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0840.ets index e4bb5cdf2f4bee4e50285056f49b44c4b4e4e36d..c397b2538bc31f4cc95e1ae05206b6f900a83b78 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0840.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0840.ets @@ -23,7 +23,12 @@ struct UIComponentButtonSelectControlSize0840 { .controlSize(ControlSize.SMALL) Select(this.getOptions()) .controlSize(ControlSize.SMALL) - .padding({ top: 8, left: 16, bottom: 8, right:16 }) + .padding({ + top: 8, + left: 16, + bottom: 8, + right: 16 + }) } .width('100%') .height('100%') @@ -31,7 +36,7 @@ struct UIComponentButtonSelectControlSize0840 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0860.ets index f46d0f68f2820c7e588eb17d476d32ac43d143b4..f627a88915bde0d72e421a0b3b41106c9985c9a2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0860.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0860.ets @@ -19,6 +19,7 @@ struct UIComponentButtonSelectControlSize0860 { @State bgColor: ResourceColor = Color.Blue @State control: ControlSize = ControlSize.NORMAL @State text: string = "" + build() { Row() { Column() { @@ -53,7 +54,7 @@ struct UIComponentButtonSelectControlSize0860 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0880.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0880.ets index 7f56d5487da15f7b8ef5220e6707ba1e2aca5787..2f8d876de8e0e7c48055b2bd8874ebc1350afc5b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0880.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0880.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0880 { @State control: ControlSize = ControlSize.NORMAL @State text: string = "" + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0880 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0890.ets index 9b00212ebc021e3628b7594b00b6d21d778e0765..91fe092a18b48be67a743546be4229f2d365964b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0890.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0890.ets @@ -44,7 +44,7 @@ struct UIComponentButtonSelectControlSize0890 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0900.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0900.ets index 8f20770318176a098250b13a9dfab887100a699f..2f77265972a743f1d56c4bba3c215e17fb70b3f6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0900.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0900.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0900 { @State control: ControlSize = ControlSize.NORMAL @State text: string = "" + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0900 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0910.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0910.ets index a41053058743deb2e13df7f14860fb1108d841e6..f070a979eef99a860f3451c837991b822e767823 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0910.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0910.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0910 { @State control: ControlSize = ControlSize.NORMAL @State text: string = "" + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0910 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0920.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0920.ets index 7cc25223cef4275b0b4bef28ae8a473451c6deec..22227bb88db0859810d18e96cda4795107836e6f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0920.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0920.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0920 { @State control: ControlSize = ControlSize.NORMAL @State containerWidth: Length = -1 + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0920 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0930.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0930.ets index 665fa8feb5c83fc01dc87eb8521dda5210c8f7fa..d48f339d86a7d01c6e7840050ef9d19e4f681154 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0930.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0930.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0930 { @State control: ControlSize = ControlSize.NORMAL @State containerWidth: Length = -1 + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0930 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0940.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0940.ets index 05e161493059e9646406aeafa6a89ae97f8cff73..e2ed7dc8a402b8d2b1f1f5d40bcb4c3d159c0845 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0940.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0940.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0940 { @State control: ControlSize = ControlSize.NORMAL @State containerWidth: Length = -1 + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0940 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0950.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0950.ets index e05b4d85e24bb28e448e155ca6825914e2a3b5e5..7a429569b974be455bbf8c0a12203aedb6d83dff 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0950.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0950.ets @@ -19,6 +19,7 @@ struct UIComponentButtonSelectControlSize0950 { @State fontSize: Length = -1 @State control: ControlSize = ControlSize.NORMAL @State text: string = "TTTTT" + build() { Row() { Column() { @@ -43,7 +44,7 @@ struct UIComponentButtonSelectControlSize0950 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0960.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0960.ets index 60c309e4dfbdccf66073ab2bffa1486ea804d2ef..afe441cf240955ca2277e4cf443e0bade1a9398e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0960.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0960.ets @@ -19,6 +19,7 @@ struct UIComponentButtonSelectControlSize0960 { @State fontSize: Length = -1 @State control: ControlSize = ControlSize.NORMAL @State text: string = "TTTTT" + build() { Row() { Column() { @@ -43,7 +44,7 @@ struct UIComponentButtonSelectControlSize0960 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0970.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0970.ets index 7861d93219048c224b43cb25eb0febb8a9884e4b..9e6fa89d0a20235d7fa1223931db3c0bb908c61c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0970.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0970.ets @@ -19,6 +19,7 @@ struct UIComponentButtonSelectControlSize0970 { @State fontSize: Length = -1 @State control: ControlSize = ControlSize.NORMAL @State text: string = "TTTTT" + build() { Row() { Column() { @@ -43,7 +44,7 @@ struct UIComponentButtonSelectControlSize0970 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0980.ets index 80f00d80fd5ea5e17c01f6f5c64a4c2e9eeb8d78..3d5f0df64d28f686fe970a56d52df34c22b61022 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0980.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0980.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0980 { @State control: ControlSize = ControlSize.NORMAL @State containerHeight: Length = -1 + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0980 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0990.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0990.ets index 600813ccde7e48eb3aeb3d1ebaba22af08132366..0a88129ea3ae80dd1d3630b0c60c2a8f5ead4ecb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0990.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0990.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize0990 { @State control: ControlSize = ControlSize.NORMAL @State containerHeight: Length = -1 + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize0990 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1000.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1000.ets index 96ec6daac73f08dcf65d3fe7b947c951c1a27cb6..e76bbe292260b62b63c45dc1fce3a867232a7a32 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1000.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1000.ets @@ -18,6 +18,7 @@ struct UIComponentButtonSelectControlSize1000 { @State control: ControlSize = ControlSize.NORMAL @State containerHeight: Length = -1 + build() { Row() { Column() { @@ -41,7 +42,7 @@ struct UIComponentButtonSelectControlSize1000 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1010.ets index f3b927892901d491719cbba6b2853f7ffa54d4e2..0f53077160e3f1bba9bc8c654c2377f3d8dfa6f2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1010.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize1010.ets @@ -29,7 +29,7 @@ struct UIComponentButtonSelectControlSize1010 { } getOptions(): Array { - const options:Array = []; + const options: Array = []; for (let i = 1; i <= 20; i++) { const value = i === 3 ? "" : (i === 4 ? '这是一个非常长的文本,可能会超过显示限制,需要截断或者滚动查看' : `item${i}`); options.push({ value: value }); diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/Commons.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/Commons.ets new file mode 100644 index 0000000000000000000000000000000000000000..189fe5f0fc17f7ff45f9115402c9305919f75712 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/Commons.ets @@ -0,0 +1,282 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/************* 中文简体 ****************/ +export const CASCADE_ZH_JT: TextCascadePickerRangeContent[] = [ + { + text: '水果', + children: [ + { text: '菠萝' }, + { text: '苹果' } + ] + }, + { + text: '家电', + children: [ + { text: '电视机' }, + { text: '电冰箱' } + ] + }, + { + text: '数字', + children: [ + { text: '一' }, + { text: '二' }, + { text: '三' }, + { text: '四' }, + { text: '五' }, + ] + } +]; + +export const IMAGE_ZH_JT: TextPickerRangeContent[] = [ + { + icon: 'cat.jpg', + text: "香蕉" + }, + { + icon: 'cat.jpg', + text: "苹果" + }, + { + icon: 'cat.jpg', + text: "菠萝" + }, + { + icon: 'cat.jpg', + text: "西瓜" + } +]; + +export const STRING_1_ZH_JT: string[] = getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit')); + +export const STRING_2_ZH_JT: string[][] = [ + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit')), + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.appliance')) +]; + +export const RESOURCE_ZH_JT: Resource = $r('app.strarray.fruit'); + +/************* 中文繁体 ****************/ +export const CASCADE_ZH_FT: TextCascadePickerRangeContent[] = [ + { + text: '水果', + children: [ + { text: '菠蘿' }, + { text: '蘋果' } + ] + }, + { + text: '家電', + children: [ + { text: '電視' }, + { text: '電腦' } + ] + }, + { + text: '數字', + children: [ + { text: '壹' }, + { text: '貳' }, + { text: '叁' }, + { text: '肆' }, + { text: '伍' }, + ] + } +]; + +export const IMAGE_ZH_FT: TextPickerRangeContent[] = [ + { + icon: 'cat.jpg', + text: "鳳梨" + }, + { + icon: 'cat.jpg', + text: "蘋果" + }, + { + icon: 'cat.jpg', + text: "菠蘿" + }, + { + icon: 'cat.jpg', + text: "火龍果" + } +]; + +export const STRING_1_ZH_FT: string[] = getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_ft')); + +export const STRING_2_ZH_FT: string[][] = [ + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_ft')), + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.appliance_ft')) +]; + +export const RESOURCE_ZH_FT: Resource = $r('app.strarray.fruit_ft'); + +/************* 藏文 ****************/ +export const CASCADE_ZH_ZW: TextCascadePickerRangeContent[] = [ + { + text: 'འབྲས་བུ་', + children: [ + { text: 'བརྩེད་པོ' }, + { text: 'འབྲིང་' } + ] + }, + { + text: 'གཞི་རྩོམ་པ།', + children: [ + { text: 'བརྙན་འཕྲིན' }, + { text: 'འབྲུག་འབྱུང་' } + ] + }, + { + text: 'གཞོན་ནང་', + children: [ + { text: 'བརྒྱལ་ཁང་' }, + { text: 'དབང་རྩེ་' } + ] + } +]; + +export const IMAGE_ZH_ZW: TextPickerRangeContent[] = [ + { + icon: 'cat.jpg', + text: "བཟོ་བདེ་" + }, + { + icon: 'cat.jpg', + text: "འབྲིང་" + }, + { + icon: 'cat.jpg', + text: "བོ་ལོའི་སོགས་" + }, + { + icon: 'cat.jpg', + text: "ཧ་མི་དངོས་" + } +]; + +export const STRING_1_ZH_ZW: string[] = getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_zw')); + +export const STRING_2_ZH_ZW: string[][] = [ + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_zw')), + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.appliance_zw')) +]; + +export const RESOURCE_ZH_ZW: Resource = $r('app.strarray.fruit_zw'); + + +/************* 维吾尔文 ****************/ +export const CASCADE_ZH_WW: TextCascadePickerRangeContent[] = [ + { + text: 'لىياڭنىڭ شەھىرى', + children: [ + { text: 'شېنجاڭ شەھىرى' }, + { text: 'دالىيان شەھىرى' } + ] + }, + { + text: 'جىلىن شەھىرى', + children: [ + { text: 'چاڭچۇن شەھىرى' }, + { text: 'سۈرپىڭ شەھىرى' } + ] + }, + { + text: 'خەيلۇن جياڭ ئۆلكىسى', + children: [ + { text: 'خەربىن شەھىرى' }, + { text: 'مۈتەن جېڭشەن' } + ] + } +]; + +export const IMAGE_ZH_WW: TextPickerRangeContent[] = [ + { + icon: 'cat.jpg', + text: "تېلېۋىزور" + }, + { + icon: 'cat.jpg', + text: "تازىلاش ماشىنىسى" + }, + { + icon: 'cat.jpg', + text: "مۇزلاتقۇچ" + }, + { + icon: 'cat.jpg', + text: "ھەۋا شۇندۇرغۇچ" + } +]; + +export const STRING_1_ZH_WW: string[] = getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_ww')); + +export const STRING_2_ZH_WW: string[][] = [ + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_ww')), + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.appliance_ww')) +]; + +export const RESOURCE_ZH_WW: Resource = $r('app.strarray.fruit_ww'); + +/************* 英文 ****************/ +export const CASCADE_EN: TextCascadePickerRangeContent[] = [ + { + text: 'fruit', + children: [ + { text: 'banana' }, + { text: 'apple' }, + { text: 'lemon' }, + { text: 'orange' }, + ] + }, + { + text: 'appliance', + children: [ + { text: 'Computer' }, + { text: 'Refrigerator' }, + { text: 'TV' }, + ] + } +]; + +export const IMAGE_EN: TextPickerRangeContent[] = [ + { + icon: 'cat.jpg', + text: "banana" + }, + { + icon: 'cat.jpg', + text: "apple" + }, + { + icon: 'cat.jpg', + text: "lemon" + }, + { + icon: 'cat.jpg', + text: "orange" + } +]; + +export const STRING_1_EN: string[] = getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_en')); + +export const STRING_2_EN: string[][] = [ + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.fruit_en')), + getContext().resourceManager.getStringArrayValueSync($r('app.strarray.appliance_en')) +]; + +export const RESOURCE_EN: Resource = $r('app.strarray.fruit_en'); \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..5acaf1e1d0c4c379ffdc8c614a2049f4923d8b38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0100.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 Logger from '../../../test/model/Logger'; + +@Entry +@Component +struct UIComponentButtonTextPickerMirrorImage0100 { + @State showPicker: boolean = false; + @State customDirection: Direction = Direction.Ltr; + @State range: TextCascadePickerRangeContent[] = [ + { + text: '水果', + children: [ + { text: '菠蘿' }, + { text: '蘋果' } + ] + }, + { + text: '家電', + children: [ + { text: '電視機' }, + { text: '電冰箱' } + ] + }, + { + text: '數字', + children: [ + { text: '壹' }, + { text: '貳' }, + { text: '叁' }, + { text: '肆' }, + { text: '伍' }, + ] + } + ]; + + build() { + Column() { + Row() { + Button("TextPicker").id('ShowTextPicker').onClick(() => { + this.showPicker = true; + }) + Button("direction:Rtl").id('direction_bt').margin({ left: 20 }).onClick(() => { + this.customDirection = Direction.Rtl; + }) + } + + if (this.showPicker) { + TextPicker({ + range: this.range + }).id('TextPicker') + .direction(this.customDirection) + .onChange((value, index) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_MIRRORIMAGE_0100 onChange: value=${value}, index= ${index}`); + }) + } + }.width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..e7aafdee20a74f240b6ebc316ab376a7ed5079c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0140.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Logger from '../../../test/model/Logger'; + +@Entry +@Component +struct UIComponentButtonTextPickerMirrorImage0140 { + @State showPicker: boolean = false; + @State customDirection: Direction = Direction.Ltr; + @State range: TextCascadePickerRangeContent[] = [ + { + text: 'لىياڭنىڭ شەھىرى', + children: [ + { text: 'شېنجاڭ شەھىرى' }, + { text: 'دالىيان شەھىرى' } + ] + }, + { + text: 'جىلىن شەھىرى', + children: [ + { text: 'چاڭچۇن شەھىرى' }, + { text: 'سۈرپىڭ شەھىرى' } + ] + }, + { + text: 'خەيلۇن جياڭ ئۆلكىسى', + children: [ + { text: 'خەربىن شەھىرى' }, + { text: 'مۈتەن جېڭشەن' } + ] + } + ]; + + build() { + Column() { + Row() { + Button("TextPicker").id('ShowTextPicker').onClick(() => { + this.showPicker = true; + }) + Button("direction:Auto").id('direction_bt').margin({ left: 20 }).onClick(() => { + this.customDirection = Direction.Auto; + }) + } + + if (this.showPicker) { + TextPicker({ + range: this.range + }).id('TextPicker') + .direction(this.customDirection) + .onChange((value, index) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_MIRRORIMAGE_0140 onChange: value=${value}, index= ${index}`); + }) + } + }.width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..b92a0adb90e738adf8a6dda50a47af6c25f25f13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0030.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 UIComponentButtonTimepickerNumeric0030 { + private selectedTime: Date = new Date('2022-07-22T08:00:00'); + + build() { + Row() { + Column() { + TimePicker({ + selected: this.selectedTime, + format: TimePickerFormat.HOUR_MINUTE_SECOND + }) + .dateTimeOptions({ + hour: 'numeric', + minute: 'numeric', + second: '2-digit' + }) + .onChange((value: TimePickerResult) => { + if (value.hour >= 0) { + this.selectedTime.setHours(value.hour, value.minute); + console.info('select current date is: ' + JSON.stringify(value)); + } + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom001.ets new file mode 100644 index 0000000000000000000000000000000000000000..3bb9af8f7d5e22203a0a9e85cecbdbf0c8e252b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom001.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MenuModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentCommonAttrCom001 { + @State menuModifier: MenuModifier = new MenuModifier() + + build() { + Column() { + Menu() { + MenuItem({ startIcon: $r('app.media.app_icon'), content: '菜单选项1' }) + MenuItem({ startIcon: $r('app.media.app_icon'), content: '菜单选项2' }) + } + .attributeModifier(this.menuModifier) + } + } + + aboutToAppear(): void { + this.menuModifier.font({ + size: 60, + style: FontStyle.Italic + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom002.ets new file mode 100644 index 0000000000000000000000000000000000000000..51a0ce646908ad9ac938fa107b82341ceeaaa3d1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom002.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 UIComponentCommonAttrCom002 { + build() { + Column() { + Hyperlink('https://example.com/') + .color(Color.Pink) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom003.ets new file mode 100644 index 0000000000000000000000000000000000000000..65785cba9f0373e2701ad68c9ed17037dbe20705 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom003.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 UIComponentCommonAttrCom003 { + build() { + Column() { + Hyperlink('https://example.com/') + .color(0xff0000) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom004.ets new file mode 100644 index 0000000000000000000000000000000000000000..0be102c6e2d23ffc9093e1cc01b7b942906dbcfc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom004.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 UIComponentCommonAttrCom004 { + build() { + Column() { + Hyperlink('https://example.com/') + .color('#008800') + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom005.ets new file mode 100644 index 0000000000000000000000000000000000000000..afe4e42c16b108162b4839d010d0b5ed4f66b5f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom005.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 UIComponentCommonAttrCom005 { + build() { + Column() { + Hyperlink('https://example.com/') + .color('rgba(0,255,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/UIComponentCommonAttrCom/UIComponentCommonAttrCom006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom006.ets new file mode 100644 index 0000000000000000000000000000000000000000..4f0af3fcb8c1dd3e790c4eb532ed7b6019bd083e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom006.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 UIComponentCommonAttrCom006 { + build() { + Column() { + Hyperlink('https://example.com/') + .color('rgb(0,0,255)') + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom007.ets new file mode 100644 index 0000000000000000000000000000000000000000..af401bd47adc751edc1b2e7d96c6d1f6493018d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom007.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 UIComponentCommonAttrCom007 { + @State color: Color | undefined = undefined + + aboutToAppear(): void { + this.color = getContext().resourceManager.getColorSync($r('app.color.colorRed')) + } + + build() { + Column() { + Hyperlink('https://example.com/') + .color($r('app.color.colorRed')) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002.ets new file mode 100644 index 0000000000000000000000000000000000000000..a2a13be106cd97bde66051b10e94c562caa1712d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentContainerSpanInterface002 { + build() { + Column() { + Text('ContainerSpan无width和height,和onClick属性,代码报错') + .fontColor(Color.Red) + Image('testability/resources/containerspan_width_error.png') + .width('100%') + Image('testability/resources/containerspan_height_error.png') + .width('100%') + Image('testability/resources/containerspan_click_error.png') + .width('100%') + } + .width('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..079159cef64d05bacd4e49038d9d1cddb8c960c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0010.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { image } from '@kit.ImageKit' + +@Entry +@Component +struct UIComponentImageAicontroller0010 { + + @State imagePixelMap: image.PixelMap | undefined = undefined + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + private optionsTypeUndefined: ImageAIOptions = { + types: undefined, + aiController: this.aiController + } + + private optionsTypeSubject: ImageAIOptions = { + types: [ ImageAnalyzerType.SUBJECT ], + aiController: this.aiController + } + + private optionsTypeText: ImageAIOptions = { + types: [ ImageAnalyzerType.TEXT ], + aiController: this.aiController + } + + async aboutToAppear() { + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.openeye')) + } + + build() { + Column() { + Text("src为PixelMap, ImageAnalyzerType为undefined").margin({top: 20}) + Image(this.imagePixelMap, this.optionsTypeUndefined) + .enableAnalyzer(true) + .id('image_1') + .objectFit(ImageFit.Contain) + .width(100) + .height(150) + .margin({left: 10}) + Text("src为 ResourceStr,ImageAnalyzerType为SUBJECT").margin({top: 20}) + Image($r('app.media.openeye'), this.optionsTypeSubject) + .enableAnalyzer(true) + .objectFit(ImageFit.Contain) + .id('image_2') + .width(100) + .height(150) + .margin({left: 10}) + Text("src为 DrawableDescriptor, ImageAnalyzerType为TEXT").margin({top: 20}) + Image(getContext(this).resourceManager.getDrawableDescriptor($r('app.media.openeye')), this.optionsTypeText) + .enableAnalyzer(true) + .id('image_3') + .objectFit(ImageFit.Contain) + .width(100) + .height(150) + .margin({left: 10}) + } + } + 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 + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ab58304571a00878a2b5bc2b363ab8b59f246d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0020.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 UIComponentImageAicontroller0020 { + + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + + build() { + Column() { + Image(getContext(this).resourceManager.getDrawableDescriptor($r('app.media.openeye')), { + aiController: this.aiController + }) + .enableAnalyzer(true) + .id('image_1') + .objectFit(ImageFit.Contain) + .width(100) + .height(150) + .margin({left: 10}) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..2eac243ec322062b154e7e6901ad8a5302817bc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0030.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 UIComponentImageAicontroller0030 { + @State imageAnalyzerSupportTypes: string = '[]'; + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + + build() { + Column() { + Image(getContext(this).resourceManager.getDrawableDescriptor($r('app.media.openeye')), { + aiController: this.aiController, + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT, ImageAnalyzerType.SUBJECT] + }) + .enableAnalyzer(true) + .id('image_1') + .objectFit(ImageFit.Contain) + .width(100) + .height(150) + .margin({left: 10}) + Text() + .margin(20) + Button('getTypes') + .id('button_1') + .onClick(() => { + this.imageAnalyzerSupportTypes = `${JSON.stringify(this.aiController.getImageAnalyzerSupportTypes())}`; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f82531098382cd0fc03f460300d01acfedeed32 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0040.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 UIComponentImageAicontroller0040 { + + @State imageAnalyzerSupportTypes: string = '[]'; + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + + build() { + Column() { + Image(getContext(this).resourceManager.getDrawableDescriptor($r('app.media.openeye')), { + aiController: this.aiController, + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT, ImageAnalyzerType.SUBJECT] + }) + .enableAnalyzer(false) + .id('image_1') + .objectFit(ImageFit.Contain) + .width(100) + .height(150) + .margin({left: 10}) + Text() + .margin(20) + Button('getTypes') + .id('button_1') + .onClick(() => { + this.imageAnalyzerSupportTypes = `${JSON.stringify(this.aiController.getImageAnalyzerSupportTypes())}`; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e1628a83c9d32a9cc728b3a2e63a4e7723e1ea4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0050.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 UIComponentImageAicontroller0050 { + + @State videoSrc: string = 'video1.mp4' + controller: VideoController = new VideoController() + config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + } + + build() { + Column() { + Video({ + src: this.videoSrc, + controller: this.controller, + imageAIOptions: this.options + }).autoPlay(false) + .width('100%') + .height(600) + .controls(false) + .enableAnalyzer(true) + .analyzerConfig(this.config) + .onStart(() => { + console.info('onStart') + }) + .onPause(() => { + console.info('onPause') + }) + + Row() { + Button('start').onClick(() => { + this.controller.start() // 开始播放 + }).margin(5) + Button('pause').onClick(() => { + this.controller.pause() // 暂停播放 + }).margin(5) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..7cf05d89a74882aa189e523a0284c3b3eacf4d5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0060.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 UIComponentImageAicontroller0060 { + + @State videoSrc: string = 'video1.mp4' + controller: VideoController = new VideoController() + config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + } + + build() { + Column() { + Video({ + src: this.videoSrc, + controller: this.controller, + imageAIOptions: this.options + }).autoPlay(false) + .width('100%') + .height(600) + .controls(false) + .enableAnalyzer(true) + .analyzerConfig(this.config) + .onStart(() => { + console.info('onStart') + }) + .onPause(() => { + console.info('onPause') + }) + + Row() { + Button('start').onClick(() => { + this.controller.start() // 开始播放 + }).margin(5) + Button('pause').onClick(() => { + this.controller.pause() // 暂停播放 + }).margin(5) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..32d46e0bcb7715f819dfc9b5242f4b339731ea4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0070.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 UIComponentImageAicontroller0070 { + + @State types: string = '[]' + @State videoSrc: string = 'video1.mp4' + controller: VideoController = new VideoController() + config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + } + + build() { + Column() { + Video({ + src: this.videoSrc, + controller: this.controller, + imageAIOptions: this.options + }).autoPlay(true) + .width('100%') + .height(600) + .controls(false) + .enableAnalyzer(true) + .analyzerConfig(this.config) + .onStart(() => { + console.info('onStart') + }) + .onPause(() => { + console.info('onPause') + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button('start').onClick(() => { + this.controller.start() // 开始播放 + }).margin(5) + Button('pause').onClick(() => { + this.controller.pause() // 暂停播放 + }).margin(5) + Button('getTypes').onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }).margin(5) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..16dcfead244bfa7edcee4d29f021c120a4d3cc93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0080.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 UIComponentImageAicontroller0080 { + + @State types: string = '[]' + @State videoSrc: string = 'video1.mp4' + controller: VideoController = new VideoController() + config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + private aiController: ImageAnalyzerController = new ImageAnalyzerController() + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + } + + build() { + Column() { + Video({ + src: this.videoSrc, + controller: this.controller, + imageAIOptions: this.options + }).autoPlay(true) + .width('100%') + .height(600) + .controls(false) + .enableAnalyzer(false) + .analyzerConfig(this.config) + .onStart(() => { + console.info('onStart') + }) + .onPause(() => { + console.info('onPause') + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button('start').onClick(() => { + this.controller.start() // 开始播放 + }).margin(5) + Button('pause').onClick(() => { + this.controller.pause() // 暂停播放 + }).margin(5) + Button('getTypes').onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }).margin(5) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba2ae10730937e88481854d225b3dd0cbc23a03b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0090.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 { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentImageAicontroller0090 { + + xComponentController: XComponentController = new XComponentController(); + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + }; + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + + build() { + Column({ space: 5 }) { + Button('start AI analyze') + .id('button1') + .onClick(() => { + this.xComponentController.startImageAnalyzer(this.config) + .then(() => { + console.log("analysis complete"); + }) + .catch((error: BusinessError) => { + console.log("error code: " + error.code); + }) + }) + Button('stop AI analyze') + .id('button2') + .onClick(() => { + this.xComponentController.stopImageAnalyzer(); + }) + Button('get analyzer types') + .id('button3') + .onClick(() => { + this.aiController.getImageAnalyzerSupportTypes(); + }) + XComponent({ + type: XComponentType.TEXTURE, + controller: this.xComponentController, + imageAIOptions: this.options + }) { + Text("Hello World") + .fontSize(30) + } + .width(320) + .height(480) + .enableAnalyzer(true) + } + .width("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..d199feb658201ba14ba569076c3c59db8247e0b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0100.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentImageAicontroller0100 { + + @State types: string = '[]' + + xComponentController: XComponentController = new XComponentController(); + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + }; + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + + build() { + Column({ space: 5 }) { + Button('start AI analyze') + .id('button1') + .onClick(() => { + this.xComponentController.startImageAnalyzer(this.config) + .then(() => { + console.log("analysis complete"); + }) + .catch((error: BusinessError) => { + console.log("error code: " + error.code); + }) + }) + Button('stop AI analyze') + .id('button2') + .onClick(() => { + this.xComponentController.stopImageAnalyzer(); + }) + Button('get analyzer types') + .id('button3') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + XComponent({ + type: XComponentType.TEXTURE, + controller: this.xComponentController, + imageAIOptions: this.options + }) { + Text("Hello World") + .fontSize(30) + } + .width(320) + .height(480) + .enableAnalyzer(true) + } + .width("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..aa2e01be68d2a188da75310ce41fd1144ee9a0c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0110.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentImageAicontroller0110 { + @State types: string = '[]' + + xComponentController: XComponentController = new XComponentController(); + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + }; + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + + build() { + Column({ space: 5 }) { + Button('start AI analyze') + .id('button1') + .onClick(() => { + this.xComponentController.startImageAnalyzer(this.config) + .then(() => { + console.log("analysis complete"); + }) + .catch((error: BusinessError) => { + console.log("error code: " + error.code); + }) + }) + Button('stop AI analyze') + .id('button2') + .onClick(() => { + this.xComponentController.stopImageAnalyzer(); + }) + Button('get analyzer types') + .id('button3') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + XComponent({ + type: XComponentType.TEXTURE, + controller: this.xComponentController, + imageAIOptions: this.options + }) { + Text("Hello World") + .fontSize(30) + } + .width(320) + .height(480) + .enableAnalyzer(true) + } + .width("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b27213918b362fd9a195122e857e0373a091866 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0120.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentImageAicontroller0120 { + + @State types: string = '[]' + + xComponentController: XComponentController = new XComponentController(); + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + }; + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + + build() { + Column({ space: 5 }) { + Button('start AI analyze') + .id('button1') + .onClick(() => { + this.xComponentController.startImageAnalyzer(this.config) + .then(() => { + console.log("analysis complete"); + }) + .catch((error: BusinessError) => { + console.log("error code: " + error.code); + }) + }) + Button('stop AI analyze') + .id('button2') + .onClick(() => { + this.xComponentController.stopImageAnalyzer(); + }) + Button('get analyzer types') + .id('button3') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + XComponent({ + type: XComponentType.TEXTURE, + controller: this.xComponentController, + imageAIOptions: this.options + }) { + Text("Hello World") + .fontSize(30) + } + .width(320) + .height(480) + .enableAnalyzer(false) + } + .width("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..70882e264505898f5ca482a39910bb3557be6141 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0130.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 UIComponentImageAicontroller0130 { + + @State types: string = '[]'; + private img = new ImageBitmap('cat.jpg') + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(true) + .onReady(() => { + this.context.drawImage(this.img, 100,100, 200, 200); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + this.context.startImageAnalyzer(this.config) + }) + Button('stop AI') + .id('button3') + .onClick(() => { + this.context.stopImageAnalyzer(); + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..35fd9266b376ab27020279655412d0cbd48a12aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0140.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 UIComponentImageAicontroller0140 { + + @State types: string = '[]'; + private img = new ImageBitmap('cat.jpg') + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + aiController: this.aiController + }; + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(true) + .onReady(() => { + this.context.drawImage(this.img, 100,100, 200, 200); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + this.context.startImageAnalyzer(this.config) + }) + Button('stop AI') + .id('button3') + .onClick(() => { + this.context.stopImageAnalyzer(); + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..834b398983d037e55ad1ed4860223ed09a7569cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0150.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 UIComponentImageAicontroller0150 { + + @State types: string = '[]'; + private img = new ImageBitmap('cat.jpg') + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(true) + .onReady(() => { + this.context.drawImage(this.img, 100,100, 200, 200); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + this.context.startImageAnalyzer(this.config) + }) + Button('stop AI') + .id('button3') + .onClick(() => { + this.context.stopImageAnalyzer(); + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..14196cd10b7d592e7ba909baba6edb4a5ccf4ff4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0160.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 UIComponentImageAicontroller0160 { + + @State types: string = '[]'; + private img = new ImageBitmap('cat.jpg') + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(false) + .onReady(() => { + this.context.drawImage(this.img, 100,100, 200, 200); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + this.context.startImageAnalyzer(this.config) + }) + Button('stop AI') + .id('button3') + .onClick(() => { + this.context.stopImageAnalyzer(); + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..d28cc7b1d7e502d12d47e65c37cbfc7b5ea0ef62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0170.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 UIComponentImageAicontroller0170 { + + @State types: string = '[]'; + private img = new ImageBitmap('cat.jpg') + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + private config: ImageAnalyzerConfig = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT] + } + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(true) + .onReady(() => { + this.context.drawImage(this.img, 100,100, 200, 200); + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("createImageData") + .id('button1') + .onClick(() => { + const data = this.context.createImageData(100, 100); + this.context.putImageData(data, 200, 200); + }) + Button('start AI') + .id('button2') + .onClick(() => { + this.context.startImageAnalyzer(this.config) + }) + Button('stop AI') + .id('button3') + .onClick(() => { + this.context.stopImageAnalyzer(); + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c51972773b0288890d79500d356d66f4ee9574f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0180.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 UIComponentImageAicontroller0180 { + + @State types: string = '[]'; + private context: DrawingRenderingContext = new DrawingRenderingContext() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(true) + .onReady(() => { + this.context.canvas.drawCircle(200, 200, 100) + this.context.invalidate() + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + + }) + Button('stop AI') + .id('button3') + .onClick(() => { + + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..eba554f42cdbccfdb2d75ef88e41fd4c6bc76574 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0190.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 UIComponentImageAicontroller0190 { + + @State types: string = '[]'; + private context: DrawingRenderingContext = new DrawingRenderingContext() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + aiController: this.aiController + }; + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(true) + .onReady(() => { + this.context.canvas.drawCircle(200, 200, 100) + this.context.invalidate() + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + + }) + Button('stop AI') + .id('button3') + .onClick(() => { + + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..ea5e61732b7b50c3a6fd1774979a6849637e1cfa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0200.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 { JSON } from '@kit.ArkTS'; + +@Entry +@Component +struct UIComponentImageAicontroller0200 { + @State types: string = '[]'; + private context: DrawingRenderingContext = new DrawingRenderingContext() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + aiController: this.aiController + }; + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(true) + .onReady(() => { + this.context.canvas.drawCircle(200, 200, 100) + this.context.invalidate() + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + + }) + Button('stop AI') + .id('button3') + .onClick(() => { + + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..15a515555d96ea32fd5381209dcfec1dbcd2e387 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0210.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 UIComponentImageAicontroller0210 { + + @State types: string = '[]'; + private context: DrawingRenderingContext = new DrawingRenderingContext() + private aiController: ImageAnalyzerController = new ImageAnalyzerController(); + private options: ImageAIOptions = { + types: [ImageAnalyzerType.SUBJECT, ImageAnalyzerType.TEXT], + aiController: this.aiController + }; + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context, this.options) + .width('100%') + .height('60%') + .backgroundColor('#ffff00') + .enableAnalyzer(false) + .onReady(() => { + this.context.canvas.drawCircle(200, 200, 100) + this.context.invalidate() + }) + Text(`ImageAnalyzerSupportTypes:${this.types}`) + Row() { + Button("getTypes") + .id('button1') + .onClick(() => { + this.types = JSON.stringify(this.aiController.getImageAnalyzerSupportTypes()); + }) + Button('start AI') + .id('button2') + .onClick(() => { + + }) + Button('stop AI') + .id('button3') + .onClick(() => { + + }) + } + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..ced4f98295f62bf1bad5a085a6687612aca3d526 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0070.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 UIComponentInfomationMarqueeAnimation0070 { + @State start: boolean = true + @State logMessage: string = '' + @State loop: number = 1 + private src: string = '' + private fromStart: boolean = true + private step: number = 30 + private num: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: this.start, + step: this.step, + loop: this.loop, + fromStart: this.fromStart, + src: this.src + }) + .opacity(0.2) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .height(80) + .fontColor('#FFFFFF') + .fontSize(48) + .fontWeight(700) + .backgroundColor('#182431') + .margin({ bottom: 40 }) + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + this.num += 1; + this.logMessage = 'Marquee animation complete onFinish ' + this.num; + this.loop = 1; + }) + + Text(this.logMessage) + .margin(20) + .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/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c502223803493e39bc348c57c6ed62b5d4038a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0090.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 { Driver } from '@ohos.UiTest' + +@Entry +@Component +struct UIComponentInfomationMarqueeAnimation0090 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: true, + step: 30, + loop: -1, + fromStart: true, + src: 'Running Marquee starts rolling' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(800) + .height(80) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ecce170c5e8b2143bcbd14b27c0672bcf5fb8b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0100.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 { Driver } from '@ohos.UiTest' + +@Entry +@Component +struct UIComponentInfomationMarqueeAnimation0100 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: false, + step: 30, + loop: -1, + fromStart: true, + src: 'Running Marquee starts rolling' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .height(80) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebec435d4a6eda2052249b2e38b7cfd5cf45e927 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0010.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 i18n from '@ohos.i18n' + +@Entry +@Component +struct UIComponentInfomationMarqueeDirection0010 { + @State fromStart: boolean = true + + aboutToAppear() { + i18n.System.setAppPreferredLanguage("zh-Hans") + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: true, + step: 6, + loop: -1, + fromStart: this.fromStart, + src: 'Marquee text' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .direction(Direction.Rtl) + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + Button('true') + .onClick(() => { + this.fromStart = true + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button1') + Button('false') + .onClick(() => { + this.fromStart = false + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button2') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..7c41a29e6becd389e47a9478ab2461d646572f3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0040.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 i18n from '@ohos.i18n' + +@Entry +@Component +struct UIComponentInfomationMarqueeDirection0040 { + @State fromStart: boolean = true + + aboutToAppear() { + i18n.System.setAppPreferredLanguage("zh-Hans") + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: true, + step: 6, + loop: -1, + fromStart: this.fromStart, + src: 'Marquee text' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .direction(Direction.Ltr) + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + Button('true') + .onClick(() => { + this.fromStart = true + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button1') + Button('false') + .onClick(() => { + this.fromStart = false + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button2') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca75ce4baad0f9220507b02335a1edba4ee4b95b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0050.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 i18n from '@ohos.i18n' + +@Entry +@Component +struct UIComponentInfomationMarqueeDirection0050 { + @State fromStart: boolean = true + + aboutToAppear() { + i18n.System.setAppPreferredLanguage("zh-Hans") + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: true, + step: 6, + loop: -1, + fromStart: this.fromStart, + src: 'Marquee text' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .direction(Direction.Auto) + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + Button('true') + .onClick(() => { + this.fromStart = true + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button1') + Button('false') + .onClick(() => { + this.fromStart = false + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button2') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c5b3aa71003e8cb9ab43d11ba84546d33e3b14d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0070.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 i18n from '@ohos.i18n' + +@Entry +@Component +struct UIComponentInfomationMarqueeDirection0070 { + @State fromStart: boolean = true + + aboutToAppear() { + i18n.System.setAppPreferredLanguage("ug") + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: true, + step: 6, + loop: -1, + fromStart: this.fromStart, + src: 'ئۇيغۇر تىلى' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .direction(Direction.Rtl) + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + Button('true') + .onClick(() => { + this.fromStart = true + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button1') + Button('false') + .onClick(() => { + this.fromStart = false + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button2') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..2bcd911862d5aadf89f6314c0603400b523382f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0130.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 i18n from '@ohos.i18n' + +@Entry +@Component +struct UIComponentInfomationMarqueeDirection0130 { + @State fromStart: boolean = true + + aboutToAppear() { + i18n.System.setAppPreferredLanguage("ug") + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: true, + step: 6, + loop: -1, + fromStart: this.fromStart, + src: 'ئۇيغۇر تىلى' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .direction(Direction.Ltr) + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + Button('true') + .onClick(() => { + this.fromStart = true + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button1') + Button('false') + .onClick(() => { + this.fromStart = false + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button2') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f5a0512a0bcf1c56cefeed4bcccb7792a96b9f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0150.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 i18n from '@ohos.i18n' + +@Entry +@Component +struct UIComponentInfomationMarqueeDirection0150 { + @State fromStart: boolean = true + + aboutToAppear() { + i18n.System.setAppPreferredLanguage("ug") + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Marquee({ + start: true, + step: 6, + loop: -1, + fromStart: this.fromStart, + src: 'ئۇيغۇر تىلى' + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width(400) + .fontColor('#FFFFFF') + .fontSize(40) + .backgroundColor('#182431') + .direction(Direction.Auto) + .onStart(() => { + console.info('Marquee animation complete onStart') + }) + .onBounce(() => { + console.info('Marquee animation complete onBounce') + }) + .onFinish(() => { + console.info('Marquee animation complete onFinish') + }) + Button('true') + .onClick(() => { + this.fromStart = true + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button1') + Button('false') + .onClick(() => { + this.fromStart = false + }) + .width(120) + .height(40) + .backgroundColor('#007DFF') + .margin(20) + .fontSize(30) + .id('button2') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0640.ets new file mode 100644 index 0000000000000000000000000000000000000000..c40185070c20e781a37fe99c916bc82a68e1485c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0640.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentLineHeightDecorationLetterSpacing0640 { + @State typeClickCount: number = 0; + @State colorClickCount: number = 0; + @State type: TextDecorationType = TextDecorationType.None; + @State color: ResourceColor = Color.Black; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .decoration({ type: this.type, color: this.color }) + .id("searchId") + Button('decoration.type') + .onClick(() => { + this.typeClickCount++; + if (this.typeClickCount == 1) { + this.type = TextDecorationType.None; + } else if (this.typeClickCount == 2) { + this.type = TextDecorationType.Underline; + } else if (this.typeClickCount == 3) { + this.type = TextDecorationType.Overline; + } else if (this.typeClickCount == 4) { + this.type = TextDecorationType.LineThrough; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('typeButtonId') + Button('decoration.color') + .onClick(() => { + this.colorClickCount++; + if (this.colorClickCount == 1) { + this.color = Color.Pink; + } else if (this.colorClickCount == 2) { + this.color = 0x008000; + } else if (this.colorClickCount == 3) { + this.color = 'rgb(255, 0, 0)'; + } else if (this.colorClickCount == 4) { + this.color = '#0000ff'; + } else if (this.colorClickCount == 5) { + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('colorButtonId') + Button('Text') + .onClick(() => { + this.type = TextDecorationType.Underline; + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('textButtonId') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0660.ets new file mode 100644 index 0000000000000000000000000000000000000000..cdf78947f80fea9f2347b27b308b4b8ce07389a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0660.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentLineHeightDecorationLetterSpacing0660 { + @State typeClickCount: number = 0; + @State colorClickCount: number = 0; + @State type: TextDecorationType = TextDecorationType.None; + @State color: ResourceColor = Color.Black; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .decoration({ type: this.type, color: this.color }) + .id("searchId") + Button('decoration.type') + .onClick(() => { + this.typeClickCount++; + if (this.typeClickCount == 1) { + this.type = TextDecorationType.None; + } else if (this.typeClickCount == 2) { + this.type = TextDecorationType.Underline; + } else if (this.typeClickCount == 3) { + this.type = TextDecorationType.Overline; + } else if (this.typeClickCount == 4) { + this.type = TextDecorationType.LineThrough; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('typeButtonId') + Button('decoration.color') + .onClick(() => { + this.colorClickCount++; + if (this.colorClickCount == 1) { + this.color = Color.Pink; + } else if (this.colorClickCount == 2) { + this.color = 0x008000; + } else if (this.colorClickCount == 3) { + this.color = 'rgb(255, 0, 0)'; + } else if (this.colorClickCount == 4) { + this.color = '#0000ff'; + } else if (this.colorClickCount == 5) { + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('colorButtonId') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0670.ets new file mode 100644 index 0000000000000000000000000000000000000000..e1429431790ccc65997c4496d17667a8cef3e10d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0670.ets @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentLineHeightDecorationLetterSpacing0670 { + @State typeClickCount: number = 0; + @State colorClickCount: number = 0; + @State keyboardClickCount: number = 0; + @State type: TextDecorationType = TextDecorationType.None; + @State color: ResourceColor = Color.Black; + @State keyboardType: SearchType = SearchType.NUMBER; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .type(this.keyboardType) + .decoration({ type: this.type, color: this.color }) + .id("searchId") + Button('decoration.type') + .onClick(() => { + this.typeClickCount++; + if (this.typeClickCount == 1) { + this.type = TextDecorationType.None; + } else if (this.typeClickCount == 2) { + this.type = TextDecorationType.Underline; + } else if (this.typeClickCount == 3) { + this.type = TextDecorationType.Overline; + } else if (this.typeClickCount == 4) { + this.type = TextDecorationType.LineThrough; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('typeButtonId') + Button('decoration.color') + .onClick(() => { + this.colorClickCount++; + if (this.colorClickCount == 1) { + this.color = Color.Pink; + } else if (this.colorClickCount == 2) { + this.color = 0x008000; + } else if (this.colorClickCount == 3) { + this.color = 'rgb(255, 0, 0)'; + } else if (this.colorClickCount == 4) { + this.color = '#0000ff'; + } else if (this.colorClickCount == 5) { + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('colorButtonId') + Button('Type') + .onClick(() => { + this.keyboardClickCount++; + if (this.keyboardClickCount == 1) { + this.keyboardType = SearchType.NORMAL; + } else if (this.keyboardClickCount == 2) { + this.keyboardType = SearchType.EMAIL; + } else if (this.keyboardClickCount == 3) { + this.keyboardType = SearchType.NUMBER; + } else if (this.keyboardClickCount == 4) { + this.keyboardType = SearchType.PHONE_NUMBER; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('keyButtonId') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0680.ets new file mode 100644 index 0000000000000000000000000000000000000000..d352c966b47c1b1bfadb25df02157d0e32ee8494 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0680.ets @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentLineHeightDecorationLetterSpacing0680 { + @State typeClickCount: number = 0; + @State colorClickCount: number = 0; + @State alignClickCount: number = 0; + @State type: TextDecorationType = TextDecorationType.None; + @State color: ResourceColor = Color.Black; + @State alignType: Alignment = Alignment.End; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .align(this.alignType) + .decoration({ type: this.type, color: this.color }) + .id("searchId") + Button('decoration.type') + .onClick(() => { + this.typeClickCount++; + if (this.typeClickCount == 1) { + this.type = TextDecorationType.None; + } else if (this.typeClickCount == 2) { + this.type = TextDecorationType.Underline; + } else if (this.typeClickCount == 3) { + this.type = TextDecorationType.Overline; + } else if (this.typeClickCount == 4) { + this.type = TextDecorationType.LineThrough; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('typeButtonId') + Button('decoration.color') + .onClick(() => { + this.colorClickCount++; + if (this.colorClickCount == 1) { + this.color = Color.Pink; + } else if (this.colorClickCount == 2) { + this.color = 0x008000; + } else if (this.colorClickCount == 3) { + this.color = 'rgb(255, 0, 0)'; + } else if (this.colorClickCount == 4) { + this.color = '#0000ff'; + } else if (this.colorClickCount == 5) { + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('colorButtonId') + Button('Align') + .onClick(() => { + this.alignClickCount++; + if (this.alignClickCount == 1) { + this.alignType = Alignment.Start; + } else if (this.alignClickCount == 2) { + this.alignType = Alignment.Center; + } else if (this.alignClickCount == 3) { + this.alignType = Alignment.End; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('alignButtonId') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0690.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f76ba1f8434751261509b81f88da6850e53797d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0690.ets @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentLineHeightDecorationLetterSpacing0690 { + @State typeClickCount: number = 0; + @State colorClickCount: number = 0; + @State fontClickCount: number = 0; + @State type: TextDecorationType = TextDecorationType.None; + @State color: ResourceColor = Color.Black; + @State fontSize: number = 12; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .textFont({ size: this.fontSize }) + .decoration({ type: this.type, color: this.color }) + .id("searchId") + Button('decoration.type') + .onClick(() => { + this.typeClickCount++; + if (this.typeClickCount == 1) { + this.type = TextDecorationType.None; + } else if (this.typeClickCount == 2) { + this.type = TextDecorationType.Underline; + } else if (this.typeClickCount == 3) { + this.type = TextDecorationType.Overline; + } else if (this.typeClickCount == 4) { + this.type = TextDecorationType.LineThrough; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('typeButtonId') + Button('decoration.color') + .onClick(() => { + this.colorClickCount++; + if (this.colorClickCount == 1) { + this.color = Color.Pink; + } else if (this.colorClickCount == 2) { + this.color = 0x008000; + } else if (this.colorClickCount == 3) { + this.color = 'rgb(255, 0, 0)'; + } else if (this.colorClickCount == 4) { + this.color = '#0000ff'; + } else if (this.colorClickCount == 5) { + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('colorButtonId') + Button('fontSize') + .onClick(() => { + this.fontClickCount++; + if (this.fontClickCount == 1) { + this.fontSize = 0; + } else if (this.fontClickCount == 2) { + this.fontSize = 10; + } else if (this.fontClickCount == 3) { + this.fontSize = 20; + } else if (this.fontClickCount == 4) { + this.fontSize = 30; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('fontButtonId') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0710.ets new file mode 100644 index 0000000000000000000000000000000000000000..108b1a7e70797eb851285e98af6190b8489c035b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0710.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 UIComponentLineHeightDecorationLetterSpacing0710 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .id("searchId") + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0730.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0730.ets new file mode 100644 index 0000000000000000000000000000000000000000..da48be8bd3651244aa5b97ab42d36dd62c8ad9d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0730.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 i18n from '@ohos.i18n'; +import { SymbolGlyphModifier } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentLineHeightDecorationLetterSpacing0730 { + aboutToAppear(): void { + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({ value: 'Search a text' }) + .searchIcon(new SymbolGlyphModifier($r('sys.symbol.magnifyingglass')).fontColor([Color.Transparent])) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .letterSpacing(3) + .id("searchId1") + Search({ value: 'Search b text' }) + .searchIcon(new SymbolGlyphModifier($r('sys.symbol.magnifyingglass')).fontColor([Color.Transparent])) + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .letterSpacing(-2) + .id("searchId2") + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0770.ets new file mode 100644 index 0000000000000000000000000000000000000000..eb5a2d28d63c376160c595d544786ed7e2622974 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0770.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. + */ + +@Entry +@Component +struct UIComponentLineHeightDecorationLetterSpacing0770 { + @State spacingClickCount: number = 0; + @State fontClickCount: number = 0; + @State spacing: string | number = 0; + @State fontSize: number = 12; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .textFont({ size: this.fontSize }) + .letterSpacing(this.spacing) + .id("searchId") + Button('letterSpacing') + .onClick(() => { + this.spacingClickCount++; + if (this.spacingClickCount == 1) { + this.spacing = -2; + } else if (this.spacingClickCount == 2) { + this.spacing = 0; + } else if (this.spacingClickCount == 3) { + this.spacing = 3; + } else if (this.spacingClickCount == 4) { + this.spacing = '5px'; + } else if (this.spacingClickCount == 5) { + this.spacing = '10%'; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('spacingButtonId') + Button('fontSize') + .onClick(() => { + this.fontClickCount++; + if (this.fontClickCount == 1) { + this.fontSize = 0; + } else if (this.fontClickCount == 2) { + this.fontSize = 10; + } else if (this.fontClickCount == 3) { + this.fontSize = 20; + } else if (this.fontClickCount == 4) { + this.fontSize = 30; + } + }) + .width(200) + .height(40) + .fontSize(16) + .backgroundColor('#007DFF') + .margin(20) + .id('fontButtonId') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentMagnifyingGlass/UIComponentMagnifyingGlass0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentMagnifyingGlass/UIComponentMagnifyingGlass0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..26c93db6f9a486075e8e0350c1b8317f8f92fc02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentMagnifyingGlass/UIComponentMagnifyingGlass0010.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 UIComponentMagnifyingGlass0010 { + + build() { + Column() { + TextInput({ text: '文本拖拽'}) + .id('UIComponentMagnifyingGlass0010_001') + .width(100) + } + .alignItems(HorizontalAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxTimepickerdialogInterface/UIComponentPopupboxTimepickerdialogInterface1190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxTimepickerdialogInterface/UIComponentPopupboxTimepickerdialogInterface1190.ets new file mode 100644 index 0000000000000000000000000000000000000000..33039cbd6e960b6c341eaa6ac571dd80dc2dfaf9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxTimepickerdialogInterface/UIComponentPopupboxTimepickerdialogInterface1190.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 UIComponentPopupboxTimepickerdialogInterface1190 { + private selectTime: Date = new Date('2020-12-25T08:30:00'); + + build() { + Row() { + Column() { + Button("TimePickerDialog 24小时制") + .id('UIComponentPopupboxTimepickerdialogInterface1190_001') + .margin(20) + .onClick(() => { + this.getUIContext().showTimePickerDialog({ + selected: this.selectTime, + useMilitaryTime: true, + textStyle: { + font: { + family: 'Arial,HarmonyOS Sans' + } + }, + onAccept: (value: TimePickerResult) => { + if (value.hour != undefined && value.minute != undefined) { + this.selectTime.setHours(value.hour, value.minute); + console.info("TimePickerDialog:onAccept()" + JSON.stringify(value)); + } + }, + onCancel: () => { + console.info("TimePickerDialog:onCancel()"); + }, + onChange: (value: TimePickerResult) => { + console.info("TimePickerDialog:onChange()" + JSON.stringify(value)); + }, + onDidAppear: () => { + console.info("TimePickerDialog:onDidAppear()"); + }, + onDidDisappear: () => { + console.info("TimePickerDialog:onDidDisappear()"); + }, + onWillAppear: () => { + console.info("TimePickerDialog:onWillAppear()"); + }, + onWillDisappear: () => { + console.info("TimePickerDialog:onWillDisappear()"); + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing024.ets new file mode 100644 index 0000000000000000000000000000000000000000..90e65209f9e4c0e78e20635d06969a1ee709f113 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing024.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 UIComponentRichEditorSymbolShuffleEditing024 { + @State effectStrategy: number = 0 + + build() { + Column({ space: 20 }) { + Button(this.effectStrategy === 0 ? '无动效' : this.effectStrategy === 1 ? '缩放动效' : '层级动效') + .id('UIComponentRichEditorSymbolShuffleEditing024_001') + .onClick(() => { + if (this.effectStrategy === 2) { + this.effectStrategy = 0 + } else { + this.effectStrategy++ + } + }) + Text() { + SymbolSpan($r('sys.symbol.ohos_wifi')) + .fontSize(96) + .effectStrategy(this.effectStrategy) + } + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing026.ets new file mode 100644 index 0000000000000000000000000000000000000000..1922b4ce9f60cd61170e6dda27e9f2dc6b5bc807 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing026.ets @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentRichEditorSymbolShuffleEditing026 { + controller: RichEditorController = new RichEditorController() + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0 + @State end: number = 0 + + build() { + Column({ space: 20 }) { + + Row({ space: 50 }) { + Text(`start: ${this.start}`) + Text(`end: ${this.end}`) + } + + Button('start与end都为2') + .id('UIComponentRichEditorSymbolShuffleEditing026_002') + .onClick(() => { + this.start = 2 + this.end = 2 + }) + + Button('start为-1,end为2') + .id('UIComponentRichEditorSymbolShuffleEditing026_003') + .onClick(() => { + this.start = -1 + this.end = 2 + }) + + Button('start为4,end超过总长') + .id('UIComponentRichEditorSymbolShuffleEditing026_004') + .onClick(() => { + this.start = 4 + this.end = 100 + }) + + Button('update') + .id('UIComponentRichEditorSymbolShuffleEditing026_001') + .onClick(() => { + this.controller.updateSpanStyle({ + start: this.start, + end: this.end, + symbolStyle: { + fontSize: 40, + effectStrategy: SymbolEffectStrategy.HIERARCHICAL, + fontColor: [Color.Red] + } + }) + }) + RichEditor(this.options) + .onReady(() => { + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_trash'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_wifi'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_folder_badge_plus'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_photo'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_star'), + { + style: { fontSize: 90 } + } + ) + }) + + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing027.ets new file mode 100644 index 0000000000000000000000000000000000000000..859906a0f012d1decd4f120e6fcf86b40dfab82f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing027.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentRichEditorSymbolShuffleEditing027 { + controller: RichEditorController = new RichEditorController() + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0 + @State end: number = 0 + + build() { + Column({ space: 20 }) { + Button('设置SelectIndex') + .id('UIComponentRichEditorSymbolShuffleEditing027_001') + .onClick(() => { + this.controller.setSelection(0, 3) + }) + Button('更新SymbolSpan') + .id('UIComponentRichEditorSymbolShuffleEditing027_003') + .onClick(() => { + this.controller.updateSpanStyle({ + start: this.start, + end: this.end, + symbolStyle: { + fontSize: 40, + effectStrategy: SymbolEffectStrategy.HIERARCHICAL, + fontColor: [Color.Red] + } + }) + }) + RichEditor(this.options) + .id('UIComponentRichEditorSymbolShuffleEditing027_002') + .onReady(() => { + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_trash'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_wifi'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_folder_badge_plus'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_photo'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_star'), + { + style: { fontSize: 90 } + } + ) + }) + .onSelectionChange((range: RichEditorRange) => { + this.start = range.start ?? 0 + this.end = range.end ?? 0 + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing028.ets new file mode 100644 index 0000000000000000000000000000000000000000..39126046d44713ac4bb4f1d98a4b9c5459dc6568 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing028.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. + */ + +@Entry +@Component +struct UIComponentRichEditorSymbolShuffleEditing028 { + controller: RichEditorController = new RichEditorController() + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0 + @State end: number = 0 + + build() { + Column({ space: 20 }) { + + Row({ space: 50 }) { + Text(`start: ${this.start}`) + Text(`end: ${this.end}`) + } + + Button('start与end都为2') + .id('UIComponentRichEditorSymbolShuffleEditing028_002') + .onClick(() => { + this.start = 2 + this.end = 2 + }) + + Button('start为-1,end为2') + .id('UIComponentRichEditorSymbolShuffleEditing028_003') + .onClick(() => { + this.start = -1 + this.end = 2 + }) + + Button('start为4,end超过总长') + .id('UIComponentRichEditorSymbolShuffleEditing028_004') + .onClick(() => { + this.start = 4 + this.end = 100 + }) + + Button('Delete') + .id('UIComponentRichEditorSymbolShuffleEditing028_001') + .onClick(() => { + this.controller.deleteSpans({ + start: this.start, + end: this.end, + }) + }) + RichEditor(this.options) + .onReady(() => { + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_trash'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_wifi'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_folder_badge_plus'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_photo'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_star'), + { + style: { fontSize: 90 } + } + ) + }) + + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing029.ets new file mode 100644 index 0000000000000000000000000000000000000000..b492d4cbcc374073b5773fa20c85204f447017b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing029.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 UIComponentRichEditorSymbolShuffleEditing029 { + controller: RichEditorController = new RichEditorController() + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0 + @State end: number = 0 + + build() { + Column({ space: 20 }) { + Button('设置SelectIndex') + .id('UIComponentRichEditorSymbolShuffleEditing029_001') + .onClick(() => { + this.controller.setSelection(0, 3) + }) + Button('删除SymbolSpan') + .id('UIComponentRichEditorSymbolShuffleEditing029_003') + .onClick(() => { + this.controller.deleteSpans({ + start: this.start, + end: this.end + }) + }) + RichEditor(this.options) + .id('UIComponentRichEditorSymbolShuffleEditing029_002') + .onReady(() => { + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_trash'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_wifi'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_folder_badge_plus'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_photo'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_star'), + { + style: { fontSize: 90 } + } + ) + }) + .onSelectionChange((range: RichEditorRange) => { + this.start = range.start ?? 0 + this.end = range.end ?? 0 + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing030.ets new file mode 100644 index 0000000000000000000000000000000000000000..382d34c16d4c745b60282726aa5bb91ff883a52a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing030.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 UIComponentRichEditorSymbolShuffleEditing030 { + controller: RichEditorController = new RichEditorController() + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0 + @State end: number = 0 + @State content: string = "" + + build() { + Column({ space: 20 }) { + + Row({ space: 50 }) { + Text(`start: ${this.start}`) + Text(`end: ${this.end}`) + } + + Button('start与end都为2') + .id('UIComponentRichEditorSymbolShuffleEditing030_002') + .onClick(() => { + this.start = 2 + this.end = 2 + }) + + Button('start为-1,end为2') + .id('UIComponentRichEditorSymbolShuffleEditing030_003') + .onClick(() => { + this.start = -1 + this.end = 2 + }) + + Button('start为4,end超过总长') + .id('UIComponentRichEditorSymbolShuffleEditing030_004') + .onClick(() => { + this.start = 4 + this.end = 100 + }) + + Button('Get') + .id('UIComponentRichEditorSymbolShuffleEditing030_001') + .onClick(() => { + this.content = "" + this.controller.getSpans({ + start: this.start, + end: this.end, + }).forEach(item => { + if (typeof (item as RichEditorImageSpanResult)['imageStyle'] != 'undefined') { + this.content += (item as RichEditorImageSpanResult).valueResourceStr; + this.content += "\n" + } else { + if (typeof (item as RichEditorTextSpanResult)['symbolSpanStyle'] != 'undefined') { + // this.content += (item as RichEditorTextSpanResult).symbolSpanStyle?.fontSize; + this.content += `spanIndex: ${item.spanPosition.spanIndex} ${(item as RichEditorTextSpanResult).value}` + this.content += "\n" + } else { + this.content += (item as RichEditorTextSpanResult).value; + this.content += "\n" + } + } + }) + }) + + Text() { + Span(this.content) + }.width('100%') + + RichEditor(this.options) + .onReady(() => { + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_trash'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_wifi'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_folder_badge_plus'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_photo'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_star'), + { + style: { fontSize: 90 } + } + ) + }) + + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9fd834c33b643550c118a4473b6a6da2b9dbed7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing0310.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 UIComponentRichEditorSymbolShuffleEditing0310 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + private start: number = -1; + private end: number = -1; + @State message: string = "[-1, -1]" + @State content: string = "" + + build() { + Column() { + Column() { + Text("展示获取获取选中位置的内容:" + this.content).margin({ bottom: 40,top: 40 }).fontSize(20) + Row(){ + Text("SymbolSpan为: ").margin({ bottom: 20, top: 20 }) + RichEditor(this.options) + .onReady(() => { + this.controller.addSymbolSpan($r("sys.symbol.ohos_trash"), + { + style: + { + fontSize: 80 + } + }) + }) + .borderColor(Color.Green) + .width("100%") + .height("30%") + + } + Button("获取选择内容").onClick(() => { + this.content = ""; + this.controller.getSpans({ + start: this.start, + end: this.end + }).forEach(item => { + if(typeof(item as RichEditorTextSpanResult)['symbolSpanStyle'] != 'undefined') { + this.content += (item as RichEditorTextSpanResult).value; + } + }) + }).margin({ top: 40 }).fontSize(30).id("SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0310_button") + } + .borderWidth(1) + .borderColor(Color.Red) + .width("100%") + .height("50%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing032.ets new file mode 100644 index 0000000000000000000000000000000000000000..e64968bc28b63edf92e0b3fa455fd060267e1151 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing032.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. + */ + +@Entry +@Component +struct UIComponentRichEditorSymbolShuffleEditing032 { + controller: RichEditorController = new RichEditorController() + options: RichEditorOptions = { controller: this.controller }; + @State start: number = 0 + @State end: number = 0 + @State content: string = "" + + build() { + Column({ space: 20 }) { + + Row() { + Button('添加TextSpan') + .id('UIComponentRichEditorSymbolShuffleEditing032_001') + .onClick(() => { + this.controller.addTextSpan( + '这是一段测试文本', + { + style: { fontSize: 20, fontColor: Color.Blue } + } + ) + }) + + Button('添加ImageSpan') + .id('UIComponentRichEditorSymbolShuffleEditing032_002') + .onClick(() => { + this.controller.addImageSpan( + 'cat.jpg', + { + imageStyle: { size: [50, 50] } + } + ) + }) + } + .width('100%') + .justifyContent(FlexAlign.SpaceEvenly) + + Row() { + Button('添加SymbolSpan') + .id('UIComponentRichEditorSymbolShuffleEditing032_003') + .onClick(() => { + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_wifi'), + { + style: { fontSize: 90 } + } + ) + this.controller.addSymbolSpan( + $r('sys.symbol.ohos_star'), + { + style: { fontSize: 90 } + } + ) + }) + Button('更新SymbolSpan') + .id('UIComponentRichEditorSymbolShuffleEditing032_004') + .onClick(() => { + this.controller.updateSpanStyle({ + start: 10, + end: 11, + symbolStyle: { + fontSize: 40, + effectStrategy: SymbolEffectStrategy.HIERARCHICAL, + fontColor: [Color.Red] + } + }) + }) + } + .width('100%') + .justifyContent(FlexAlign.SpaceEvenly) + + Row() { + Button('删除SymbolSpan') + .id('UIComponentRichEditorSymbolShuffleEditing032_005') + .onClick(() => { + this.controller.deleteSpans({ + start: 12, + end: 13 + }) + }) + + Button('获取SymbolSpan') + .id('UIComponentRichEditorSymbolShuffleEditing032_006') + .onClick(() => { + this.content = "" + this.controller.getSpans({ + start: 9, + end: 10, + }).forEach(item => { + if (typeof (item as RichEditorImageSpanResult)['imageStyle'] != 'undefined') { + this.content += (item as RichEditorImageSpanResult).valueResourceStr; + this.content += "\n" + } else { + if (typeof (item as RichEditorTextSpanResult)['symbolSpanStyle'] != 'undefined') { + // this.content += (item as RichEditorTextSpanResult).symbolSpanStyle?.fontSize; + this.content += `symbolFont ${(item as RichEditorTextSpanResult).symbolSpanStyle?.fontSize} spanIndex: ${item.spanPosition.spanIndex} ${(item as RichEditorTextSpanResult).value}` + this.content += "\n" + } else { + this.content += (item as RichEditorTextSpanResult).value; + this.content += "\n" + } + } + }) + }) + } + .width('100%') + .justifyContent(FlexAlign.SpaceEvenly) + + Text() { + Span(this.content) + }.width('100%') + + RichEditor(this.options) + .onReady(() => { + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UiComponentSymbolSymbolColoirrendering011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UiComponentSymbolSymbolColoirrendering011.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cb9f991e03158e4dbec6a7a647194df7be5c7b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentRichEditorSymbolShuffleEditing/UiComponentSymbolSymbolColoirrendering011.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 UiComponentSymbolSymbolColoirrendering011 { + @State changeValue: string = '' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + build() { + Column({space: 10}) { + Row() { + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .searchButton('SEARCH') + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + src: $r("app.media.big_icon") + } + }).id("UiComponentSymbolSymbolColoirrendering011_button") + .width('60%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + this.submitValue = value + }) + .onChange((value: string) => { + this.changeValue = value + }) + .margin(20) + Button("search").fontSize(10).focusable(true) + Button("cancel").fontSize(10).focusable(true) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0010.ets index e31d9512aecc683ecb95a3a43cc48e76ede0eaa7..b8f723d64ac9ec43f4ba601d27d9546da5294f08 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0010.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0010.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0030.ets index 9aff3705b96b36d47284b3ee99abb9584abf0e6d..395a30126de1e0f732a42d8ae020eea1096466f7 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0030.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0030.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0060.ets index 573732910f548f487a1d3cf0010d13baa7f4f201..26846a37c95ab823185143d801f04c9ecce3c167 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0060.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperAcross/UIComponentScrollSwiperAcross0060.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperDisplaycount/UIComponentScrollSwiperDisplaycount0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperDisplaycount/UIComponentScrollSwiperDisplaycount0140.ets index a2f7f529303afcf24428b490fdec8ccbc8d6415f..6addd7bf8af934dc68f282abcde924ba09bb1d7e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperDisplaycount/UIComponentScrollSwiperDisplaycount0140.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperDisplaycount/UIComponentScrollSwiperDisplaycount0140.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0820.ets index b6453c037b2651f8b159286d8827c851f2c1d676..a24d165567f49af9b0e0d9f1ef8d1e7298a65c90 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0820.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0820.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0830.ets index ed023a05d2f3029b7c0ba66244aea4de717a4d5e..17c16b1db9206b8df12e7ac73b78a801a0b70a43 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0830.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0830.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0890.ets index 0b906418cdcdb68188544560af0d492b161e6d4d..853c9144562e14d2c7fa80970860244f99e9be10 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0890.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0890.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0960.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0960.ets index 41785120074dad1b9a6e694d7cc1f69048d63566..294aff824f137ea21a5ccb6fa8b895bc6d6f9601 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0960.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0960.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0980.ets index d5ff8217dea0ada69db1bd6ec4e9fe045bd7db99..d3404d8395b9d4a99de5a1f4bd51dc11d617df9a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0980.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0980.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0990.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0990.ets index 70fa20d68964335a0c485aa218c703742ca3549a..686f7e61f12ec1a1052ae477a5ef8ab5e37c5d97 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0990.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface0990.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2180.ets index 9a58bb458ea0bf8187e75fb0bb0f42e5b9baa921..26c731633870dc579fb50995c7bf33206d76d045 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2180.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2180.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2190.ets index 975b94e9e65ef3b41b336c80e5a08ae7778447cc..0e598c669a5fd9a77dff3a5b02cef87fdb845037 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2190.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2190.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2200.ets index f94360a8d4f0f5c4a6c3ad6c165a69f62de2a1da..d76e0bb906eeea2f32582612bce80a0be359271b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2200.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2200.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2210.ets index e9712267ee27dab37a9eb1573a849c6db9735d7d..542d52d0965c3394e60d9281b56f730762160007 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2210.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2210.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2230.ets index 2c7058c5c164d4326b81935dfbb64d02f3629700..9be6bcac8ca39a0c0be2b0b2c2f575fee762d717 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2230.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2230.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2330.ets index 88195bc511d7f94ccdc4fe007ea7985aa3f4cf62..86f83795c94ee0bf3b93faafd4af22246f5debb2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2330.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2330.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2340.ets index d3b880ae1a8f7e6cdffca6958371375f6fa5b596..b7cebb31ed15e99dec772e9ac6794b07a0e815cf 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2340.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2340.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2350.ets index 741ccd0beaefb614e02b1c0001378bd478cb9c08..647dff8aea930207d7eed47497947e73ab708035 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2350.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2350.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2460.ets index 36fbedd9e6f23168e041f8e485e5444cfd2b37ac..85d2d903418b1ef455e00318be1a7a3e4504e99b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2460.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2460.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2560.ets index 9ec4b05b005dc4253f2ced1eee43c37aabc2761f..7c3d701bea82461b3a6556c485996e2aaf44e0e8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2560.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2560.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2570.ets index 69c6e1b96abe877f2f0b2710e5c89e38263a380a..6af25e27f03fdf5d2ca0836b6763a6ed0e61aeab 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2570.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2570.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2720.ets index 677562985bdde87e3b4f0ccd3386a7cf7c4ffb89..8b543d388b010e708bbe6a4e33d149fa8b72496c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2720.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2720.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2790.ets index 96bc460e2cf32e7ada48f78c6b01e21b676ccf1a..2569b04247886990a5028f89f9b06d30f5d9a09e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2790.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface2790.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3160.ets index 76f68d4257b3297f92bdd418b34db5cc351b9039..5af748f6d067607efa971964b2d78f95eae5e041 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3160.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3160.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3300.ets index b1b2fb9ae7aaf7672b3e47bad77e3dab7967372f..81eaa5ea3963afea38921b9459ce99566a10b7bb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3300.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3300.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3310.ets index bcdaa70c79157f0aa5bed67382f2bc67943d640e..cf2190c1ab6c1b401fd0885f3ba4a2791cb22786 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3310.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3310.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3330.ets index 3be10976214507808894bd3fff42e6ecf09dac31..c22b43c3e9c9f83fd786a8c2755a439f638c4986 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3330.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3330.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3340.ets index 8cd9cf67b7561f3fbc6251da383c087d3c30d332..1c8e96127caeea637d292112e1803b1c69e6c6f9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3340.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3340.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3350.ets index 538c00b980f9458f124b2be00db704b011e3246e..6a80d239081954ce07a24706dd2aa9d984c74455 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3350.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3350.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3380.ets index 223417106e7c6922a61936cdd544b8cf9271db93..8a2306f5c121b0e764ebd93871fbf68a4a8a1107 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3380.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3380.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3390.ets index e4fe1d8902d90efcedb3dba923ea4b78c2b58d50..5b1e96e25d04d717bc3e655a3a7cc1776591bf55 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3390.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3390.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3430.ets index dd170251cbdc100e2585bf8c233207deab88a4ac..9c524ac57754f316f4461894c6ae715f2258f681 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3430.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3430.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3450.ets index 474cb2b10fec38f4d80785d6870087156a41baed..f297d6c2a036b70313922faf9bf0c2b072c2e5e8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3450.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3450.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3460.ets index f2e938a2240de893ec66a8d1aca20d56b187aa84..bbd9eca9f6e17077bce6ae169a38b620115c42bf 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3460.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3460.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3500.ets index 29ab6ff2bcba59ee3895e8e12b2713c05608b43b..d0a7a39edbe7ed7590dc8c797db0fb0836cc61a0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3500.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3500.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3510.ets index bceebb024b4707507acb02b2e32a1f682605243e..e2ef40a2a3c7c4edd12b127bdb76121b10acf636 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3510.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3510.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3520.ets index 3f30130dd22b0d8b6d744f589a91d2f0cb43d1fd..62c388f31ec77ed95dcb5615cda504913752628c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3520.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3520.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3530.ets index 1549e62d47a72a7d0d827a5e06c18ec3fc0c66b5..186a91e4b44dada05e6a6d947a7f3092093eff6e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3530.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3530.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3550.ets index 90afe05eb1eea73548c61ea509f8c5706f43c091..e058d468e8878b814ff98affa3f456e3b6c422a4 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3550.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3550.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3560.ets index b3c8c887777029038d37cd4dcacaeffd42d9400f..97e50db23482dd8c50e3e0718dfd16c859fd0eed 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3560.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3560.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3570.ets index bbfa9d91f464d2d3a0f25e913261b21c9aa4af2d..6aa8589b118e3a992d89fad18142b7a0b3c9acac 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3570.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3570.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3600.ets index be48ec33df29746c9fc8e7aefdbf510edfbd9d13..1ecec8736561d9b2006cb13c503b399696dd9ceb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3600.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3600.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3610.ets index 5810f69044afe316b9306879dd2f6de5be51fe5f..be960a26c9a8c18b100933cb406a9663774c04a8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3610.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3610.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3700.ets index 56142636dbade5c335d05e20c1bd6e1cadd081a4..9eac96333d56b9f0141fedcbf2f06502cb3e10be 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3700.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3700.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3780.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3780.ets index 11ab8441d5d967a55eb9df1f00eeb07aa0d27fc1..67c7108946fcc6e22b4921066e9e7cd13238ec76 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3780.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3780.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3790.ets index a4eb325b4270db5eb207d1d89e88ce0180d8cf4d..0da1bcd32f49cd293a3b68b6f0bbf31282a628d2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3790.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3790.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3810.ets index ef3ee1974039b756db81041b9b592a84933bfaea..8d35b4e27a15df0ce431e76f51c6a0e5dd303f24 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3810.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3810.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3820.ets index c9241c56879ccb61c5b95d5c565eb7ad528e584c..8040fe2e1b516d9e4fc68d8f0ad5313c04b1d148 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3820.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperInterface/UIComponentScrollSwiperInterface3820.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0770.ets index 1ecb61807d1592b2a86b8123f5eb867b4fe2b89c..3452be736a7019a9414e2f1f36adb5722b23f83b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0770.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0770.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0790.ets index 5495cdd9e8011dd5733f577a7c0d097e4de0c619..d65390db5d048678731dcf929dbfde607c760997 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0790.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0790.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0810.ets index 63896e8138ce8c293d4c44f62b828ebd2d915e7f..4266ff26ac5247efae4ae7c7f17c7b6845be0a08 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0810.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout0810.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1020.ets index dc87d30d9e152cf3b13ee0564c5c61d293319de5..23246d2b7da2e6957ed5cd8822292c3561430cf2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1020.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1020.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1040.ets index 68445d29396781bb38dedc9ca9676852a66dc529..377583b85961de51f79ba581dcad4cb16acd133b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1040.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1040.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1050.ets index ebb3e85be74971a8922e5961ed7b4ac26f285709..854758d4419f35a4805acafa8d86b0fcf5924eac 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1050.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1050.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1060.ets index 4e1426182edbf0f39533cc84f26ba7d3f5805855..e61273bbf031c23efc969a18ca26644564db5b84 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1060.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1060.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1800.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1800.ets index 46607cc3c14d6ec89f708d075e2aa853487729d1..244196cfe216961b4399115a3e3c18d7e75c5183 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1800.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1800.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1810.ets index 5e4a1055bfb17a5171a4956604b61911f37572c9..aff231d9717217f7a551c964410ece1c18735082 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1810.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1810.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1820.ets index c1b313812ea9a562db67df20cbe083af9b1af194..3db223fc7bab09815e801939ae95d5c564b8c9d8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1820.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1820.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1830.ets index 2b21f4d210fb4b1df2e83a87ead3bf6e121a539f..b2480ec0302d416cbda98912dcb99fb36528bc05 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1830.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1830.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1840.ets index 3b38082718a5861c051327b35cf7c70bba513796..12a6e24a3bb45b078f8a4ba1af8c415110547901 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1840.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1840.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1850.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1850.ets index c5e076deb23e319e63ed49b02c10feb5e986e914..789518181739d49e78fe8d8e745aad29549d08ad 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1850.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout1850.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2060.ets index 712d4595e9bde425fead4efc776272a34c63611a..013ad5ad7895f3158b3282256b458410277a7374 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2060.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2060.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2070.ets index bfbc49fb64eed14d1f79cb9461a889d817528b7c..91c54ea149eba57d7f329ef726c714824ad90986 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2070.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2070.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2080.ets index 950112e342c70d91bb505cadf35cc1605ed29157..511245b04317a8674dec9ed7ad649ef6b22a320b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2080.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2080.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2090.ets index 5148d67fb6971a3bd918a557f6c52a7663374be9..07b6a9b77f4a5cf3bd621e204a9ae3056f7d2d18 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2090.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2090.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2100.ets index 015f4c7bcde6aefa9ccc8795adc7b093eeb4c03f..6b78764cdf1bfe84c97ee4cd12282b758b11d3aa 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2100.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2100.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2110.ets index 89c4c993bcdf0da1b5ac69da825b2945a53552a8..54fd9b2a8b9fd4436921427a7252ba1a5308df83 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2110.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperLayout/UIComponentScrollSwiperLayout2110.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0070.ets index 7570aa339a51475ff36d0a81287df29ddec00d73..a4e90215886117e3c19d81d82d96be7cc28d0abb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0070.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0070.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0080.ets index 2b401f6ebaad39f4a6c6562849662d8e0f629433..a766519f23c76e4c2784d98b0777a01bbd667860 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0080.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperTeace/UIComponentScrollSwiperTeace0080.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0010.ets index 4b8aaee490f21e69c725eced8229ef827464c7f5..8b4b3a1823693fb646fef24781f2bb8750db764b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0010.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0010.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0020.ets index 7881799e8b434c7bb7f7709a5dc12136c66c0b36..860f33fbe4d4ab025b23ac974d214589401407f6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0020.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0020.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0520.ets index 99aa52e22d53d933fdf5a8e2b1f4594b4f34c22a..97c1857b85131d6a0e6a5b601cb61745b66a0329 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0520.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperUx/UIComponentScrollSwiperUx0520.ets @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency001.ets new file mode 100644 index 0000000000000000000000000000000000000000..4da5ab7c0cb5369cce8920cc071dd71454bd9a7f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency001.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 inputMethod from '@ohos.inputMethod'; +import inputMethodEngine from '@ohos.inputMethodEngine'; + +@Entry +@Component +struct UIComponentSearchSearchUxconsistency001 { + @State mFocus: string = "false"; + + aboutToAppear(): void { + try { + inputMethod.getSetting().on('imeShow', (info: Array) => { + console.info('Succeeded in subscribing imeShow event.'); + this.mFocus = "true" + }); + inputMethod.getSetting().on('imeHide', (info: Array) => { + console.info('Succeeded in subscribing imeShow event.'); + this.mFocus = "false" + }); + } catch (err) { + console.error(`Failed to unsubscribing imeShow. err: ${JSON.stringify(err)}`); + } + } + + build() { + Column() { + Search({}).searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + // .onFocus(() => { + // this.mFocus = "true" + // }) + Text(`是否开启键盘:${this.mFocus}`) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency002.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3b0085abb625f0e73e7095f04c18243ea0effbe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency002.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 UIComponentSearchSearchUxconsistency002 { + @State mFocus: string = "false"; + + build() { + Column() { + Search({ + value: '' + }).searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .defaultFocus(false) + .onFocus(() => { + this.mFocus = "true" + }) + Text(`是否获取焦点:${this.mFocus}`) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency003.ets new file mode 100644 index 0000000000000000000000000000000000000000..ef6066986317866665e0dabe953486960172fdaa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency003.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 UIComponentSearchSearchUxconsistency003 { + @State mFocus: string = "false"; + + build() { + Column() { + Search({ + value: 'Hello' + }).searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .defaultFocus(false) + .onFocus(() => { + this.mFocus = "true" + }) + Text(`是否获取焦点:${this.mFocus}`) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency004.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3de20a34d0b44cd61d9715c096803bf1100df08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency004.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 UIComponentSearchSearchUxconsistency004 { + @State mFocus: string = "false"; + + build() { + Column() { + Row() { + Search({}) + .searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }) + .defaultFocus(false) + .onFocus(() => { + this.mFocus = "true" + }) + .layoutWeight(1) + Button("Btn1").focusable(true) + Button("Btn2").focusable(true) + }.width('100%') + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency005.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f0f45bd1248304ee5165a0ef687c317740e5dcc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency005.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 UIComponentSearchSearchUxconsistency005 { + build() { + Row() { + Search({}).searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }).layoutWeight(1) + Button("Btn1").focusable(true) + Button("Btn2").focusable(true) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency006.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7a25cd0c60d11f2353a626b4b25cebe354b91a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency006.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 UIComponentSearchSearchUxconsistency006 { + build() { + Row() { + Search({}).layoutWeight(1) + Button("Btn1").focusable(true) + Button("Btn2").focusable(true) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency007.ets new file mode 100644 index 0000000000000000000000000000000000000000..b8be8090eb89bab6fe12d86964f1b8746bd527a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency007.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 UIComponentSearchSearchUxconsistency007 { + @State mFocus: string = "false"; + + build() { + Row() { + Search({}).searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }).layoutWeight(1) + Button("Btn1").focusable(true) + Button("Btn2").focusable(true) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency008.ets new file mode 100644 index 0000000000000000000000000000000000000000..3452462c378e2f137297b4c0f180ad26f5f45c29 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency008.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 UIComponentSearchSearchUxconsistency008 { + build() { + Row() { + Search({}).searchButton("search").layoutWeight(1) + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency009.ets new file mode 100644 index 0000000000000000000000000000000000000000..572359ad368bcc0766e4c57a195980a6f0ba0179 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency009.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. + */ +import inputMethodEngine from '@ohos.inputMethodEngine'; + +@Entry +@Component +struct UIComponentSearchSearchUxconsistency009 { + build() { + Column() { + Row() { + Search().searchButton("search").layoutWeight(1) + } + .width('100%') + } + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e0b7392446a004308f3c3b36ddd06cda793494ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency010.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 UIComponentSearchSearchUxconsistency010 { + build() { + Column() { + Row() { + Search({}).searchButton("search") + .cancelButton({ + style: CancelButtonStyle.CONSTANT, + icon: { + color: Color.Blue, + src: $r('app.media.icon') + } + }).layoutWeight(1) + Button("Btn1").focusable(false) + Button("Btn2").focusable(false) + }.width('100%') + + Row() { + Search({}).searchButton("search").layoutWeight(1) + Button("Btn1").focusable(false) + Button("Btn2").focusable(false) + }.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/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e9eb6f66bc60fb901d7a1fdc8febb20a20db5bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0010.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0010 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..69d240fe7335cf377bec5ccc0b715d713b69590e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0020.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0020 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..9be9c1302d31be030b70bde720c2e013e47bbcf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0030.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0030 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..f533d435fb5d5ba40c31fee98107b504d2c2d93f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0040.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0040 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..05de3184c7044789eeeae3f22bc7fd6960f32c6b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0050.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0050 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d9f5ee113873ee1df91c1c9bb065e17388789cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0060.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0060 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..6e96eeaa671225289bb755a6a68c2c0dbc160a5d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0070.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0070 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..6245ea267b27785e38b5ae761991f124a1eb257b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0080.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0080 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..01c39e63a9986cd26d7c77dc18de1004bf08753b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0090.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0090 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..060cf05cd75658cb48d419e98687be74caf352bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0100.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0100 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..85d7309d2c899cec7cedbabfe63ee72aaf94948e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0110.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0110 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b1e4800378fdfe43f2d99e834d22aa1010e043f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0120.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0120 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e6631565d697ea10f3fe24c7e5470ccd84ef225 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0200.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 UIComponentSoftKeyBoardOptimize0200 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controller, text: this.inputValue, placeholder: '应用A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1476f8c93f5e05f254a637ead6acb78468d6450 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0210.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 UIComponentSoftKeyBoardOptimize0210 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controller, text: this.inputValue, placeholder: '应用A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..cb7be35a7403ccb8bf73dc02b36db5c5257202e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0220.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 UIComponentSoftKeyBoardOptimize0220 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controller, text: this.inputValue, placeholder: '应用A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..63419077fce02ad43d296017ae9db813227201fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0230.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 UIComponentSoftKeyBoardOptimize0230 { + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('应用E') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..83fe880e29bcd574faf8852fe6d0833ecfb6aa55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0240.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 UIComponentSoftKeyBoardOptimize0240 { + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('应用E') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c007b77915e76c3f8cf0b7bf1640f6696230c26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0250.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 UIComponentSoftKeyBoardOptimize0250 { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controller, text: this.inputValue, placeholder: '应用A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..5dff4d0cff15cbd7c49467cfaa23248c8a6ceaf3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0400.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0400 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + @State customPopup: boolean = false; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('popupOpen').onClick(() => { + this.customPopup = !this.customPopup; + }).id('button').bindPopup(this.customPopup, { + builder: this.buildContent, + enableArrow: false, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false; + } + } + }) + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'popup组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('popupTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'popup组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'popup组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'popup组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d00dba9567c3b4a6c28349648c7d3f86615174a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0410.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0410 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + @State customPopup: boolean = false; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('popupOpen').onClick(() => { + this.customPopup = !this.customPopup; + }).id('button').bindPopup(this.customPopup, { + builder: this.buildContent, + enableArrow: false, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false; + } + } + }) + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'popup组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('popupTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'popup组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'popup组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'popup组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4b63c2cffa7851de02bdefd28e555c817057d28 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0420.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0420 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + @State customPopup: boolean = false; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('popupOpen').onClick(() => { + this.customPopup = !this.customPopup; + }).id('button').bindPopup(this.customPopup, { + builder: this.buildContent, + enableArrow: false, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false; + } + } + }) + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'popup组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('popupTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'popup组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'popup组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'popup组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..f047911f22e0e0ee8804cbb99ea60c172cfdf8eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0430.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0430 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + @State customPopup: boolean = false; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('popupOpen').onClick(() => { + this.customPopup = !this.customPopup; + }).id('button').bindPopup(this.customPopup, { + builder: this.buildContent, + enableArrow: false, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false; + } + } + }) + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'popup组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('popupTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'popup组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'popup组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'popup组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc70195aeb36022702d3c881b83d04fd26b8c870 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0440.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0440 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + @State customPopup: boolean = false; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('popupOpen').onClick(() => { + this.customPopup = !this.customPopup; + }).id('button').bindPopup(this.customPopup, { + builder: this.buildContent, + enableArrow: false, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false; + } + } + }) + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'popup组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('popupTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'popup组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'popup组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'popup组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..058aad21b44cc3127ee519cdc180dd6482003b44 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0450.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0450 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + @State customPopup: boolean = false; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('popupOpen').onClick(() => { + this.customPopup = !this.customPopup; + }).id('button').bindPopup(this.customPopup, { + builder: this.buildContent, + enableArrow: false, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false; + } + } + }) + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'popup组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('popupTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'popup组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'popup组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'popup组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('popupTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b426245aa7043cbd6976ec6ca2b1f4ee3115ded --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0520.ets @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0520 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomContentDialog({ + primaryTitle: 'dialog', + contentBuilder: () => { + this.buildContent(); + } + }) + }) + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + Button('Button').onClick(() => { + this.dialogController.open(); + }).id('button') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'dialog组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('dialogTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'dialog组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'dialog组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'dialog组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputD') + Divider().height(10).color(Color.Transparent) + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..806174b26bc164033cbe67ce62fca421f76c6ca8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0530.ets @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0530 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomContentDialog({ + primaryTitle: 'dialog', + contentBuilder: () => { + this.buildContent(); + } + }) + }) + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + Button('Button').onClick(() => { + this.dialogController.open(); + }).id('button') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'dialog组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('dialogTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'dialog组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'dialog组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'dialog组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputD') + Divider().height(10).color(Color.Transparent) + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..eeac8231c2782c74ee9b6b0c0f1546aee26188f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0540.ets @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0540 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomContentDialog({ + primaryTitle: 'dialog', + contentBuilder: () => { + this.buildContent(); + } + }) + }) + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + Button('Button').onClick(() => { + this.dialogController.open(); + }).id('button') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'dialog组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('dialogTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'dialog组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputB') + .enableKeyboardOnFocus(true) + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'dialog组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'dialog组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputD') + Divider().height(10).color(Color.Transparent) + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0550.ets new file mode 100644 index 0000000000000000000000000000000000000000..b982aee07ae2463dba9515a034500436b4bcac35 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0550.ets @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0550 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomContentDialog({ + primaryTitle: 'dialog', + contentBuilder: () => { + this.buildContent(); + } + }) + }) + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + Button('Button').onClick(() => { + this.dialogController.open(); + }).id('button') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'dialog组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('dialogTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'dialog组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'dialog组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'dialog组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputD') + .enableKeyboardOnFocus(true) + Divider().height(10).color(Color.Transparent) + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc3d46ad686a54b41fa7686c12db1d063d24b068 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0560.ets @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0560 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomContentDialog({ + primaryTitle: 'dialog', + contentBuilder: () => { + this.buildContent(); + } + }) + }) + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + Button('dialogOpen').onClick(() => { + this.dialogController.open(); + }).id('button') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'dialog组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('dialogTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'dialog组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'dialog组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'dialog组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0570.ets new file mode 100644 index 0000000000000000000000000000000000000000..de72103ae3bdafcdc009ef82211ca46ab2699e04 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0570.ets @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog'; + +@Entry +@Component +struct UIComponentSoftKeyBoardOptimize0570 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + controllerC: TextInputController = new TextInputController(); + @State inputValueC: string = ''; + controllerD: TextInputController = new TextInputController(); + @State inputValueD: string = ''; + dialogcontrollerA: TextInputController = new TextInputController(); + @State dialoginputValueA: string = ''; + dialogcontrollerB: TextInputController = new TextInputController(); + @State dialoginputValueB: string = ''; + dialogcontrollerC: TextInputController = new TextInputController(); + @State dialoginputValueC: string = ''; + dialogcontrollerD: TextInputController = new TextInputController(); + @State dialoginputValueD: string = ''; + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomContentDialog({ + primaryTitle: 'dialog', + contentBuilder: () => { + this.buildContent(); + } + }) + }) + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueC, controller: this.controllerC, index: 2 }); + Divider().height(10).color(Color.Transparent) + this.input({ inputValue: this.inputValueD, controller: this.controllerD, index: 3 }); + Divider().height(10).color(Color.Transparent) + Button('dialogOpen').onClick(() => { + this.dialogController.open(); + }).id('button') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + input(tmp: Tmp) { + if (tmp.index === 0) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + } else if (tmp.index === 1) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + } else if (tmp.index === 2) { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputC') + } else { + TextInput({ controller: tmp.controller, text: tmp.inputValue, placeholder: '组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputD') + } + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } + + @Builder + keyboardC() { + CustomKeyboardBuilder({ inputValue: this.inputValueC, controller: this.controllerC, index: 1 }); + } + + @Builder + buildContent(): void { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerA, text: this.dialoginputValueA, placeholder: 'dialog组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('dialogTextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerB, text: this.dialoginputValueB, placeholder: 'dialog组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputB') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerC, text: this.dialoginputValueC, placeholder: 'dialog组件C' }) + .customKeyboard(this.keyboardC()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputC') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.dialogcontrollerD, text: this.dialoginputValueD, placeholder: 'dialog组件D' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('dialogTextInputD') + Divider().height(10).color(Color.Transparent) + + } + } +} + +class Tmp { + inputValue?: string; + controller?: TextInputController; + index?: number; +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton.ets new file mode 100644 index 0000000000000000000000000000000000000000..ddd242802c053bb149b9d7d9bdb9609e4d4d43a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton.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 UIComponentSoftKeyBoardOptimizeButton { + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Button('Button') + Divider().height(1280).color(Color.White) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top).backgroundColor(Color.White) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup.ets new file mode 100644 index 0000000000000000000000000000000000000000..480b90264274912f7c171793df960a1e864a41fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup.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 UIComponentSoftKeyBoardOptimizeSystemPopup { + controller: TextInputController = new TextInputController(); + @State inputValue: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controller, text: this.inputValue, placeholder: '窗口B' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputB') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f5cac499b42a50e1cb4f3fa437eac72af216a63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0150.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 { LengthMetrics } from '@ohos.arkui.node' + +@Entry +@Component +struct UIComponentSpanBaselineoffset0150 { + build() { + Column() { + Text() { + ImageSpan($r('app.media.icon')) + .width(50) + .height(50) + .backgroundColor(Color.Black) + ImageSpan($r('app.media.icon')) + .padding(50) + .width(50) + .height(50) + .backgroundColor(Color.Blue) + .baselineOffset(new LengthMetrics(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/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d031bf0a693d217c737666c48d70085f115725e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0160.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. + */ +import { LengthMetrics } from '@ohos.arkui.node' + +@Entry +@Component +struct UIComponentSpanBaselineoffset0160 { + build() { + Column() { + Text() { + Span("Hello1").baselineOffset(new LengthMetrics(10)) + Span("Hello2").baselineOffset(new LengthMetrics(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/UIComponentSpecialComponentsUIExtensionComponentPopupChange/UIComponentSpecialComponentsUIExtensionComponentPopupChange002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsUIExtensionComponentPopupChange/UIComponentSpecialComponentsUIExtensionComponentPopupChange002.ets index 08183ae37121869491c2863008090f6478aaa0d1..3429f72931967870b7d208c08f3e620ab215e820 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsUIExtensionComponentPopupChange/UIComponentSpecialComponentsUIExtensionComponentPopupChange002.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsUIExtensionComponentPopupChange/UIComponentSpecialComponentsUIExtensionComponentPopupChange002.ets @@ -14,6 +14,7 @@ */ import window from "@ohos.window"; +import Settings from "../../../test/model/Settings"; @Entry @Component @@ -24,28 +25,6 @@ struct UIComponentSpecialComponentsUIExtensionComponentPopupChange002 { @State index: number = 0; controller: TextInputController = new TextInputController(); - private changeOrientation() { - try { - window.getLastWindow(getContext(this), (err, data) => { - if (err.code) { - return; - } - let windowClass = data; - let orientation = window.Orientation.LANDSCAPE; - try { - windowClass.setPreferredOrientation(orientation, (err) => { - if (err.code) { - return; - } - }); - } catch (exception) { - } - ; - }); - } catch (exception) { - } - } - build() { Row() { Column() { @@ -62,7 +41,10 @@ struct UIComponentSpecialComponentsUIExtensionComponentPopupChange002 { .onChange(() => { this.index++; if (this.index === 3) { - this.changeOrientation(); + Settings.changeOrientation(); + setTimeout(() => { + Settings.changeOrientation(); + }, 1000) } }) .bindPopup(this.handlePopup, { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8079650689edd1827e82ff487d8df37bef8cba4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0090.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 UIComponentTextCommonClick0010 { + @State message: string = 'This is a text '; + @State textArea:string='英雄末路当磨折。莽红尘,何处觅知音?青衫湿!'; + @State textInput:string='不须浪饮丁都护,世上英雄本无主。'; + + + build() { + Column({ space: 3 }) { + Text('Message:'+this.message) + .fontSize(20) + .width('90%') + .height('10%') + + TextArea() + .onTextSelectionChange(() => { + this.message = 'TextArea焦点已经发生改变'; + }) + .id('textArea1') + .width('90%') + .height('20%') + TextInput({text:this.textInput}) + .id('textInput1') + .onTextSelectionChange(() => { + this.message = 'TextInput焦点已经发生改变'; + }) + .width('90%') + .height('20%') + Search() + .id('search1') + .width('50%') + .height('10%') + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..f346018b395bbb25434abe5b8b2202b00ad070ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0100.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 { common } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct UIComponentTextCommonClick0100 { + @State message: string = 'This is a text '; + @State textArea:string='英雄末路当磨折。莽红尘,何处觅知音?青衫湿!'; + @State textInput:string='不须浪饮丁都护,世上英雄本无主。'; + @State portrait:boolean=true; + + + build() { + Column({ space: 3 }) { + Text('Message:'+this.message) + .id('text1') + .onClick(()=>{ + Settings.changeOrientation(); + setTimeout(() => { + Settings.changeOrientation(); + }, 1000) + }) + .fontSize(20) + .width('90%') + .height('10%') + + TextArea({text:this.textArea}) + .onTextSelectionChange(() => { + this.message = 'TextArea焦点已经发生改变'; + }) + .id('textArea1') + .width('90%') + .height('20%') + TextInput({text:this.textInput}) + .id('textInput1') + .onTextSelectionChange(() => { + this.message = 'TextInput焦点已经发生改变'; + }) + .width('90%') + .height('20%') + Search() + .id('search1') + .width('50%') + .height('10%') + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement039.ets new file mode 100644 index 0000000000000000000000000000000000000000..56a4852e1868289f3a7496f3d35f52dced16c4f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement039.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 UIComponentTextCommontextMinfontSizeReplacement039 { + build() { + Column() { + Column() { + TextInput({text:'ABC priorities.'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .height(20) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + TextInput({text:'ABC priorities. Sometimes, a significant'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .height(20) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + TextInput({text:'ABC priorities. Sometimes, a significant change Change,a constant and inevitable,every change'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .height(20) + .id('textinput') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement040.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0a5589cfbd21c9e1fa9aa0563e739fa63e1390d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement040.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 UIComponentTextCommontextMinfontSizeReplacement040 { + build() { + Column() { + Column() { + TextInput({text:'ABC priorities.'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .height(5) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + TextInput({text:'ABC priorities. Sometimes, a signi'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .height(5) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + TextInput({text:'ABC priorities. Sometimes, a significant change Change,a constant and inevitable,every change'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .height(5) + .id('textinput') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement041.ets new file mode 100644 index 0000000000000000000000000000000000000000..a516ea391a2e44d368ddf3d074df81c49fb9da35 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement041.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 UIComponentTextCommontextMinfontSizeReplacement041 { + build() { + Column() { + Column() { + TextInput({text:'ABC priorities.'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + TextInput({text:'ABC priorities. Sometimes, a signi'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + TextInput({text:'ABC priorities. Sometimes, a significant change Change,a constant and inevitable,every change'}) + .minFontSize(10) + .maxFontSize(30) + .fontSize(16) + .id('textinput') + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface011.ets new file mode 100644 index 0000000000000000000000000000000000000000..31eb457a5c61125805f18871086acc1ee5ca598f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface011.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 UIComponentTextHyperlinkInterface011 { + build() { + Column() { + Hyperlink('111111', '文字超链接') + .id('UIComponentTextHyperlinkInterface011_001') + .color(Color.Pink) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface012.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1db365b26c6ed18a94b83fb485b61b8b677605a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface012.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 UIComponentTextHyperlinkInterface012 { + build() { + Column() { + // Hyperlink($r('app.string.Hyperlink_address'),'文字超链接') + // .id('UIComponentTextHyperlinkInterface012_001') + // .color(Color.Pink) + Hyperlink('https://www.baidu.com', '文字超链接') + .id('UIComponentTextHyperlinkInterface012_001') + .color(Color.Pink) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface014.ets new file mode 100644 index 0000000000000000000000000000000000000000..207bc87c958c1d093a37b19dcf1cd9f8eacdc158 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface014.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 UIComponentTextHyperlinkInterface014 { + build() { + Column() { + Hyperlink('https://www.example.com', 'enable false') + .id('UIComponentTextHyperlinkInterface014_001') + .color(Color.Pink) + .enabled(false) + Hyperlink('https://www.example.com', '透明底40%') + .id('UIComponentTextHyperlinkInterface014_001') + .color(Color.Pink) + .opacity(0.4) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkLayout/UIComponentTextHyperlinkLayout001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkLayout/UIComponentTextHyperlinkLayout001.ets new file mode 100644 index 0000000000000000000000000000000000000000..042d10ce7bd15eb8fdeb727af73543a8c408fb25 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextHyperlinkLayout/UIComponentTextHyperlinkLayout001.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 UIComponentTextHyperlinkLayout001 { + build() { + Column() { + Text() { + Span("OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,") + Span("目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展") + } + + Hyperlink('https://openharmony.gitee.com', '开源代码仓库地址') + .id('UIComponentTextHyperlinkLayout001_001') + Text() { + Span("OpenHarmony当前为开发者提供了以下4种获取源码的方式") + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface008.ets new file mode 100644 index 0000000000000000000000000000000000000000..afdbfddaae0bde6c8a2176b0df55354958181f7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextInterface/UIComponentTextInterface008.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 Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@ohos.base'; + +@Entry +@Component +struct UIComponentTextInterface008 { + @State message: string = 'This is a text, 测试文本?;:' + @State message_ug: string = ' بۇ سىناق نۇسخىسى :؟' + @State directionValue: number = Direction.Auto + @State clickFlags: number = 0 + private portrait: boolean = true + + build() { + Row() { + Column() { + Text(this.message_ug) + .direction(this.directionValue) + .fontSize(20) + .textShadow({ + radius: 10, + color: Color.Black, + offsetX: 10, + offsetY: 10 + }) + .border({ width: 1 }) + .margin({ top: 10 }) + .padding(10) + .width('100%') + .onClick(() => { + this.message_ug = this.message + }) + .key('UIComponentTextInterface008_001') + Button('Switch Direction') + .margin({ top: 10 }) + .onClick(() => { + this.clickFlags = this.clickFlags + 1 + if (this.clickFlags == 1) { + this.directionValue = Direction.Ltr + } else if (this.clickFlags == 2) { + this.directionValue = Direction.Rtl + } else if (this.clickFlags == 3) { + this.clickFlags = 0 + this.directionValue = Direction.Auto + } + }).key('UIComponentTextInterface008_button_001') + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface_menu.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface_menu.ets new file mode 100644 index 0000000000000000000000000000000000000000..cba0cd6044c331b335b79bf9fbf841f2416d87d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSelectionInterface/UIComponentTextSelectionInterface_menu.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import font from '@ohos.font'; + +@Entry +@Component +struct UIComponentTextSelectionInterface_menu { + private iconStr: ResourceStr = $r("app.media.icon") + + aboutToAppear() { + font.registerFont({ + familyName: 'ownfonttwo', + familySrc: $rawfile('font/own1.ttf') + }); + } + + @Builder + SubMenu() { + Menu() { + MenuItem({ content: "复制", labelInfo: "Ctrl+C" }) + MenuItem({ content: "粘贴", labelInfo: "Ctrl+V" }) + MenuItem({ content: "全选", labelInfo: "Ctrl+A" }) + } + } + + @Builder + MyMenu() { + Menu() { + MenuItem({ startIcon: $r("app.media.icon"), content: "菜单选项" }) + MenuItem({ startIcon: $r("app.media.icon"), content: "菜单选项" }) + MenuItem({ startIcon: $r("app.media.icon"), content: "菜单选项" }) + .enabled(false) + MenuItem({ + startIcon: this.iconStr, + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + MenuItemGroup({ header: '小标题' }) { + MenuItem({ + startIcon: this.iconStr, + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "菜单选项", + builder: (): void => this.SubMenu() + }) + } + + MenuItem({ + startIcon: this.iconStr, + content: "菜单选项", + }) + } + .font({ family: 'ownfonttwo' }) + } + + build() { + Row() { + Column() { + TextInput({ placeholder: 'click to show menu' }) + .fontSize(50) + .fontWeight(FontWeight.Bold).bindMenu(this.MyMenu) + } + //.bindMenu(this.MyMenu) + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..5416b6d0a49afa1bae6cda6f4a57fdec62442bd2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0030.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 UIComponentTextSupportfont0030 { + build() { + Column() { + Column() { + Text('text') + .fontSize('16vp') + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..6a213931b5b661df076c6dcca6afbb478219500b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0040.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 UIComponentTextSupportfont0040 { + build() { + Column() { + Column() { + Text('text') + .fontSize('16fp') + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..1468bed3db1d33f291a7e00df3be126846c879fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0050.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 UIComponentTextSupportfont0050 { + build() { + Column() { + Column() { + Text('text') + .fontSize('16lpx') + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..34bd627a747b98ada1c2914f4fc38859a2cdbf86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0060.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 UIComponentTextSupportfont0060 { + build() { + Column() { + Column() { + Text('text') + .fontSize(-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/UIComponentTextSupportfont/UIComponentTextSupportfont0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..d3be55bda96ac8bd669a5ac664ea547eaf78ac34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0070.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 UIComponentTextSupportfont0070 { + build() { + Column() { + Column() { + Text('text') + .fontSize(0) + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd9d3421566d5c554526864cdc89cb019deafbe6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0080.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 UIComponentTextSupportfont0080 { + build() { + Column() { + Column() { + Text('text') + .fontSize(16) + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..4eb3b236a7b329f7e47031e923fc942fb7e94776 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0090.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 UIComponentTextSupportfont0090 { + build() { + Column() { + Column() { + Text('text') + .fontSize(getContext().resourceManager.getStringSync($r('app.string.size_16px'))) + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9e3d5784d3a99eee65ca394dd200e753b0b4955 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0100.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 UIComponentTextSupportfont0100 { + build() { + Column() { + Column() { + Text('text') + .fontSize('16px') + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..2097fcc6724bc6863919c15beb0ad50bb1fed246 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0040.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SelectionMenu, EditorMenuOptions, ExpandedMenuOptions, EditorEventInfo, SelectionMenuOptions } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import Utils from '../../../test/model/Utils'; + +@Entry +@Component +struct UIComponentTextTextAbility0040 { + @State text: string = 'Text:Test for focusable' + @State res: string = 'After Select: ' + @State start: number = 5 + @State end: number = 8 + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .width('80%') + .height('50') + .margin(20) + .focusable(true) + .selection(3, 8) + .textSelectable(TextSelectableMode.SELECTABLE_FOCUSABLE) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('text_textAbility0040') //.selection(this.start,this.end) + + + /*Button('Set text selection').margin(20).id('btn_textAbility0150').onClick(()=>{ + this.start = 3 + this.end = this.text.length + })*/ + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..edcdfd3026bcd2d34f48275a46eb1ff1a4e07d5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0050.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 { drawing } from '@kit.ArkGraphics2D' +import { text } from "@kit.ArkGraphics2D" +import { image } from '@kit.ImageKit'; + +function textFunc() { + let myParagraphStyle: text.ParagraphStyle = { + align: text.TextAlign.END, + }; + let fontCollection = new text.FontCollection(); + let ParagraphGraphBuilder = new text.ParagraphBuilder(myParagraphStyle, fontCollection); + let paragraph = ParagraphGraphBuilder.build(); + + const color: ArrayBuffer = new ArrayBuffer(160000); + let opts: image.InitializationOptions = { editable: true, pixelFormat: 3, size: { height: 200, width: 200 } } + let pixelMap: image.PixelMap = image.createPixelMapSync(color, opts); + let canvas = new drawing.Canvas(pixelMap); + + paragraph.paint(canvas, 0, 0); +} + +@Entry +@Component +struct UIComponentTextTextAbility0050 { + @State text: string = 'Text:Test for Paragraph Paint' + @State res: string = 'After Copy:' + controller: TextInputController = new TextInputController() + + build() { + Column() { + Column() { + Text(this.text) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textAbility0050_text') + .selection(5, 20) + .onCopy((value: string) => { + console.log(`onCopy:${value}`); + this.res = 'after onCopy: ' + value; + }) + Column() { + Button('click').id('textAbility0050_btn').onClick(() => { + textFunc() + }) + } + .width('100%') + + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e30983352170e0008cf63009b87817741b16028 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0060.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import inspector from '@ohos.arkui.inspector' + +@Entry +@Component +struct UIComponentTextTextAbility0060 { + @State text: string = 'Text:Test for inspector' + @State res: string = 'After Copy:' + @State start: number = 0 + @State end: number = 0 + @State vis: number = Visibility.Hidden + controller: TextInputController = new TextInputController() + listener: inspector.ComponentObserver = inspector.createComponentObserver('textAbility0060_text') + + aboutToAppear() { + let onLayoutComplete: () => void = (): void => { + console.log(`onLayoutComplete>>>`); + // do something here + this.vis = Visibility.Visible + } + let onDrawComplete: () => void = (): void => { + console.log(`onDrawComplete>>>`); + this.start = 5 + this.end = 20 + // do something here + } + let offLayoutComplete: () => void = (): void => { + // do something here + } + let offDrawComplete: () => void = (): void => { + // do something here + } + let FuncLayout = onLayoutComplete // bind current js instance + let FuncDraw = onDrawComplete // bind current js instance + let OffFuncLayout = offLayoutComplete // bind current js instance + let OffFuncDraw = offDrawComplete // bind current js instance + + this.listener.on('layout', FuncLayout) + this.listener.on('draw', FuncDraw) + + // 通过句柄向对应的查询条件取消注册回调,由开发者自行决定在何时调用。 + // this.listener.off('layout', OffFuncLayout) + // this.listener.off('draw', OffFuncDraw) + } + + build() { + Column() { + Column() { + Text(this.text) + .width('80%') + .height('50') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .key('textAbility0060_text') + .selection(this.start, this.end) + .visibility(this.vis) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..91b2fb7986f50cbe4de3ecf4b8a7ae05624ccf9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0080.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import inspector from '@ohos.arkui.inspector' +import common from '@ohos.app.ability.common' + +const context = getContext(this) +const uiAbilityContext = context as common.UIAbilityContext + +@Entry +@Component +struct UIComponentTextTextAbility0080 { + build() { + Column() { + Button("跳转到设置") + .id('textAbility0080_btn') + .onClick(() => { + let context = getContext(this) as common.UIAbilityContext; + uiAbilityContext.startAbility({ + bundleName: 'com.ohos.settings', + abilityName: 'com.ohos.settings.MainAbility', + //uri: 'application_settings', //application_settings application_info_entry + /*parameters: { + pushParams: uiAbilityContext.abilityInfo.bundleName + // 应用包名com.ohos.settings + }*/ + }); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..68230384205c078b3eddd7ae26488c6ac69b12cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0100.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 UIComponentTextTextAbility0100 { + @State text: string = 'Text:Test for MARQUEE' + @State overflow: number = TextOverflow.None + @State color: number = Color.Yellow + + build() { + Column() { + Text(this.text) + .width('80%') + .height('100') + .margin(20) + .fontSize(16) + .copyOption(CopyOptions.InApp) + .id('textAbility0100_text') + .textOverflow({ overflow: this.overflow }) + .width(200) + .borderWidth(1) + .borderColor(Color.Orange) + .backgroundColor(this.color) + .onClick(() => { + console.log(`onClick>>`); + }) + + Button('start MARQUEE').id('textAbility0100_btn').onClick(() => { + console.log(`onClick>>`); + this.text += this.text + this.overflow = TextOverflow.MARQUEE + this.color = Color.Green + + /*for (let index = 0; index <= 30; index++) { + let res = index%5 + switch (res){ + case 1: + case 3: + case 5: + this.color = Color.Blue + break; + case 2: + case 4: + this.color = Color.Green + break; + } + }*/ + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f9200dcc1b190d8a175cc23f124d56f4dd26fc7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0110.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 UIComponentTextTextAbility0110 { + @State text: string = 'Text:textShadow' + @State overflow: number = TextOverflow.None + @State color: number = Color.Yellow + + build() { + Column() { + Text(this.text) { + Span(this.text).fontColor(Color.Gray) + } + .width('100%') + .height('100') + .margin(20) + .textShadow({ + radius: 5, + color: Color.Black, + offsetX: 0, + offsetY: 0 + }) + .fontSize(26) + .copyOption(CopyOptions.InApp) + .id('textAbility0110_text') + .textOverflow({ overflow: this.overflow }) + .borderWidth(1) + .borderColor(Color.Orange) + .onClick(() => { + console.log(`onClick>>`); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..44ebe6aa02a3b941adc2e73812c8a93c69bd4f40 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0180.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 { photoAccessHelper } from '@kit.MediaLibraryKit'; +import { fileIo } from '@kit.CoreFileKit'; + +@Entry +@Component +struct UIComponentTextTextAbility0180 { + @State text: string = '' + + build() { + Column() { + Text(this.text) + .width('100%') + .height('100') + .margin(20) + .fontSize(26) + .copyOption(CopyOptions.InApp) + .id('textAbility0180_text') + + // 默认参数下,图标、文字、背景都存在 + + SaveButton({ icon: SaveIconStyle.PICTURE, text: SaveDescription.SAVE_IMAGE }) + .key('TextAbility0180_btn1') + .onClick((async (event: ClickEvent, result: SaveButtonOnClickResult) => { + if (result == SaveButtonOnClickResult.SUCCESS) { + console.log(`SAVE_IMAGE onClick>>`); + this.text = '保存图片成功' + } + })) + + SaveButton({ icon: SaveIconStyle.LINES, text: SaveDescription.SAVE_FILE }) + .key('TextAbility0180_btn2') + .onClick((async (event: ClickEvent, result: SaveButtonOnClickResult) => { + if (result == SaveButtonOnClickResult.SUCCESS) { + console.log(`SAVE_FILE onClick>>`); + this.text = '保存文件成功' + } + })) + + SaveButton({ icon: SaveIconStyle.FULL_FILLED, text: SaveDescription.DOWNLOAD }) + .key('TextAbility0180_btn3') + .onClick((async (event: ClickEvent, result: SaveButtonOnClickResult) => { + if (result == SaveButtonOnClickResult.SUCCESS) { + console.log(`DOWNLOAD onClick>>`); + this.text = '保存视频成功' + } + })) + /*SaveButton({icon:SaveIconStyle.FULL_FILLED,text:SaveDescription.DOWNLOAD}) + .onClick(async (event:ClickEvent, result:SaveButtonOnClickResult) => { + if (result == SaveButtonOnClickResult.SUCCESS) { + console.log(`DOWNLOAD onClick>>`); + this.text = '保存视频成功' + */ + /*try { + const context = getContext(this); + let helper = photoAccessHelper.getPhotoAccessHelper(context); + // onClick触发后10秒内通过createAsset接口创建图片文件,10秒后createAsset权限收回。 + let uri = await helper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'png'); + // 使用uri打开文件,可以持续写入内容,写入过程不受时间限制 + let file = await fileIo.open(uri, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); + // 写入文件 + await fileIo.write(file.fd, "context"); + // 关闭文件 + await fileIo.close(file.fd); + } catch (error) { + console.error("error is "+ JSON.stringify(error)); + }*/ + /* + } + })*/ + } + } +} \ 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/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt010.ets new file mode 100644 index 0000000000000000000000000000000000000000..845c37fc3b4c3fa6a23e25ef1075c3bf99dffd33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt010.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 image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt010 { + @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() { + Span('测试无网加载网络图时,占位图显示情况') + ImageSpan('https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641') + .alt(this.imageAlt) + .width(50) + .height(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/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt011.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c716911dad3b28b170bf1d63f0e45abb98592f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt011.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 image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt011 { + @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.large')) + } + + build() { + Column() { + Text() { + Span('测试超大资源图片,占位图显示情况') + ImageSpan('') + .alt(this.imageAlt) + .width(150) + .height(150) + } + }.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/UIComponentTextTextImageSpanAlt012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt012.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0472f108972cd5555db03639648df52f8556072 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt012.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 image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt012 { + @State imageAlt: PixelMap | undefined = undefined + @State overflow: TextOverflow = 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 + }) + await imageSource.release() + return createPixelMap + } + + async aboutToAppear() { + this.imageAlt = await this.getPixmapFromMedia($r('app.media.large')) + } + + build() { + Column() { + Button(`切换overflow ${ + this.overflow === 0 ? 'None' : + this.overflow === 1 ? 'Clip' : + this.overflow === 2 ? 'Ellipsis' : 'MARQUEE'}`) + .id('UIComponentTextTextImageSpanAlt012_001') + .onClick(() => { + if (this.overflow === 3) { + this.overflow = 0 + } else { + this.overflow++ + } + }) + + Text() { + Span('测试超大资源图片,占位图显示情况') + ImageSpan('') + .alt(this.imageAlt) + .width(150) + .height(150) + Span('测试超大资源图片,占位图显示情况') + } + .fontSize(35) + .maxLines(2) + .textOverflow({ + overflow: this.overflow + }) + }.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/UIComponentTextTextImageSpanAlt013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt013.ets new file mode 100644 index 0000000000000000000000000000000000000000..6752d8d365e605604f3c0d7b683e5e4bcbaf7399 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt013.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 image from '@ohos.multimedia.image' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt013 { + @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() { + Span('测试设置隐私遮罩后,占位图显示情况') + ImageSpan('https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641') + .alt(this.imageAlt) + .obscured([ObscuredReasons.PLACEHOLDER]) + .width(50) + .height(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/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt015.ets new file mode 100644 index 0000000000000000000000000000000000000000..68d76bf9636ca1caaa2f7e90aaceba13ea4e1dd4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt015.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 image from '@ohos.multimedia.image' +import { LengthUnit } from '@ohos.arkui.node' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt015 { + @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.black_opacity_bg')) + } + + build() { + Column({ space: 20 }) { + + Text() { + Span('测试设置baselineOffset、textBackgroundStyle,占位图显示情况') + ImageSpan('') + .alt(this.imageAlt) + .baselineOffset({ value: -200, unit: LengthUnit.VP }) + .textBackgroundStyle({ color: Color.Red, radius: 15 }) + .width(50) + .height(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/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt016.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d137bc561d098f004e74dae9f71b4f86662eb26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt016.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import image from '@ohos.multimedia.image' +import { LengthUnit } from '@ohos.arkui.node' + +@Entry +@Component +struct UIComponentTextTextImageSpanAlt016 { + @State imageAlt: PixelMap | undefined = undefined + @State imageIndex: number = 0 + @State buttonText: string = 'png' + + 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({ space: 20 }) { + + Button(this.buttonText) + .id('UIComponentTextTextImageSpanAlt016_001') + .onClick(async () => { + if (this.imageIndex === 4) { + this.imageIndex = 0 + } else { + this.imageIndex++ + } + switch (this.imageIndex) { + case 0: + this.imageAlt = await this.getPixmapFromMedia($r('app.media.icon')) + this.buttonText = 'png' + break; + case 1: + this.imageAlt = await this.getPixmapFromMedia($r('app.media.cat')) + this.buttonText = 'jpg' + break; + case 2: + this.imageAlt = await this.getPixmapFromMedia($r('app.media.fan')) + this.buttonText = 'bmp' + break; + case 3: + this.imageAlt = await this.getPixmapFromMedia($r('app.media.fly')) + this.buttonText = 'svg' + break; + case 4: + this.imageAlt = await this.getPixmapFromMedia($r('app.media.bird_people')) + this.buttonText = 'gif' + break; + default: + break; + } + }) + + Text() { + Span('动态切换图片格式,占位图显示情况') + ImageSpan('') + .alt(this.imageAlt) + .width(50) + .height(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/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720.ets new file mode 100644 index 0000000000000000000000000000000000000000..91da65baa0636885d7c2af2e34f5c560e1230876 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720.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 Settings from '../../../test/model/Settings' + +import Window from '@ohos.window' +import common from '@ohos.app.ability.common'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct UIComponentTextTextInputCursor1720 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State txt: string = 'TextArea/TextInput/Search,' + this.msg + @State taTxt: string = 'TextArea:' + this.msg + @State tiTxt: string = 'TextInput:' + this.msg + @State changeValue: string = 'search:' + this.msg + @State taSelectRes: string = '' + @State taScrollRes: string = '' + @State tiSelectRes: string = '' + @State tiScrollRes: string = '' + @State seSelectRes: string = '' + @State seScrollRes: string = '' + @State submitValue: string = '' + searchController: SearchController = new SearchController(); + textAreaController: TextAreaController = new TextAreaController() + textInputController: TextInputController = new TextInputController() + + build() { + Column() { + TextArea({ + text: this.taTxt, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.textAreaController + }) + .id('textInputCursor1720_txArea') + .width('100%') + .margin(20) + .height(50) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.taScrollRes = `TextArea{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log(`onTextSelectionChange>>>`); + if (selectionStart == selectionEnd) { + this.taSelectRes = `TextArea{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.taTxt.length; + if (selectionEnd < length) { + this.textAreaController.setTextSelection(selectionStart, length); + } + this.taSelectRes = `TextArea{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Text(this.taScrollRes + '\n' + this.taSelectRes) + .fontColor(Color.Green) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + Search({ + value: this.changeValue, + placeholder: 'Type to search...', + controller: this.searchController + }) + .id('textInputCursor1720_search') + .searchButton('SEARCH') + .width('100%') + .height(50) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .margin(20) + .onContentScroll((totalOffsetX: number, totalOffsetY: number) => { + console.log(`onContentScroll>>>`); + this.seScrollRes = `Search{scrolling:[${totalOffsetX},${totalOffsetY}]}`; + }) + .onTextSelectionChange((selectionStart: number, selectionEnd: number) => { + console.log('onTextSelectionChange>>'); + // this.searchController.stopEditing(); + if (selectionStart == selectionEnd) { + this.seSelectRes = `Search{point:[${selectionStart},${selectionEnd}]}`; + } else { + let length = this.changeValue.length; + if (selectionEnd < length) { + this.searchController.setTextSelection(selectionStart, length); + } + this.seSelectRes = `Search{select:[${selectionStart},${selectionEnd}]}`; + } + }) + Text(this.seScrollRes + '\n' + this.seSelectRes) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + + + Button('TODO requestFocus') + .id('textInputCursor1720_btn') + .fontColor(Color.Brown) + .onClick(() => { + console.log('onClick, requestFocus'); + focusControl.requestFocus('textInputCursor1720_search'); + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ba97145bcb663fa1034702b8587915695e6161c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100.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 UIComponentTextTextInputKeepEditableState0100 { + @State msg: string = + "OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连" + + "接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统的框架和平台" + @State text: string = 'TextInput:test keepEditableState' + @State enterKey: string = '' + @State enterKeyType: number = 0 + enterKeyTypeStr: string[] = ['Go', 'Search', 'Send', 'Next', 'Done', 'PREVIOUS', 'NEW_LINE'] + enterKeyTypeNum: number[] = + [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Next, EnterKeyType.Done, + EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE] + + build() { + Column() { + TextInput({ placeholder: 'input...', text: this.text }) + .id('textInputKeepEditableState0100') + .width('95%') + .borderWidth(3) + .onSubmit((enterKey: EnterKeyType, event: SubmitEvent) => { + console.log(`onSubmit>> enterKey=${enterKey}`); + this.enterKeyType = enterKey.valueOf(); + for (let index = 0; index < this.enterKeyTypeNum.length; index++) { + if (enterKey == this.enterKeyTypeNum[index]) { + this.enterKey = this.enterKeyTypeStr[index]; + } + } + // 调用keepEditableState方法,输入框保持编辑态 + event.keepEditableState() + }) + + Text('current EnterKeyType is:' + this.enterKey) + .fontColor(Color.Brown) + .fontSize(20) + .margin({ top: 20, bottom: 10 }) + .width('95%') + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..81a5560ca71c6e222c37b8afc19ca02ecbef1c1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0340.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. + */ + +import { MenuModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTextTextSupportFont0340 { + @State menuModifier: MenuModifier = new MenuModifier() + + build() { + Column() { + Text('hello word !!ello word !!ello word !!') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..73220587d83c20dee497c9e9deb6582380a85cda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0350.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. + */ + +import { MenuModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTextTextSupportFont0350 { + @State menuModifier: MenuModifier = new MenuModifier() + + build() { + Column() { + Text('hello word !!ello word !!ello word !!') + .fontStyle(FontStyle.Normal) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..a445d30efc4abfb11d2d380ea25ddd9d7875f1f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0360.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. + */ + +import { MenuModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTextTextSupportFont0360 { + @State menuModifier: MenuModifier = new MenuModifier() + + build() { + Column() { + Text('hello word !!ello word !!ello word !!') + .fontStyle(FontStyle.Italic) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc79d8a51a764cbe542e0ca315d40732e3299dad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0110.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 UIComponentTextTextSupportfont0110 { + build() { + Column() { + Text() { + Span("OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,") + Span("目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展") + } + + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..fbc553bd605104a3aaf6f3b81543c3e0ecc3ccbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0120.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 UIComponentTextTextSupportfont0120 { + build() { + Column() { + Text() { + Span("OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,") + Span("目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展") + } + .fontWeight(FontWeight.Lighter) + + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..691c027b1231f3025bfa82fba5e96ecf1079daf0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0130.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 UIComponentTextTextSupportfont0130 { + build() { + Column() { + Text() { + Span("OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,") + Span("目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展") + } + .fontWeight(FontWeight.Normal) + + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..de9fe35f1e52369c768477c567e59a219e082433 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0140.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 UIComponentTextTextSupportfont0140 { + build() { + Column() { + Text() { + Span("OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,") + Span("目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展") + } + .fontWeight(FontWeight.Regular) + + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..93980f4fff3d2f54d31af6ca0278cf102b6b48c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0150.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 UIComponentTextTextSupportfont0150 { + build() { + Column() { + Text() { + Span("OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,") + Span("目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展") + } + .fontWeight(FontWeight.Medium) + + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..532c47d8e6543080d319f59fed277fb054a36621 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTextSupportfont/UIComponentTextTextSupportfont0160.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 UIComponentTextTextSupportfont0160 { + build() { + Column() { + Text() { + Span("OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,") + Span("目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展") + } + .fontWeight(FontWeight.Bold) + + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..b88db47fd72b1352024e9f5344e0ef12ab6b9567 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0070.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 UIComponentTextTransparency0070 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: { + size: [100, 100], + verticalAlign: ImageSpanAlignment.TOP, + } + }) + }) + .draggable(true) + Button('set selection') + .id('button1') + .onClick(() => { + this.controller.setSelection(-1,-1); + }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f931b87f1f72f9d46a7a355636d943fbfd87fe8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0080.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 UIComponentTextTransparency0080 { + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("0123456", { + style: { + fontColor: Color.Orange, + fontSize: 50 + } + }) + }) + .draggable(true) + Button('set selection') + .id('button1') + .onClick(() => { + this.controller.setSelection(-1,-1); + }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..99b0ed6336da66f0fbbca10bab9bc4d11eb1af59 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0090.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 UIComponentTextTransparency0090 { + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan('cat.jpg', + { + imageStyle: { + size: [100, 100], + verticalAlign: ImageSpanAlignment.TOP, + } + }) + this.controller.addTextSpan("0123456", { + style: { + fontColor: Color.Orange, + fontSize: 50 + } + }) + }) + .draggable(true) + Button('set selection') + .id('button1') + .onClick(() => { + this.controller.setSelection(-1,-1); + }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a625db58bc23f331fdc63c8f84ee156e668e02c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0100.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 UIComponentTextTransparency0100 { + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("0123456", { + style: { + fontColor: Color.Orange, + fontSize: 50, + decoration: { + type: TextDecorationType.Underline, + style: TextDecorationStyle.WAVY + } + } + }) + }) + .draggable(true) + Button('set selection') + .id('button1') + .onClick(() => { + this.controller.setSelection(-1,-1); + }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1340.ets new file mode 100644 index 0000000000000000000000000000000000000000..6521d236e37f5e5adada675674040a624dfcc4fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1340.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. + */ + +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1340 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + } + + build() { + Row() { + Search({ value: "light" }).layoutWeight(1) + Button("浅色模式").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1350.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c463920a36c45a506f30e51e9e560f026c0e0e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1350.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. + */ + +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1350 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + } + + build() { + Row() { + Search({ value: "light" }).layoutWeight(1) + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1360.ets new file mode 100644 index 0000000000000000000000000000000000000000..061d6ce16bd243a419adb3ac650534e6bfcafd56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1360.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. + */ + +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1360 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + Search({ value: "light" }).layoutWeight(1) + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1370.ets new file mode 100644 index 0000000000000000000000000000000000000000..9276ad3ed2e930dc63b8437c9bcc1251b2846617 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1370.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. + */ + +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1360 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + Search({ value: "light" }).layoutWeight(1) + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1380.ets new file mode 100644 index 0000000000000000000000000000000000000000..9503a72ce4f9d18370e2754cf8ed90d13e7e1e55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1380.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. + */ + +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1380 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.LIGHT }) { + Search({ value: "light" }).layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1390.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f5db0953c6a17ea9589bea8d049efd8b9ea43a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1390.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. + */ + +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1390 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.DARK }) { + Search({ value: "light" }).layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1400.ets new file mode 100644 index 0000000000000000000000000000000000000000..b68032b2483f171f76e32c6594838d292731fa00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1400.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. + */ + +import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1390 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Search({ value: "light" }).layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1550.ets new file mode 100644 index 0000000000000000000000000000000000000000..627364c3670a7f1e93de9a83e9aac93d733f4cd7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1550.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 ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1550 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Text() { + Span("light").layoutWeight(1) + }.layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1560.ets new file mode 100644 index 0000000000000000000000000000000000000000..f48b0e2457bd81881eb75833d5896e895d3a6b8f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1560.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 ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1560 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Text() { + Span("light").layoutWeight(1) + }.layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1570.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5c50160921a5ad77a9c9d137dbf83494fd0619a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1570.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 ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1570 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Text() { + Span("light").layoutWeight(1) + }.layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1580.ets new file mode 100644 index 0000000000000000000000000000000000000000..be8f3161fb6c249b05fc85a8d509b3f1887ef8af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1580.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 ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1580 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Text() { + Span("light").layoutWeight(1) + }.layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1590.ets new file mode 100644 index 0000000000000000000000000000000000000000..e41c50b7da03bf9ec8a44c32d04c3d3ade501db0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1590.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 ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1590 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.LIGHT }) { + Text() { + Span("light").layoutWeight(1) + }.layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1600.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e509307c7709f7abb8d593f921d8a9a05416d4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1600.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 ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1600 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.DARK }) { + Text() { + Span("light").layoutWeight(1) + }.layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1610.ets new file mode 100644 index 0000000000000000000000000000000000000000..d1d1062bda252d1f32ff245284770ffeb6d34336 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1610.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 ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; + +@Entry +@Component +struct UIComponentUISupportColor1610 { + aboutToAppear(): void { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); + } + + build() { + Row() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Text() { + Span("light").layoutWeight(1) + }.layoutWeight(1) + } + + Button("ChangeTheme").id("change_theme_button").onClick(() => { + getContext(this).getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_DARK); + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..ccf0353a1b9ea513c035afb03e95ae158f3a5c31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0010.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. + */ +// xxx.ets +import { font } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentUiFontConfigFontList0010 { + @State isHasFont: boolean = false + aboutToAppear(): void { + } + build() { + Column() { + Text("设置此Text的字体为'Noto Sans Pau Cin Hau'").fontFamily('Noto Sans Pau Cin Hau').fontSize(20); + Text(`Noto Sans Pau Cin Hau 是否存在获取到的系统字体中: ${this.isHasFont}`).fontFamily('Arial').fontSize(20).margin({ top: 50 }); + Button("获取系统字体") + .width('60%') + .height('6%') + .margin(50) + .id("UIComponentUiFontConfigFontList0010_button") + .onClick(()=>{ + let fontConfig = font.getUIFontConfig(); + console.log("font-dir -----------" + String(fontConfig.fontDir.length)); + for (let i = 0; i < fontConfig.fontDir.length; i ++) { + console.log(fontConfig.fontDir[i]); + } + console.log("generic-------------" + String(fontConfig.generic.length)); + for (let i = 0; i < fontConfig.generic.length; i ++){ + console.log("cq-----------family:" + fontConfig.generic[i].family); + for (let j = 0; j < fontConfig.generic[i].alias.length; j ++){ + console.log(fontConfig.generic[i].alias[j].name + " " + fontConfig.generic[i].alias[j].weight); + } + for (let j = 0; j < fontConfig.generic[i].adjust.length; j ++){ + console.log(fontConfig.generic[i].adjust[j].weight + " " + fontConfig.generic[i].adjust[j].to); + } + } + console.log("fallback------------" + String(fontConfig.fallbackGroups.length)); + for (let i = 0; i < fontConfig.fallbackGroups.length; i ++){ + console.log("cq------fontSetName-----------:" + fontConfig.fallbackGroups[i].fontSetName); + for (let j = 0; j < fontConfig.fallbackGroups[i].fallback.length; j ++){ + if(fontConfig.fallbackGroups[i].fallback[j].family == "Noto Sans Pau Cin Hau"){ + this.isHasFont = true; + } + } + } + }) + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..143c9c39d7dba7b687e37d8d7b4672a6687e4fb3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0020.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 { font } from '@kit.ArkUI'; +@Entry +@Component +struct UIComponentUiFontConfigFontList0020 { + @State isHasFont: boolean = false + @State fontList: Array = [] + aboutToAppear(): void { + + } + build() { + Column() { + Text("当前系统字体"+JSON.stringify(this.fontList)).fontFamily('Noto Sans Pau Cin Hau').fontSize(10); + Button("获取系统字体") + .width('60%') + .height('6%') + .id('UIComponentUiFontConfigFontList0020_button') + .margin(50) + .onClick(()=>{ + let fontConfig = font.getUIFontConfig(); + console.log("font-dir -----------" + String(fontConfig.fontDir.length)); + for (let i = 0; i < fontConfig.fontDir.length; i ++) { + console.log(fontConfig.fontDir[i]); + } + console.log("generic-------------" + String(fontConfig.generic.length)); + for (let i = 0; i < fontConfig.generic.length; i ++){ + console.log("cq-----------family:" + fontConfig.generic[i].family); + for (let j = 0; j < fontConfig.generic[i].alias.length; j ++){ + console.log(fontConfig.generic[i].alias[j].name + " " + fontConfig.generic[i].alias[j].weight); + } + for (let j = 0; j < fontConfig.generic[i].adjust.length; j ++){ + console.log(fontConfig.generic[i].adjust[j].weight + " " + fontConfig.generic[i].adjust[j].to); + } + } + console.log("fallback------------" + String(fontConfig.fallbackGroups.length)); + for (let i = 0; i < fontConfig.fallbackGroups.length; i ++){ + console.log("cq------fontSetName-----------:" + fontConfig.fallbackGroups[i].fontSetName); + for (let j = 0; j < fontConfig.fallbackGroups[i].fallback.length; j ++){ + this.fontList.push(fontConfig.fallbackGroups[i].fallback[j].family); + } + } + }) + + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentButtonDatepickerInterface0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentButtonDatepickerInterface0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..1349f93bedb4173bf0a2bd26c162d25eeb87d0fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentButtonDatepickerInterface0230.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 UIComponentButtonDatepickerInterface0230 { + private selectedDate: Date = new Date('2023-04-30') + + build() { + Column() { + DatePicker({ + start: new Date('1980-4-30'), + end: new Date('2370-4-30'), + selected: this.selectedDate + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentButtonDatepickerInterface0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentButtonDatepickerInterface0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad89603635ebe848a925a83110d5c105f0f97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentButtonDatepickerInterface0290.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 UIComponentButtonDatepickerInterface0290 { + @State isLunar: boolean = false + private selectedDate: Date = new Date('2023-04-30') + + build() { + Column() { + DatePicker({ + start: new Date('1980-4-30'), + end: new Date('2370-4-30'), + selected: this.selectedDate + }).lunar(true) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentPopupbxPickrold0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentPopupbxPickrold0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..a1615816ac8ce9a4c6d0c649e3fdd70ef28857a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIDataPicker/UIComponentPopupbxPickrold0560.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 UIComponentPopupbxPickrold0560 { + build() { + Row() { + Column() { + DatePicker({ + start: new Date('1970-1-1'), + end: new Date('2100-1-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/UISearchInterface/UISearchInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface006.ets new file mode 100644 index 0000000000000000000000000000000000000000..535f4f5a6f9a10428a10eb6139a6b5ad26d24dac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UISearchInterface/UISearchInterface006.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 UISearchInterface006 { + @State text: string = '这是提示文本' + + build() { + Row() { + Column() { + Search({ placeholder: this.text }) + .width(336) + .height(56) + .copyOption(CopyOptions.LocalDevice) + .margin({ top: 20 }) + .key('UISearchInterface006_001') + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..274a8f4aaa7b4231e864e65c949ae6802f9fa878 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0010.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 UIWindowFocusSwitch0010 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerB, text: this.inputValueB, placeholder: '组件B' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8dab4de72aae6edf35d8562bc4bc90bd84e71fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0020.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 UIWindowFocusSwitch0020 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .enableKeyboardOnFocus(false) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..ceae674ad99d190000080bd751a65c366098f38a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0030.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 UIWindowFocusSwitch0030 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.Normal) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..59a28cff16a027f262305ce320d81b05e5312cff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0040.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 UIWindowFocusSwitch0040 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.Password) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..592ad086355fb685eb52c48bfa02b907f72f73f7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0050.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 UIWindowFocusSwitch0050 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.Email) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..ead9164ce1d506068112f2844b49597421ce6e89 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0060.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 UIWindowFocusSwitch0060 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.Number) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..483133c0aabf8250ef8faee0a0939af996b7758a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0070.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 UIWindowFocusSwitch0070 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.PhoneNumber) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc57013905a0ee06805d73ac59b6baeb17b55088 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0080.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 UIWindowFocusSwitch0080 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.USER_NAME) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e052b5d3b759221f47e6d7479edcd6db153adb3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0090.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 UIWindowFocusSwitch0090 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.NEW_PASSWORD) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..572855df88bc1c29c9aea723d15c15d2091ee0a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0100.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 UIWindowFocusSwitch0100 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.NUMBER_PASSWORD) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..51b6d68a317cb1936dee2ec4392ec83ffa18ad12 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0110.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 UIWindowFocusSwitch0110 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(InputType.SCREEN_LOCK_PASSWORD) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..2be1156d67671e36cb9fc05e1440bc195d9e3402 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0120.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 UIWindowFocusSwitch0120 { + controllerA: TextAreaController = new TextAreaController(); + @State inputValueA: string = ''; + controllerB: TextAreaController = new TextAreaController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextArea({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(TextAreaType.NORMAL) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1c3107d0f9c4d324c01fd20aa379bef1627b4b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0130.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 UIWindowFocusSwitch0130 { + controllerA: TextAreaController = new TextAreaController(); + @State inputValueA: string = ''; + controllerB: TextAreaController = new TextAreaController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextArea({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(TextAreaType.EMAIL) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..bbc39e2cdfa0b292a5f32499e7fc0734cf89b1a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0140.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 UIWindowFocusSwitch0140 { + controllerA: TextAreaController = new TextAreaController(); + @State inputValueA: string = ''; + controllerB: TextAreaController = new TextAreaController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextArea({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(TextAreaType.NUMBER) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..fae2b85e156ff936caeb3b04a765596b2d5366e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0150.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 UIWindowFocusSwitch0150 { + controllerA: TextAreaController = new TextAreaController(); + @State inputValueA: string = ''; + controllerB: TextAreaController = new TextAreaController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextArea({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .type(TextAreaType.PHONE_NUMBER) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..96be6bc8659de739377cb81caff14413d1e8f431 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0160.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 UIWindowFocusSwitch0160 { + controllerA: SearchController = new SearchController(); + @State inputValueA: string = ''; + controllerB: SearchController = new SearchController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Search({ controller: this.controllerA, value: this.inputValueA, placeholder: '组件A' }) + .type(SearchType.NORMAL) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..b653c25844f8fdd76a7dd2573cd70e5a39f42b6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0170.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 UIWindowFocusSwitch0170 { + controllerA: SearchController = new SearchController(); + @State inputValueA: string = ''; + controllerB: SearchController = new SearchController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Search({ controller: this.controllerA, value: this.inputValueA, placeholder: '组件A' }) + .type(SearchType.EMAIL) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c428c32031c612174e1948b4f2cbe09e43dc4a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0180.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 UIWindowFocusSwitch0180 { + controllerA: SearchController = new SearchController(); + @State inputValueA: string = ''; + controllerB: SearchController = new SearchController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Search({ controller: this.controllerA, value: this.inputValueA, placeholder: '组件A' }) + .type(SearchType.NUMBER) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..9cdd0e5de7b59ce86ef2b1d55fccb8404bbdadf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0190.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 UIWindowFocusSwitch0190 { + controllerA: SearchController = new SearchController(); + @State inputValueA: string = ''; + controllerB: SearchController = new SearchController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + Search({ controller: this.controllerA, value: this.inputValueA, placeholder: '组件A' }) + .type(SearchType.PHONE_NUMBER) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..09a547eab353433db57699e3926ef2419d757c00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0200.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 UIWindowFocusSwitch0200 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp').id('TextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerB, text: this.inputValueB, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..796857444247c120d0f9c9bfb3ad10660092fdfe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0210.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 UIWindowFocusSwitch0210 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .customKeyboard(this.keyboardA()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerB, text: this.inputValueB, placeholder: '组件B' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + keyboardA() { + CustomKeyboardBuilder({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + } +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..525345db5e1c0dfd3fc8bd8bac6ed0c0a43a3297 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0220.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIWindowFocusSwitch0220 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .customKeyboard(this.keyboardA()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerB, text: this.inputValueB, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + keyboardA() { + CustomKeyboardBuilder({ inputValue: this.inputValueA, controller: this.controllerA, index: 0 }); + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 1 }); + } +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..2592ac59a4f27b0bb807254b8d771ac4c4e36da4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0230.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 UIWindowFocusSwitch0230 { + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerB, text: this.inputValueB, placeholder: '组件B' }) + .customKeyboard(this.keyboardB()) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + .enableKeyboardOnFocus(false) + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } + + @Builder + keyboardB() { + CustomKeyboardBuilder({ inputValue: this.inputValueB, controller: this.controllerB, index: 0 }); + } +} + +// 自定义键盘组件 +@Component +export struct CustomKeyboardBuilder { + controller?: TextInputController = new TextInputController(); + index: number = 0; + @Link inputValue: string; + + build() { + 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 + '') + .backgroundColor(this.index === 0 ? Color.Blue : + (this.index === 1 ? Color.Green : Color.Red)) + .width(110) + .onClick(() => { + this.inputValue += item; + }) + } + }) + } + .maxCount(3) + .columnsGap(10) + .rowsGap(10) + .padding(5) + } + .backgroundColor(Color.Gray) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..0dc2711daaaa424f430d7d22353420c6403c9450 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0240.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 UIWindowFocusSwitch0240 { + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerB, text: this.inputValueB, placeholder: '组件B' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + .enableKeyboardOnFocus(false) + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ba30c33025462220632db1de756ceceaf4d6c1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0250.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 UIWindowFocusSwitch0250 { + controllerA: TextInputController = new TextInputController(); + @State inputValueA: string = ''; + controllerB: TextInputController = new TextInputController(); + @State inputValueB: string = ''; + + build() { + Row() { + Column() { + Divider().height(10).color(Color.Transparent) + TextInput({ controller: this.controllerA, text: this.inputValueA, placeholder: '组件A' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputA') + Divider().height(200).color(Color.Transparent) + TextInput({ controller: this.controllerB, text: this.inputValueB, placeholder: '组件B' }) + .margin(10) + .border({ width: 1 }) + .height('48vp') + .id('TextInputB') + Divider().height(10).color(Color.Transparent) + } + .width('100%') + } + .height('100%').alignItems(VerticalAlign.Top) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement0220.ets index 1543f4156063be7cf248fc9fa6caab98eef2d018..880e506553c48d6be9b49cd5f6220b4c44a81079 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement0220.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentButtonSelectEnhancement/UiComponentButtonSelectEnhancement0220.ets @@ -15,6 +15,7 @@ import window from '@ohos.window'; import common from '@ohos.app.ability.common'; +import Settings from '../../../test/model/Settings'; @Entry @Component @@ -48,22 +49,13 @@ struct UiComponentButtonSelectEnhancement0220 { Column() { Button("横竖切换") .onClick(() => { - this.changeOrientation() + Settings.changeOrientation(); }) .keyboardShortcut(FunctionKey.F2, []) } .width('50%') } } - - changeOrientation() { - let context = getContext(this) as common.UIAbilityContext; - window.getLastWindow(context) - .then((lastWindow) => { - this.isChange = !this.isChange - lastWindow.setPreferredOrientation(this.isChange ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) - }) - } } class MenuItemContentModifier0220 implements ContentModifier { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png new file mode 100644 index 0000000000000000000000000000000000000000..476223a2cbaa029e0ccc67660eb768effb766501 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png new file mode 100644 index 0000000000000000000000000000000000000000..0d16a9f5d39efc178484b2bfcbe3372cb3c16a7e Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png new file mode 100644 index 0000000000000000000000000000000000000000..eaae1996c7bcdeafd8a6287b9d5d44cfda56a934 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png new file mode 100644 index 0000000000000000000000000000000000000000..846adf54057902753c7ad575ea11769db6c5eec8 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts index c26fa1d9efb5d54d5e6b7e39ca0f440e53f4db12..3e7da318d6bb8c07f2e133d03fe471c983ba89d8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts @@ -21,44 +21,43 @@ var abilityDelegator = undefined var abilityDelegatorArguments = undefined async function onAbilityCreateCallback() { - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } async function addAbilityMonitorCallback(err: any) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } + constructor() { + } - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } - async onRun() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' - } - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); - hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); - }) - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') { + cmd += ' -D' } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/video1.mp4 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/video1.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..edca7e3b2894ce9b8bc53e96fd330a5e3308ce3d Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/video1.mp4 differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 index e58bd507f3ecff51931c351ebcabf6603cd5c40c..0297f72c621796ae4dd6f2cf93120173eb71c65b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 @@ -12,20 +12,38 @@ "installationFree": false, "pages": "$profile:test_pages", "requestPermissions": [ + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, { "name": "ohos.permission.WRITE_MEDIA" }, + { + "name": "ohos.permission.INTERNET" + }, { "name": "ohos.permission.READ_MEDIA" }, { - "name":"ohos.permission.UPDATE_CONFIGURATION" + "name": "ohos.permission.CAPTURE_SCREEN" + }, + { + "name": "ohos.permission.UPDATE_CONFIGURATION" }, { - "name":"ohos.permission.RUNNING_LOCK" + "name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER" }, { - "name":"ohos.permission.INTERNET" + "name": "ohos.permission.RUNNING_LOCK" } ], "abilities": [ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json index 97e43d83bf94a0d1a5df72c19fc3df8acdf5e3ae..3e778ce4f18d352093fe761529d71fb9419fa0fd 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json @@ -1,5 +1,5 @@ { - "integer":[ + "integer": [ { "name": "0", "value": 0 @@ -11,24 +11,26 @@ { "name": "20", "value": 20 - },{ + }, + { "name": "50", "value": 50 - },{ + }, + { "name": "integer30", "value": 30 - },{ + }, + { "name": "integer100", "value": 100 - },{ + }, + { "name": "string30", "value": 30 - },{ + }, + { "name": "30", "value": 30 - },{ - "name": "15", - "value": 15 }, { "name": "100", diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/strarray.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/strarray.json index abd922b6c2265426020ca078caa88a20075cf90b..7fa83f28a0a2b54be83e487eb73727d477ad50b9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/strarray.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/strarray.json @@ -78,7 +78,8 @@ "value": "ཤིང་ཏོག་ཧྥེང་ལི། " } ] - },{ + }, + { "name": "fruit_ww", "value": [ { @@ -163,7 +164,7 @@ } ] }, - { + { "name": "appliance_ww", "value": [ { 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..7d8900ca429fe890bfb1611c6140ee3ec628cbd6 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,10 @@ { "name": "20string", "value": "20" + }, + { + "name": "size_16px", + "value": "32fp" } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/dragon.bmp b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/dragon.bmp new file mode 100755 index 0000000000000000000000000000000000000000..124d17803637706059e009c229c788a81250edfc Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/dragon.bmp differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/fly.svg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/fly.svg index e23de8b484ea857e85daca79215ea9b7ca86dff9..8ebc4f9963f6a4a3dfb8426b1d04afe798c3be5e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/fly.svg +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/fly.svg @@ -1,6 +1,14 @@ - -to flyAn icon for "fly" from the Sketchy series on to [icon]. Downloaded from http://www.toicon.com/icons/sketchy_fly by 182.109.68.208 on 2017-12-01. Licensed CC-BY, see http://toicon.com/license/ for details. - -image/svg+xmlShannon E Thomashttp://www.toicon.com/icons/sketchy_fly + +to fly + An icon for "fly" from the Sketchy series on to [icon]. Downloaded from http://www.toicon.com/icons/sketchy_fly by 182.109.68.208 on 2017-12-01. Licensed CC-BY, see http://toicon.com/license/ for details. + + image/svg+xmlShannon E Thomashttp://www.toicon.com/icons/sketchy_fly diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/misato.gif b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/misato.gif new file mode 100755 index 0000000000000000000000000000000000000000..11ccba5547f882b65ab3d67fc6af64fbc88cf2a2 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/misato.gif differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/vegetable.svg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/vegetable.svg new file mode 100755 index 0000000000000000000000000000000000000000..f03504a367897c8f813e65473d5c0b0e135f01b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/vegetable.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/video1.mp4 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/video1.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..edca7e3b2894ce9b8bc53e96fd330a5e3308ce3d Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/video1.mp4 differ 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..4a4756fb689d98b332bcc6d9e553bd510ab77f5a 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 @@ -1362,6 +1362,129 @@ "testability/pages/UIComponentButtonSelectDivider/UIComponentButtonSelectDivider0140", "testability/pages/UIComponentButtonSelectDivider/UIComponentButtonSelectDivider0150", "testability/pages/UIComponentButtonSelectDivider/UIComponentButtonSelectDivider0160", + "testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0140", + "testability/pages/UIComponentButtonTextPickerMirrorImage/UIComponentButtonTextPickerMirrorImage0100", + "testability/pages/UIDataPicker/UIComponentPopupbxPickrold0560", + "testability/pages/UIDataPicker/UIComponentButtonDatepickerInterface0230", + "testability/pages/UIAlertDialog/UIComponentPopupboxAlrertdialogInterface0660", + "testability/pages/UIButton/UIComponentUIsupportColor0130", + "testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom001", + "testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom002", + "testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom003", + "testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom004", + "testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom005", + "testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom006", + "testability/pages/UIComponentCommonAttrCom/UIComponentCommonAttrCom007", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing024", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing026", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing027", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing028", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing029", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing030", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing032", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UIComponentRichEditorSymbolShuffleEditing0310", + "testability/pages/UIComponentRichEditorSymbolShuffleEditing/UiComponentSymbolSymbolColoirrendering011", + "testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface011", + "testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface012", + "testability/pages/UIComponentTextHyperlinkInterface/UIComponentTextHyperlinkInterface014", + "testability/pages/UIComponentTextHyperlinkLayout/UIComponentTextHyperlinkLayout001", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt010", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt011", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt012", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt013", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt015", + "testability/pages/UIComponentTextTextImageSpanAlt/UIComponentTextTextImageSpanAlt016", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency001", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency002", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency003", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency004", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency005", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency006", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency007", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency008", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency009", + "testability/pages/UIComponentSearchSearchUxconsistency/UIComponentSearchSearchUxconsistency010", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0640", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0660", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0670", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0680", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0690", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0710", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0730", + "testability/pages/UIComponentLineHeightDecorationLetterSpacing/UIComponentLineHeightDecorationLetterSpacing0770", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0040", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0050", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0060", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0080", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0100", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0110", + "testability/pages/UIComponentTextTextAbility/UIComponentTextTextAbility0180", + "testability/pages/UISearchInterface/UISearchInterface006", + "testability/pages/UIComponentContainerSpanInterface/UIComponentContainerSpanInterface002", + "testability/pages/UIComponentTextInterface/UIComponentTextInterface008", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0010", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0020", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0030", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0040", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0050", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0060", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0070", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0080", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0090", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeButton", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0100", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0110", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0120", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0200", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0210", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0220", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0230", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0240", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0250", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0400", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0410", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0420", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0430", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0440", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0450", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0520", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0530", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0540", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0550", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0560", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimize0570", + "testability/pages/UIComponentSoftKeyBoardOptimize/UIComponentSoftKeyBoardOptimizeSystemPopup", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0010", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0020", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0030", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0040", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0050", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0060", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0070", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0080", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0090", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0100", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0110", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0120", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0130", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0140", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0150", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0160", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0170", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0180", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0190", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0200", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0210", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0220", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0230", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0240", + "testability/pages/UIWindowFocusSwitch/UIWindowFocusSwitch0250", + "testability/pages/UIComponentTextTextEditable/UIComponentTextTextEditable026", + "testability/pages/UIAiParticiple/UIAiParticiple0050", + "testability/pages/UIComponentPopupboxTimepickerdialogInterface/UIComponentPopupboxTimepickerdialogInterface1190", + "testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0030", + "testability/pages/UIComponentTextTextInputCursor/UIComponentTextTextInputCursor1720", + "testability/pages/UIComponentTextTextInputKeepEditableState/UIComponentTextTextInputKeepEditableState0100", "testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0020", "testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0030", "testability/pages/UIComponentButtonSelectControlSize/UIComponentButtonSelectControlSize0040", @@ -1801,6 +1924,82 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0010", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0020", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0030", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0040", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0050", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0080", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0060", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0070", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0090", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0120", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0110", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0100", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0200", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0180", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0210", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0190", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0130", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0140", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0150", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0160", + "testability/pages/UIComponentImageAicontroller/UIComponentImageAicontroller0170", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0070", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0080", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0090", + "testability/pages/UIComponentTextTransparency/UIComponentTextTransparency0100", + "testability/pages/UIComonentMediaImagespanError/ComonentMediaImagespanErrorAll", + "testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0150", + "testability/pages/UIComponentSpanBaselineoffset/UIComponentSpanBaselineoffset0160", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1340", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1350", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1360", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1370", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1380", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1390", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1400", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1550", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1560", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1570", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1580", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1590", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1600", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor1610", + "testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0010", + "testability/pages/UIComponentUiFontConfigFontList/UIComponentUiFontConfigFontList0020", + "testability/pages/UIComponentMagnifyingGlass/UIComponentMagnifyingGlass0010", + "testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0070", + "testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0090", + "testability/pages/UIComponentInfomationMarqueeAnimation/UIComponentInfomationMarqueeAnimation0100", + "testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0010", + "testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0040", + "testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0050", + "testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0070", + "testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0130", + "testability/pages/UIComponentInfomationMarqueeDirection/UIComponentInfomationMarqueeDirection0150", + "testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0090", + "testability/pages/UIComponentTextCommonClick/UIComponentTextCommonClick0100", + "testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement039", + "testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement040", + "testability/pages/UIComponentTextCommontextMinfontSizeReplacement/UIComponentTextCommontextMinfontSizeReplacement041", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0030", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0040", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0050", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0060", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0070", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0080", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0090", + "testability/pages/UIComponentTextSupportfont/UIComponentTextSupportfont0100", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0110", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0120", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0130", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0140", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0150", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportfont0160", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0340", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0350", + "testability/pages/UIComponentTextTextSupportFont/UIComponentTextTextSupportFont0360" ] } diff --git a/function/ui_compare_rh/uicompare_tools/excel/uicompare_gen.xlsx b/function/ui_compare_rh/uicompare_tools/excel/uicompare_gen.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..eb10370b530e3ed9070519f4073d025920255b39 Binary files /dev/null and b/function/ui_compare_rh/uicompare_tools/excel/uicompare_gen.xlsx differ