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