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/ArkUITabScrollableTest/ArkUITabScrollable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets index 11de16ebb3a3e455b798f2cddc14af0bb33dd4dc..b407e342f6c6f54240e142da8bfeb4799dd6ead2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_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..5608f1e1c8e5990fb830afc7b233c75d3c11199d 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,11 +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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 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..ae172c17affd4bf5a705e692cb3b9739d370ccf2 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,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 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..65218c03e71e323cee40c9adfdf473babf22e88a 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_LabelStyle_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..a8c275edf953e3a0785e0db14a2ddcc1ddc481db 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_026 * @tc.name 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..462a10d6ce21dbec93919b65e28bf7f82c2c69ec 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_LabelStyle_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..dfd5a3d622ba5974e5aafbab42aaf800e52bf723 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 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..4331ff6cefe1f8d5103d3bf239eea4339934b839 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,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 * @tc.name ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 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..7b7199d0a48ad27245247610861ebde2bce8e325 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ArkUI_Tabs_vertical_001 * @tc.name 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..10b7bb6db172eedc875134bb0068b3d97ed9601e 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 @@ -40,7 +42,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : SUB_ACE_UI_COMPONENT_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..89354119baaf14d6a320f325bbe3cae8b6754cc7 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): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number ARKUI_COMPONENTFUNCTION_ADVANCEDCOMPONENTS_POPUP_INTERFACE_0178 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorSupportColorTest/ComponentRicheditorSupportColorTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorSupportColorTest/ComponentRicheditorSupportColorTests.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c5799f13e3314949175fc1635ebc87aaf5f9e60 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorSupportColorTest/ComponentRicheditorSupportColorTests.test.ets @@ -0,0 +1,354 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { uiAppearance } from '@kit.ArkUI' +import { Driver, ON } from '@ohos.UiTest' +import { i18n } from '@kit.LocalizationKit' + +export default function ComponentRicheditorSupportColorTests() { + + describe('ComponentRicheditorSupportColorTests', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1130 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1130 + * @tc.desc : 验证RichEditor组件动态切换浅色模式-浅色模式正常切换 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1130.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001"); + await Utils.sleep(2000); + 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); + }); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1130.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1140 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1140 + * @tc.desc : 验证RichEditor组件动态切换浅色模式-深色模式正常切换 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1140.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001"); + await Utils.sleep(2000); + 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); + }); + await Utils.sleep(500); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + windowSnap.snapShot(); + await 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); + }); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1140.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1150 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1150 + * @tc.desc : 验证RichEditor组件动态切换深色模式-浅色模式正常切换 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1150.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001"); + await Utils.sleep(2000); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + 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); + }); + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1150.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1160 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1160 + * @tc.desc : 验证RichEditor组件动态切换深色模式-深色模式正常切换 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1160.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001"); + await Utils.sleep(2000); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + windowSnap.snapShot(); + await 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); + }); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1160.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1170 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1170 + * @tc.desc : 固定使用浅色模式 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1170.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor002"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1170.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1180 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1180 + * @tc.desc : 固定使用深色模式 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1180.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor003"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await 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); + }); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1180.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190 + * @tc.desc : 验证RichEditor组件跟随系统深浅颜色变化 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190.`); + await Utils.sleep(1000); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190_1 + * @tc.name : SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190_1 + * @tc.desc : 验证RichEditor组件跟随系统深浅颜色变化 + */ + it('SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190_1.`); + await Utils.sleep(1000); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await 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); + }); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPFORT_COLOR_1190_1.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001 + * @tc.desc : 深色模式下,选中高亮、光标、手柄符合X设计 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let rich = await driver.findComponent(ON.id('RichEditorSupportColor004')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + windowSnap.snapShot(); + await 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); + }); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001_1 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001_1 + * @tc.desc : 深色模式下,选中高亮、光标、手柄符合X设计 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001_1.`); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK).then(() => { + console.info('Set dark-mode successfully.'); + }).catch((error:Error) => { + console.error('Set dark-mode failed, ' + error.message); + }); + await Utils.sleep(500); + Settings.createWindow("testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let rich = await driver.findComponent(ON.id('RichEditorSupportColor004')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(500); + let select = await driver.findComponent(ON.id('select')); + await select.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await 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); + }); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_VISUALS_0001_1.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorThreeStrikesTest/ComponentRichEditorThreeStrikesTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorThreeStrikesTest/ComponentRichEditorThreeStrikesTests.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..026f2d1029b488193e56856f4ad3609fa736840a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorThreeStrikesTest/ComponentRichEditorThreeStrikesTests.test.ets @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import 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' + +export default function ComponentRichEditorThreeStrikesTests() { + + describe('ComponentRichEditorThreeStrikesTests', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_THREESTRIKES_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_THREESTRIKES_0010 + * @tc.desc : 三击ai实体 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_THREESTRIKES_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_THREESTRIKES_0010 start.`); + Settings.createWindow("testability/pages/ComponentRichEditorThreeStrikes/ComponentRichEditorThreeStrikes001") + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('ComponentRichEditorThreeStrikes001')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(100); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(100); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(100); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_THREESTRIKES_0010.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorTransformationTest/ComponentRicheditorTransformtionTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorTransformationTest/ComponentRicheditorTransformtionTests.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..96d69103382503348619fecf5b3e28b707ff2f17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentRichEditorTransformationTest/ComponentRicheditorTransformtionTests.test.ets @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, On } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function ComponentRicheditorTransformtionTests() { + + describe('ComponentRicheditorTransformtionTests', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_007 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_007 + * @tc.desc : 设置缩放属性的单手柄测试 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_007', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_007.`); + + Settings.createWindow("testability/pages/RichEditorTransformation/RichEditorTransformation001"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('RichEditorTransformation001')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_007.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_008 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_008 + * @tc.desc : 设置缩放属性的双手柄测试 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_008', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_008.`); + + Settings.createWindow("testability/pages/RichEditorTransformation/RichEditorTransformation001"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('RichEditorTransformation001')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + let select = await driver.findComponent(ON.id('select')); + await select.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_008.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_009 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_009 + * @tc.desc : 设置缩放属性的放大倍数为5倍时,组件内容能否正常显示 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_009', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_009.`); + + Settings.createWindow("testability/pages/RichEditorTransformation/RichEditorTransformation002"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('RichEditorTransformation002')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + let select = await driver.findComponent(ON.id('select')); + await select.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_009.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_011 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_011 + * @tc.desc : 设置缩放属性的单手柄测试 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_011', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_011.`); + + Settings.createWindow("testability/pages/RichEditorTransformation/RichEditorTransformation003"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('RichEditorTransformation003')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_011.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_012 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_012 + * @tc.desc : 设置缩放属性的双手柄测试 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_012', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_012.`); + Settings.createWindow("testability/pages/RichEditorTransformation/RichEditorTransformation003"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(500); + let rich = await driver.findComponent(ON.id('RichEditorTransformation003')); + let getBounds = await rich.getBounds(); + await Utils.sleep(500); + await driver.click(getBounds.left + 110, getBounds.top + 30); + await Utils.sleep(1000); + let select = await driver.findComponent(ON.id('select')); + await select.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_AffineTransformation_012.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStringsTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStringsTests.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b94f45f7c986510e67005200a1c5fc52f319aa5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStringsTests.test.ets @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function ComponentTextRichEditorCopyPasteAttributeStringsTests() { + + describe('ComponentTextRichEditorCopyPasteAttributeStringsTests', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0044 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0044 + * @tc.desc : 复制纯文本类型的html内容粘贴到richeditor + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0044', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0044 start.`); + + Settings.createWindow('testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0044'); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + let textInput = await driver.findComponent(ON.id('textInput01')); + await textInput.click(); + await Utils.sleep(200); + driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_A); + await Utils.sleep(200); + driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorCopyPaste001')); + await Utils.sleep(200); + + await rich.click(); + driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(200); + + let stop = await driver.findComponent(ON.id('stop')); + await stop.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0044.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0045 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0045 + * @tc.desc : 复制图片类型的html内容粘贴到richeditor + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0045', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0045 start.`); + + Settings.createWindow('testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0045'); + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + let textInput = await driver.findComponent(ON.id('textInput02')); + await textInput.click(); + await Utils.sleep(200); + driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_A); + await Utils.sleep(200); + driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_C); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorCopyPaste002')); + await Utils.sleep(200); + + let getBounds = await rich.getBounds(); + await Utils.sleep(200); + await driver.click(getBounds.left + 110, getBounds.top + 110); + driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_V); + await Utils.sleep(200); + let stop = await driver.findComponent(ON.id('stop1')); + await stop.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_COPY_PASTE_ATTRIBUTE_STRINGS_0045.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimizationTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimizationTests.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..21a27c4d9f8e774b20458060dfaf5b1cf728d2e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimizationTests.test.ets @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function ComponentTextRichEditorHandleOptimizationTests() { + + describe('ComponentTextRichEditorHandleOptimizationTests', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0005 + * @tc.name : SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0005 + * @tc.desc : 组件中有悬浮于组件的其他页面 + */ + it('SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0005', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0005 start.`); + Settings.createWindow('testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0005',0,0) + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorHandleOptimization001')); + await Utils.sleep(200); + let bounds=await rich.getBounds(); + await Utils.sleep(200); + + await driver.longClick(bounds.left+300,bounds.top+300); + await Utils.sleep(200); + await driver.swipe(bounds.left+300,bounds.top+300,bounds.left+600,bounds.top+600,800); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0005.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0007 + * @tc.name : SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0007 + * @tc.desc : 其他页面悬浮在组件内的image/symbol上面 + */ + it('SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0007', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0007 start.`); + + Settings.createWindow('testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0007',0,0) + let driver = Driver.create(); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorHandleOptimization002')); + await Utils.sleep(200); + let bounds=await rich.getBounds(); + await Utils.sleep(200); + + await driver.longClick(bounds.left+300,bounds.top+300); + await Utils.sleep(200); + await driver.swipe(bounds.left+300,bounds.top+300,bounds.left+700,bounds.top+600,800); + await Utils.sleep(1000); + + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0007.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0008 + * @tc.name : SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0008 + * @tc.desc : 其他页面悬浮在组件内的image/symbol上面 + */ + it('SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0008', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0008 start.`); + + Settings.createWindow('testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0008',0,0) + let driver = Driver.create(); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorHandleOptimization003')); + await Utils.sleep(200); + let bounds=await rich.getBounds(); + await Utils.sleep(200); + + await driver.click(bounds.right-200,bounds.bottom-100); + await Utils.sleep(200); + await driver.drag(bounds.right-200,bounds.bottom-100,bounds.left+300,bounds.top+300,1000); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_CONFOMENT_TEXT_RICHEDITOR_handleoptimization_0008.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStabilityTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStabilityTests.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c314a3d9a5157000a2997e4ce1bb7ca44c8ce590 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStabilityTests.test.ets @@ -0,0 +1,253 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function ComponentTextRichEditorStabilityTests() { + + describe('ComponentTextRichEditorStabilityTests', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0008 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0008 + * @tc.desc : 连续拖动光标 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0008', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0008 start.`); + Settings.createWindow('testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0008') + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorStability001')); + await Utils.sleep(200); + let bounds = await rich.getBounds(); + await driver.click(bounds.left + 50, bounds.top + 20); + await driver.swipe(bounds.left + 50, bounds.top + 20, bounds.left + 500, bounds.top + 20, 600); + await Utils.sleep(200); + await driver.swipe(bounds.left + 500, bounds.top + 20, bounds.left + 200, bounds.top + 20, 800); + await Utils.sleep(200); + await driver.swipe(bounds.left + 200, bounds.top + 20, bounds.left + 400, bounds.top + 20, 1000); + await Utils.sleep(200); + await driver.swipe(bounds.left + 400, bounds.top + 20, bounds.left + 200, bounds.top + 20, 1400); + await Utils.sleep(200); + let stop = await driver.findComponent(ON.id('StabilityStop1')); + await stop.click(); + await Utils.sleep(100); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0008.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0009 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0009 + * @tc.desc : 连续拖动手柄 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0009', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0009 start.`); + + Settings.createWindow('testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0009') + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorStability002')); + await Utils.sleep(200); + let bounds = await rich.getBounds(); + await driver.click(bounds.left + 200, bounds.top + 200); + await Utils.sleep(20); + await driver.click(bounds.left + 200, bounds.top + 200); + await Utils.sleep(200); + await driver.swipe(bounds.left + 200, bounds.top + 200, bounds.left + 500, bounds.top + 200, 600); + await Utils.sleep(200); + await driver.swipe(bounds.left + 500, bounds.top + 200, bounds.left + 305, bounds.top + 200, 800); + await Utils.sleep(200); + await driver.swipe(bounds.left + 305, bounds.top + 200, bounds.left + 405, bounds.top + 500, 1000); + await Utils.sleep(200); + await driver.swipe(bounds.left + 405, bounds.top + 500, bounds.left + 205, bounds.top + 240, 1600); + await Utils.sleep(200); + await driver.swipe(bounds.left + 205, bounds.top + 240, bounds.left + 405, bounds.top + 440, 1600); + await Utils.sleep(200); + let stop = await driver.findComponent(ON.id('StabilityStop2')); + await Utils.sleep(100); + await stop.click(); + await Utils.sleep(100); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0009.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0010 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0010 + * @tc.desc : 连续拖拽 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0010 start.`); + Settings.createWindow('testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0010') + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorStability003')); + await Utils.sleep(100); + let bounds = await rich.getBounds(); + await Utils.sleep(100); + + await driver.click(bounds.left + 200, bounds.top + 200); + await Utils.sleep(20); + await driver.click(bounds.left + 200, bounds.top + 200); + await Utils.sleep(100); + await driver.swipe(bounds.left + 200, bounds.top + 200, bounds.left + 500, bounds.top + 300, 600); + await Utils.sleep(100); + await driver.drag(bounds.left + 350, bounds.top + 250, bounds.left + 550, bounds.top +750, 1500); + await Utils.sleep(1000) + + await Utils.sleep(500); + let stop = await driver.findComponent(ON.id('StabilityStop3')); + await Utils.sleep(200); + await stop.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(500); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0010.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0011 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0011 + * @tc.desc : 连续长按浮起后松手再长按 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0011', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0011 start.`); + Settings.createWindow('testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0011') + await Utils.sleep(200); + let driver = Driver.create(); + await Utils.sleep(100); + let rich = await driver.findComponent(ON.id('RichEditorStability004')); + await Utils.sleep(100); + let bounds = await rich.getBounds(); + + await driver.longClick(bounds.left + 350, bounds.top + 250); + await Utils.sleep(200); + await driver.swipe(bounds.left + 350, bounds.top + 250, bounds.left + 500, bounds.top + 500, 1000); + await Utils.sleep(200); + await driver.longClick(bounds.left + 450, bounds.top + 350); + await Utils.sleep(100); + + await driver.longClick(bounds.left + 550, bounds.top + 600); + await Utils.sleep(200); + await driver.swipe(bounds.left + 550, bounds.top + 600, bounds.left + 750, bounds.top + 800, 1400); + await Utils.sleep(100); + await driver.longClick(bounds.left + 650, bounds.top + 750); + await Utils.sleep(100); + let stop = await driver.findComponent(ON.id('StabilityStop4')); + await Utils.sleep(100); + await stop.click(); + await Utils.sleep(100); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0011.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0012 + * @tc.name : SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0012 + * @tc.desc : 编辑态下连续长按组件内容并拖动 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0013', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0013 start.`); + Settings.createWindow('testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0013') + await Utils.sleep(500); + let driver = Driver.create(); + await Utils.sleep(200); + let rich = await driver.findComponent(ON.id('RichEditorStability005')); + await Utils.sleep(200); + let bounds = await rich.getBounds(); + await driver.click(bounds.left + 150, bounds.top + 250); + await Utils.sleep(200); + await driver.drag(bounds.left + 150, bounds.top + 250, bounds.left + 350, bounds.top + 400, 1000); + await Utils.sleep(200); + + await driver.click(bounds.left + 350, bounds.top + 400); + await Utils.sleep(200); + await driver.drag(bounds.left + 350, bounds.top + 400, bounds.left + 200, bounds.top + 250, 1000); + await Utils.sleep(200); + let stop = await driver.findComponent(ON.id('StabilityStop5')); + await Utils.sleep(400); + await stop.click(); + await Utils.sleep(100); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_STABILITY_0013.`); + done(); + }) + }) +} 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..f68cc7b805d527b2994499eea60b91d4767a76f7 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,7 +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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * NO.SUB_ACE_UI_RICHEDITOR_AI_0010 *des:1、点击“开启AI分析”按钮(设置 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..34c5cfe64f916826479a0f82bf75417983b9be49 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * 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..cd571535c65f7e689c18c318ba33c28c42611ca0 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相关用例 @@ -40,7 +42,51 @@ import { KeyCode } from '@kit.InputKit' 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * 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..e4a03a53248705616ed77896e5694958091a72fd 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,27 +21,73 @@ 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 - * - * 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)}`) - * */ + /* + * fontfeatures cases + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ export default function 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * 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..c2f2768f4e9bf61b907dc43306aa26ce351237d7 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,7 +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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_INTERFACE_0340 *des:1、启动应用 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..bba2280d02b3aabd8e81f3c4cdd19f4e22941629 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * 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..03b29203fc2a85754da348539e14eb715e8f083b 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相关用例 @@ -41,6 +43,52 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0014 *des:1、添加RichEditor组件 @@ -257,5 +305,74 @@ export default function ComponentTextRicheditorLineHeightLetterSpacingTests() { done(); }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0015 + *des:1、添加RichEditor组件 + 2、设置lineHeigzht值为100、letter-spacing值为100,输入文 + 本内容 + 3、从其他组件拖拽过来一段lineHeizht值为-10、letter- + spacing值为-10的文本内睿,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHTLETTERSPACING_0015', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0015 start.`); + + Settings.createWindow("testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0015"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorLineHeightLetterSpacing0015")); + let textArea = await driver.findComponent(ON.id('TextArea')); + await textArea.click(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_MOVE_END); + await Utils.sleep(500); + await textArea.click(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click(); + await Utils.sleep(1000); + await textArea.dragTo(richeditor) + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0015.`); + done(); + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0016 + *des:1、添加RichEditor组件 + 2、设置lineHeight值为0b1010、letter-spacing值为0b1010, + 输入文本内容 + 3、从其他组件拖拽过来一段linaHeight值为0b1010、latter- + spacing值为0b1010的文本内容,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHTLETTERSPACING_0016', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0016 start.`); + + Settings.createWindow("testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0016"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorLineHeightLetterSpacing0016")); + let textArea = await driver.findComponent(ON.id('TextArea')); + await textArea.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click(); + await Utils.sleep(1000); + await textArea.dragTo(richeditor) + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LINEHEIGHT&LETTERSPACING_0016.`); + done(); + }) + }) } 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..c8329630ecfa54824a6d313d5fa1a2fbdbe97070 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,7 +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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_LONGPRESSTOSELECTAIL_0001 *des:1、设置onLongPress回调函数里setSelection(1,2,{menuPolicy: MenuPolicy.SHOW }) 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..449feae10b70061c9eda4e084160b82a8ee2ee77 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /** * NO.SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0001 *des:2、富文本组件输入框无法输入, onWillChange回调中的replacedSpans中的值正常, onDidChang无回调值|,验证效果 @@ -84,8 +132,8 @@ export default function ComponentTextRicheditorOnWillChangeTests() { let selectAll = await driver.findComponent(ON.text('全选')) await selectAll?.click(); await Utils.sleep(1000); - await textArea.dragTo(richeditor) - await Utils.sleep(1000); + await textArea.dragTo(richeditor); + await Utils.sleep(4000); windowSnap.snapShot(); await Utils.sleep(1000); Logger.info('TEST', `SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0002.`); @@ -232,5 +280,78 @@ export default function ComponentTextRicheditorOnWillChangeTests() { Logger.info('TEST', `SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0007.`); done(); }) + + /** + * NO.SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0025 + *des:1.onwillchange返回值设置为true 2.软硬键盘输入文本内容3.组件内拖放文本\image\symbol内容,看预期效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0025', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0025start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0025") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorOnWillChange0025")); + await richeditor.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_F); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_F); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_MOVE_END); + await Utils.sleep(1000); + let select = await driver.findComponent(ON.id("select")); + await select.click(); + await Utils.sleep(500); + await richeditor.dragTo(richeditor); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0025.`); + done(); + }) + /** + * NO.SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0026 + *des:1.onwillchange返回值设置为true 2.软硬键盘输入文本内容3.从其他组件拖拽文本内容到富文本组件的段首\段中\段尾,看预期效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0026', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0026start.`); + + Settings.createWindow("testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0026") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorOnWillChange0026")); + await richeditor.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DPAD_LEFT); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_F); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_F); + await Utils.sleep(100); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT,KeyCode.KEYCODE_MOVE_END); + await Utils.sleep(500); + let textArea = await driver.findComponent(ON.id('TextArea')); + await textArea.click(); + await Utils.sleep(500); + await textArea.click() + await Utils.sleep(500); + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click(); + await Utils.sleep(1000); + await textArea.dragTo(richeditor); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UT_COMPONENT_TEXT_RICHEDITOR_ONWILLCHANGE_0026.`); + done(); + }) }) } 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..8521fc6cb04487286a15baea351fc749e47a3cf4 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * 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/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledStringTests.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledStringTests.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..04a5ba3a1fbd51a3d844691d56036d7ca508425f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledStringTests.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 { 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' + + +export default function ComponentTextRicheditorSetStyledStringTests() { + + describe('ComponentTextRicheditorSetStyledStringTests', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledString_000111 + *des:1、调用addTextSpan添加一段文本, 设定装饰 + 线颜色不设定字体颜色,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledString_000111', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledString_000111 start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString001") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorSetStyledString001")); + await richeditor.click(); + await Utils.sleep(1000); + let top = await driver.findComponent(ON.id("image_top")); + await top.click(); + await Utils.sleep(1000); + let center = await driver.findComponent(ON.id("image_center")); + await center.click(); + await Utils.sleep(1000); + let bottom = await driver.findComponent(ON.id("image_bottom")); + await bottom.click(); + await Utils.sleep(1000); + let beside = await driver.findComponent(ON.id("image_baseline")); + await beside.click(); + await Utils.sleep(1000); + let addString = await driver.findComponent(ON.id("add_text")); + await addString.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledString_000111.`); + done(); + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000112 + *des:1、生成属性字符串,设定图片大小,使用百分比字符串 + 2、使用setStyledString接口,使富文本展示属性字符串 + 3、观察富文本组件内容显示效果,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000112', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000112 start.`); + + Settings.createWindow("testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString002") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorSetStyledString002")); + await richeditor.click(); + await Utils.sleep(1000); + let top = await driver.findComponent(ON.id("image_top")); + await top.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000112.`); + done(); + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000113 + *des:1、生成属性字符串,设定图片大小,使用百分比字符串 + 2、使用setStyledString接口,使富文本展示属性字符串 + 3、观察富文本组件内容显示效果,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000113', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000113 start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString003") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorSetStyledString003")); + await richeditor.click(); + await Utils.sleep(1000); + let top = await driver.findComponent(ON.id("image_top")); + await top.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000113.`); + done(); + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000114 + *des:1、生成属性字符串,设置图片外边距/内边距/圆角 + 2、使用setStyledString接口,使富文本展示属性字符串 + 3、观察富文本组件内容显示效果,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000114', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000114 start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString004") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorSetStyledString004")); + await richeditor.click(); + await Utils.sleep(1000); + let top = await driver.findComponent(ON.id("image_top")); + await top.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000114.`); + done(); + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000115 + *des:1、生成属性字符串,分别设定图片缩放方式为 + ImageFit.Contain、ImageFit.Cover、ImageFit.Auto + ImagePit.Fill、ImageFit.ScaleDown、ImageFit.None + 2、使用setStyledString接口,使富文本展示属性字符串 + 3、观察富文本组件内容显示效果,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000115', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000115 start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString005") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorSetStyledString005")); + await richeditor.click(); + await Utils.sleep(1000); + let top = await driver.findComponent(ON.id("image_top")); + await top.click(); + await Utils.sleep(1000); + let center = await driver.findComponent(ON.id("image_center")); + await center.click(); + await Utils.sleep(1000); + let bottom = await driver.findComponent(ON.id("image_bottom")); + await bottom.click(); + await Utils.sleep(1000); + let beside = await driver.findComponent(ON.id("image_baseline")); + await beside.click(); + await Utils.sleep(1000); + let down = await driver.findComponent(ON.id("image_down")); + await down.click(); + await Utils.sleep(1000); + let none = await driver.findComponent(ON.id("image_none")); + await none.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000115.`); + done(); + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000118 + *des:1、生成属性字符串 + 2、设置replaceStyle的key为image,length长度必须为1 + 3、点击替换后,观察富文本组件内容显示效果,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000118', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000118 start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString008") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorSetStyledString008")); + await richeditor.click(); + await Utils.sleep(1000); + let select = await driver.findComponent(ON.id("select")); + await select.click(); + await Utils.sleep(2000); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(100); + let top = await driver.findComponent(ON.id("image_top")); + await top.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000118.`); + done(); + }) + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000119 + *des:1、生成带一张图片或者多张图片的属性字符串 + 2、设置replaceString将图片或者图文混合内容替换为字符串 + (要考成文字在图片前还是图片后的不同情况:length要覆盖到 + 图片) + 3、点击替换后,观察富文本组件内容显示效果,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000119', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000119 start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString009") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorSetStyledString009")); + await richeditor.click(); + await Utils.sleep(1000); + let image = await driver.findComponent(ON.id("image")); + await image.click(); + await Utils.sleep(1000); + let select = await driver.findComponent(ON.id("select")); + await select.click(); + await Utils.sleep(1000); + let top = await driver.findComponent(ON.id("image_top")); + await top.click(); + await Utils.sleep(100); + await driver.triggerKey(KeyCode.KEYCODE_DEL); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_setStyledStrin_000119.`); + done(); + }) + }) +} 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..e0bbd4999b2ff37938dedd0bc8ef9061a77fa89e 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * 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..383d762182bdfdb4c26070b89b1dae6bb84d8b0f 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相关用例 @@ -41,6 +43,52 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /** * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0006 *des:1、调用addTextSpan添加一段文本, 设定装饰 @@ -227,5 +275,33 @@ export default function ComponentTextRicheditorUxConformanceTests() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0016.`); done(); }) + + /** + * NO.SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0009 + *des:1、从其他组件拖入一段文本到RiohEditor组件 + 2、调用getSpans获取span信息,验证效果 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0009', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0009 start.`); + Settings.createWindow("testability/pages/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformance0009") + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let richeditor = await driver.findComponent(ON.id("ComponentTextRicheditorUxConformance0009")); + let textArea = await driver.findComponent(ON.id('TextArea')); + await textArea.click(); + await Utils.sleep(1000); + await textArea.click(); + await Utils.sleep(1000); + let selectAll = await driver.findComponent(ON.text('全选')) + await selectAll?.click(); + await Utils.sleep(1000); + await textArea.dragTo(richeditor) + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_RICHEDITOR_UXCONFORMANCE_0009.`); + done(); + }) }) } 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..96bb293f83b05982a1be602724abc639f14f4900 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,52 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /** * 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..7f63c6617b393808a22abbe8466ea9cfa7ca8036 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,7 +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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_FUNCTION_JICHU_SR000HUB4K_0120 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..cc2eab4bd7ac8984352dda5631ce1dcc7a50e05c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_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..93a677d791d3d6328d5fdaba4b19665e7ae6c8ef 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 @@ -39,6 +39,20 @@ import ComponentTextRicheditorInterfaceTests from './ComponentTextRicheditorInterface/ComponentTextRicheditorInterfaceTests.test'; import ComponentTextRicheditorShortKcutKeysTests from './ComponentTextRicheditorShortKcutKeys/ComponentTextRicheditorShortKcutKeysTests.test'; +import ComponentTextRicheditorSetStyledStringTests + from './ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledStringTests.test'; +import ComponentRicheditorSupportColorTests + from './ComponentRichEditorSupportColorTest/ComponentRicheditorSupportColorTests.test'; +import ComponentRichEditorThreeStrikesTests + from './ComponentRichEditorThreeStrikesTest/ComponentRichEditorThreeStrikesTests.test'; +import ComponentRicheditorTransformtionTests + from './ComponentRichEditorTransformationTest/ComponentRicheditorTransformtionTests.test'; +import ComponentTextRichEditorCopyPasteAttributeStringsTest + from './ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStringsTests.test'; +import ComponentTextRichEditorStabilityTests + from './ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStabilityTests.test'; +import ComponentTextRichEditorHandleOptimizationTests + from './ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimizationTests.test'; import UIComponentNavTabsOnWillShow from './UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test'; import UIComponentNavTabsContentAdapt from './UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test'; @@ -150,6 +164,7 @@ import UIComponentPopupBoxToastStyleInterface001 import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; + export default function testsuite() { ComponentTextRicheditorFontfeatures(); ComponentTextRicheditorCustomColors(); @@ -164,6 +179,13 @@ export default function testsuite() { ComponentTextRicheditorOnWillChangeTests(); ComponentTextRicheditorInterfaceTests(); ComponentTextRicheditorShortKcutKeysTests(); + ComponentTextRicheditorSetStyledStringTests(); + ComponentRicheditorSupportColorTests(); + ComponentRichEditorThreeStrikesTests(); + ComponentRicheditorTransformtionTests(); + ComponentTextRichEditorCopyPasteAttributeStringsTest(); + ComponentTextRichEditorStabilityTests(); + ComponentTextRichEditorHandleOptimizationTests(); UIComponentNavTabsOnWillShow(); UIComponentNavTabsContentAdapt(); @@ -239,6 +261,4 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); -} - - +} \ No newline at end of file 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..06638eca0a899dcbb807933605d6cde62a6ddfc5 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 @@ -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' /* * TsComponentSR000HRP34 @@ -41,7 +43,51 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_TS_COMPONENT_SR000HRP34_124 * @tc.name SUB_ACE_TS_COMPONENT_SR000HRP34_124 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..9581893bce98ab579c14065d89f5baea8dab6808 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : SUB_ACE_UI_COMPONENT_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..98f4fed5357c14c451993e1906084501aea2f90b 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): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..0b0f5e920634196493555fc46e30203e1a355485 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): @@ -40,7 +42,51 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_RADIO_CUSTONMIZING_003 * @tc.name 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..5d26e124077e74efea7f2ce416805cf251de99a6 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..bbdd4184b13d058dcc83c205d353d9d112346e48 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..821df647d050b275d94c12899275a7cb19d974cb 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : SUB_ACE_UI_COMPONENT_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..f56f2d37ed6ebc5049fad1ce78498ade45235a01 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : SUB_ACE_UI_COMPONENT_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..cdc99c109c728b710954cabef06801bb217976e5 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_STYLE_0540 diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonTimepickerInterfaceTest/UIComponentButtonTimepickerInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonTimepickerInterfaceTest/UIComponentButtonTimepickerInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..74a4448a6ab91b72452c34b6073bf121de29dc34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonTimepickerInterfaceTest/UIComponentButtonTimepickerInterface.test.ets @@ -0,0 +1,418 @@ + +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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' + +/* + * SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010:设置文本颜色 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UIComponentButtonTimepickerInterface() { + + describe('UIComponentButtonTimepickerInterface', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0250 + * @tc.desc 在TimePicker组件中,验证通用属性margin默认值 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0250 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0250"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0370 + * @tc.desc 在TimePicker组件中,验证点击事件触发滑动 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0370"); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0220 + * @tc.desc 在TimePicker组件中,验证通用属性height子父组件设置正常 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0220 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0220"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0240 + * @tc.desc 在TimePicker组件中,验证通用属性margin为百分比 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0240 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0240"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0270 + * @tc.desc 在TimePicker组件中,验证通用属性padding为百分比 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0270"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0190 + * @tc.desc 在TimePicker组件中,验证通用属性constraintSize为minWidth大于maxWidth + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0190 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0190"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0310 + * @tc.desc 在TimePicker组件中,验证通用属性width子父组件设置正常 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0310 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0310") + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0180 + * @tc.desc 在TimePicker组件中,验证向组合拖拽功能 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0180"); + await Utils.sleep(1000); + const driver = Driver.create(); + const picker = await driver.findComponent(ON.type('TimePicker')); + const point = await picker.getBoundsCenter(); + await driver.swipe(point.x, point.y, point.x + 50, point.y - 70); + await driver.swipe(point.x, point.y-70, point.x, point.y + 70); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0300 + * @tc.desc 在TimePicker组件中,验证通用属性width子父组件设置异常 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0300 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0300"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0300 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0290"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0290 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0010"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0010 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0260 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0260"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0260 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0280 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0280"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0280 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0110"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0110 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0030"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0030 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text = await driver.findComponent(ON.text('7')); + let point = await text.getBoundsCenter(); + await driver.swipe(point.x, point.y, point.x, point.y + 300); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0150 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0200 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0200"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0200 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0020"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0020 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0230 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0230"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0230 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0130"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0130 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0210 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0210"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0210 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0360 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0360"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('UIComponentButtonTimepickerInterface0360_001')); + await Utils.sleep(100); + await button.click(); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0360 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text = await driver.findComponent(ON.text('9')); + let point = await text.getBoundsCenter(); + await driver.swipe(point.x, point.y, point.x, point.y - 200); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0140 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0160"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text = await driver.findComponent(ON.text('9')); + let point = await text.getBoundsCenter(); + await driver.swipe(point.x, point.y, point.x + 200, point.y); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0160 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerInterface/UIComponentButtonTimepickerInterface0170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text = await driver.findComponent(ON.text('9')); + let point = await text.getBoundsCenter(); + await driver.swipe(point.x, point.y, point.x - 200, point.y); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_INTERFACE_0170 finish.`); + done(); + }); + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonTimepickerNumericTest/UIComponentButtonTimepickerNumeric.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonTimepickerNumericTest/UIComponentButtonTimepickerNumeric.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..06fc68369f29a41dc77ca0e13de9046e922cff27 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentButtonTimepickerNumericTest/UIComponentButtonTimepickerNumeric.test.ets @@ -0,0 +1,2452 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, afterEach, it, beforeEach } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentButtonTimepickerNumeric() { + + describe('UIComponentButtonTimepickerNumeric', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch before CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + done(); + }) + + afterEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting after dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch after CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1430 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1430 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1430 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1430"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1430 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0210 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0210 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0210 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0210"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1330 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1330 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1330 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1330"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1590 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1590 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1590 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1590"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1590 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0770 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0770 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0770 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0770"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0770 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1300 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1300 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1300 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1300"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0570 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0570 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0570 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0570"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0570 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1570 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1570 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1570 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1570"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1570 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0250 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0250 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0250 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0250"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1320 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1320 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1320 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1320"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1530 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1530 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1530 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1530"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1530 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0750 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0750 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0750 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0750"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0750 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1250 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1250 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1250 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1250"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0540 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0540 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0540 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0540"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0540 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1510 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1510 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1510 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1510"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1510 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0220 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0220 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0220 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0220"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1280 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1280 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1280 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1280"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1480 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1480 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1480 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1480"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1480 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0700 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0700 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0700 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0700"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0700 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1220 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1220 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1220 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1220"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0550 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0550 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0550 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0550"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0550 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0610 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0610 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0610 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0610"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0610 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0280 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0280 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0280 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0280"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1390 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1390 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1390 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1390"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1390 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1520 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1520 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1520 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1520"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1520 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0790 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0790 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1520 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0790"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0790 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1310 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1310 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1310 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1310"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1490 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1490 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1490 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1490"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1490 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0560 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0560 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0560 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0560"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0560 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0740 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0740 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0740 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0740"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0740 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1230 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1230 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1230 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1230"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1580 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1580 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1580 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1580"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1580 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0530 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0530 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0530 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0530"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0530 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1410 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1410 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1410 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1410"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1410 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0780 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0780 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0780', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0780 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0780"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0780 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0260 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0260 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0260 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0260"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1270 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1270 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1270 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1270"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1350 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1350 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1350 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1350"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1350 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0600 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0600 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0600 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0600"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0600 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1420 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1420 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1420 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1420"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1420 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0240 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0240 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0240 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0240"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1380 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1380 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1380 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1380"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1380 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1500 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1500 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1500 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1500"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1500 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1630 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1630 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1630 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1630"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1630 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1460 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1460 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1460 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1460"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1460 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0590 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0590 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0590 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0590"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0590 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0720 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0720 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0720 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0720"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0720 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1260 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1260 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1260 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1260"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0580 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0580 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0580 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0580"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0580 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1440 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1440 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1440 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1440"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1440 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0230 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0230 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0230 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0230"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1340 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1340 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1340 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1340"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1340 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1560 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1560 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1560 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1560"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1560 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0310 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0310 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0310 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0310"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1400 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1400 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1400 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1400"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1400 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1540 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1540 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1540 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1540"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1540 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0290 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0290 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0290 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0290"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1790 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1790 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1790 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1790"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1790 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1550 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1550 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1550 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1550"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1550 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0270 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0270 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0270 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0270"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1100 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1100 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1100 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1100"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1360 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1360 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1360 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1360"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0330 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0330 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0330 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0330"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1370 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1370 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1370 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1370"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1050 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1050 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1050 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1050"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0300 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0300 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0300 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0300"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0850 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0850 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0850', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0850 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0850"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0850 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1090 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1090 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1090 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1090"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0380 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0380 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0380 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0380"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0380 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1800 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1800 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1800 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1800"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1800 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1060 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1060 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1060 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1060"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0320 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0320 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0320 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0320"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0840 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0840 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0840', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0840 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0840"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0840 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0840 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0840 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0980 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0980"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0980 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1010 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1010 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1010 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1010"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1010 finish.`); + done(); + }) + /* @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0020 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0020 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0020 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0020"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0340 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0340 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0340 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0340"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0340 finish.`); + done(); + }) + /* @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1160 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1160 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1160 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1160"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0860 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0860 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0860', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0860 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0860"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0860 finish.`); + done(); + }) + /* @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1680 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1680 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1680 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1680"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1680 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1030 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1030 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1030 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1030"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1030 finish.`); + done(); + }) + /* @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0970 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0970 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0970', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0970 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0970"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0970 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0350 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0350 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0350 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0350"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0350 finish.`); + done(); + }) + /* @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0110 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0110 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0110 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0110"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1020 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1020 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1020 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1020"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1020 finish.`); + done(); + }) + /* @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1170 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1170 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1170 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1170"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1780 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1780 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1780', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1780 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1780"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1780 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0400 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0400 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0400 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0400"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0400 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0870 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0870 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0870', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0870 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0870"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0870 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1070 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1070 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1070 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1070"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0370 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0370 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0370 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0370"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0880 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0880 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0880', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0880 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0880"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0880 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1120 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1120 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1120 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1120"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1650 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1650 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1650 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1650"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1650 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0960 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0960 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0960 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0960"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0960 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1180 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1180 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1180 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1180"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0390 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0390 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0390 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0390"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0390 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0890 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0890 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0890 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0890"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0890 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0090 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0090 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0090 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0090"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1140 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1140 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1140 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1140"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0360 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0360 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0360 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0360"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0930 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0930 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0930 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0930"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0930 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0080 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0080 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0080 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0080"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1200 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1200 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1200 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1200"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1660 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1660 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1660 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1660"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1660 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0950 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0950 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0950 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0950"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0950 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0050 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0050 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0050 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0050"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1040 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1040 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1040 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1040"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1640 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1640 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1640 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1640"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1640 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1690 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1690 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1690 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1690"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1690 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0910 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0910 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0910', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0910 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0910"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0910 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0120 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0120 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0120 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0120"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1080 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1080 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1080 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1080"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0800 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0800 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0800 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0800"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0800 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1000 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1000 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1000 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1000"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1000 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0060 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0060 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0060 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0060"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1150 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1150 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1150 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1150"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1610 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1610 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1610 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1610"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1610 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0900 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0900 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0900 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0900"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0900 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0100 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0100 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0100 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0100"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1130 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1130 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1130 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1130"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1670 + * @tc.name SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1670 + * @tc.desc Observe the hour/minute/second time display + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1670 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1670"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1670 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0920 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0920"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0920 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0180 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0180"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0180 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1190 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1190"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1190 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1730 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1730"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1730 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0940 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0940"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0940 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0170 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0170"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0170 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1110 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1110"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1110 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1740 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1740"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1740 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0990', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0990 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0990"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0990 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0070 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0070"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0070 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1600 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1600"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1600 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1760 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1760"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1760 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0410 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0410"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0410 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0140 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0140"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0140 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0630 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0630"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0630 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1710 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1710"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1710 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0420 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0420"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0420 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0620 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0620"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0620 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1720 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1720"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1720 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0430 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0430"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0430 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0010 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0010"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0010 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0650 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0650"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0650 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1750 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1750"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1750 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0440 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0440"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0440 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0040 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0040"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0040 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0710 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0710"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0710 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1620 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1620"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1620 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0450 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0450"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0450 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0130 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0130"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0130 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0670 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0670"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0670 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0820 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0820"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0820 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0460 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0460"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0460 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0160 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0160"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0160 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0640 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0640"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0640 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1700 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1700"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1700 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0470 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0470"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0470 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0200 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0200"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0200 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0690 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0690"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0690 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0830', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0830 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0830"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0830 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0480 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0480"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0480 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0190 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0190"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0190 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0680 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0680"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0680 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0810 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0810"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0810 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0490 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0490"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0490 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0150 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0150"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0150 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0660 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0660"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0660 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1770 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1770"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1770 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0510 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0510"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0510 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1470 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1470"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1470 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0760 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0760"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0760 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1210 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1210"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1210 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0500 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0500"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0500 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1450 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1450"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1450 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0730 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0730"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0730 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1240 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric1240"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_1240 finish.`); + done(); + }); + + it('SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0520 start.`); + Settings.createWindow("testability/pages/UIComponentButtonTimepickerNumeric/UIComponentButtonTimepickerNumeric0520"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TIMEPICKER_NUMERIC_0520 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..d3a04924559e820e24b7fec7919fcb8325637030 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 @@ -21,6 +21,7 @@ import Utils from '../model/Utils' import { Component, Driver ,ON } from '@ohos.UiTest' import { uiAppearance } from '@kit.ArkUI' import { BusinessError } from '@kit.BasicServicesKit' +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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : ARKUI_COMPONENTFUNCTION_SELECT_SYMBOL_0010 * @tc.name : ARKUI_COMPONENTFUNCTION_SELECT_SYMBOL_0010 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..b55ca54e6853767d889ae172b4f8b00b0f79adc8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_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..6aa0508b56245afefe1078a949a9e02997dc4956 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 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..4f55ddc60e579eccd9a3fb3737efceff064709d6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -18,10 +18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 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..b5e4fd85e47fa29c2bdf23b0c22c8005b70abae0 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 * @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..ff63edf7501b78cbbd4c0de9891ec1f4f3af8a76 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_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..59f1e8f43727ddc151ebffcc0cf8986ef8562172 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 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..886d1eae273987f4236ea1d2b1a49d3ec4e64dd5 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_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..a1da751d150487ca6eaba2c5cab4a86cf2d00ba0 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 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..20bb61cc6e943526343d6e45abc24142b0122255 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,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 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..89f07b55aa740dc846c444f141e7a8815affaf5e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 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..79ba2347b68e297a0a44bcba84a5e0d1b8a91dfb 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 * @tc.name 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..6f3ad8f3a5543c9562a8d0f04fe22fd89644f3be 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_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..bab1b3011282cefb8b1949a1475a8a06036896da 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 * @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..fe620d281f0cc2bcb776fdfb27331cd512e8d76b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 * @tc.name 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..61f47708eb70873af6e4c25e81861dfe2f5ad5d9 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 * @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..f3d112ef52438e45a85806d4c62ca82f55789765 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 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..db73f3766f5c1606f7f404d68fd3edf0f5ed41fa 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 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..e8082ca887fc72b1dec68c1e46c208cc58d7844c 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..159c304550bdbba818d5979f5a1124e1db7286a2 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets index 5243db1f0b868ca6b54197d73bfb65d499e168e5..a26d1de13e002ecc57d362905571504f437e5bb5 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets @@ -18,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets index f1c73b54f9e9d514fe6d425f5bc1449316efd3d7..b2d1ce86d8062839471054b95ec0d8d2a3dd8cef 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxAttributeTest/UIComponentPopupBoxAttribute.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxAttributeTest/UIComponentPopupBoxAttribute.test.ets index 6a9868b22c0ccbf3c0ab3d0e84df9218e05bf226..a7a7fa7eec774aed6270ac52a089fd095bb30fe7 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..0637a4a051befd27bf1792b7c7718d1a3c0a4ecd 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..5b6985cc0d8e85b927193d3d0fe3f942e145ade8 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_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..b7ca3754b5e4ebd477c65b02254d84c1a26eb5ef 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_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..85ac98e99e19bce2bede45a317ad0a3caf3b7b51 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): @@ -38,7 +40,51 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_POPUP_0010 * @tc.name 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..0f2087c35a4fce1b34e6bcfdebc8039e1cefdaaa 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..77ddc2ee59b6b688a99bc8404dcc8649674ec473 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): @@ -37,7 +39,51 @@ import { Driver, ON } from '@ohos.UiTest' 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..d7189ce38878b11ab7363d69e72de1ef917af327 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 @@ -20,6 +20,7 @@ import Logger from '../model/Logger' import Utils from '../model/Utils' import { Component, Driver, MouseButton, ON } from '@ohos.UiTest' import uiAppearance from '@ohos.uiAppearance' +import { i18n } from '@kit.LocalizationKit' /* * @@ -39,7 +40,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_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..5bc365c2d5eef9b3d2f70330cb574ed13eacff9d 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..45a66e54f152e1e48c8d0a2637da5df525bd4565 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 @@ -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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..7e9f568633c198de4552ec0117f50594ab043a2a 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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/UIComponentScrollSwiperAcrossTest/UIComponentScrollSwiperAcross.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollSwiperAcrossTest/UIComponentScrollSwiperAcross.test.ets index 77c7949e6e7fe062286012c99cf86d77ba3f1087..23f6bad332f37a9bf5cbdcec5754402802672d17 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 @@ -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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_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..bd43715d8494c49b88874ec956cd4a0b9527aab2 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 @@ -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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_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..b3417342e96d718a009f26689fdd378077989872 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 @@ -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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_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..251f3b81a0add043e81e45b9c9c81334c275eb32 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 @@ -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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_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..93947f9d88936d3cc6a4bfee20e649b7996b0575 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 @@ -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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_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..457045d5cf923794a0d3b0a3ff7f92525ad56e04 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 @@ -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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_TEACE_0070 */ 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..70d3ba48ee360c45ff533b5f7ad8b24661ccb784 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 @@ -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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_UX_0520 */ 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..b7ac9e6e3ed6664edab3262c488f06118986fc8f 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..f377e0164fa20829c6be27aee89b4572f26f0ccc 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_UIEXTENSIONCOMPONENT_POPUPCHANGE_0050 * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_UIEXTENSIONCOMPONENT_POPUPCHANGE_0050 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..e5481826580e8d04801c7827db2ebde7da17ca51 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets @@ -18,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 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 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..ee9a2ff7c837a281f53387d955cf1b6152f10467 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets @@ -13,13 +13,14 @@ * limitations under the License. */ -import { describe, afterEach, it } from '@ohos/hypium'; +import { describe, afterEach, it, beforeEach } from '@ohos/hypium'; import Settings from '../model/Settings'; import windowSnap from '../model/snapShot'; import Logger from '../model/Logger'; import Utils from '../model/Utils'; import uiAppearance from '@ohos.uiAppearance'; import { Driver ,ON } from '@ohos.UiTest' +import { i18n } from '@kit.LocalizationKit'; /* * UIComponentUISupportColor @@ -41,7 +42,51 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1010 * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_1010 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..d69f4973896f0759e5b03f5165cd1b0f3112ef39 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): @@ -39,7 +41,51 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number TestCase_6eb28b4e7e20410ea8a92fc7bb5809fc_1 * @tc.name TestCase_6eb28b4e7e20410ea8a92fc7bb5809fc_1 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..858bed7daefd45fe2c5676245295fadb839aef13 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : SUB_ACE_UI_COMPONENT_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..481f804cdcc9e430d6daa080c6c57053085f9ba2 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number : SUB_ACE_UI_COMPONENT_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..b6ee0a12d48c4283e15d4f845c0772cea5ab5454 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 @@ -41,7 +43,51 @@ 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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_DATEPICKERDIALOG_INTERFACE_0010 * @tc.name 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..60f71de8495c76ff18227624e446b945e7b846cc 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 @@ -22,6 +22,7 @@ import { Driver, ON } from '@kit.TestKit' import { KeyCode } from '@kit.InputKit' import { uiAppearance } from '@kit.ArkUI' import Window from '@ohos.window' +import { i18n } from '@kit.LocalizationKit' /* * UiComponentPopupboxDatePickerDialogScenarios @@ -42,7 +43,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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_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..0e20856005a43dc3e2102a38de978ac4e1935206 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,7 +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 (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting after Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting after Set dark-mode 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}`); + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) /* * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_ZERO_0010 * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_ZERO_0010 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..d4cc86968f929a56b421de1d3625eef083e90c6a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets @@ -36,16 +36,17 @@ async function sleep(time: number): Promise { } class Settings { - isPhone: boolean = true; + isPhone: boolean = false; windowClass: window.Window | undefined = undefined windowCreateType: string = "changeWindow"; private static DEFAULT_WIDTH: number = 720; - private static DEFAULT_HEIGHT: number = 1280; + private static DEFAULT_HEIGHT: number = 1412; private static DEFAULT_DPI: number = 240; - private static DEFAULT_OFFSET_X: number = 0; - private static DEFAULT_OFFSET_Y: number = 60; + private static DEFAULT_OFFSET_X: number = 100; + private static DEFAULT_OFFSET_Y: number = 132; private portrait: boolean = true + changeWindowPosition(windowClass: window.Window, X: number | undefined, Y: number | undefined) { //为悬浮窗设置位置 windowClass.moveWindowTo(X, Y, (err) => { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..71fa1bad58c5304e07620ed741fef51c6ffe557d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001.ets @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct RichEditorSupportColor001 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + Column() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("abc123456789", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + + .borderWidth(1) + .borderColor(Color.Green) + .width("100%") + .height("30%") + .id('RichEditorSupportColor001') + } + .borderWidth(1) + .borderColor(Color.Red) + .width("100%") + .height("70%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor002.ets new file mode 100644 index 0000000000000000000000000000000000000000..7aef15c5883dcc0424fc9ede914b5c26aa305cd5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor002.ets @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct RichEditorSupportColor002 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + WithTheme({ colorMode: ThemeColorMode.LIGHT }) { + Column() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("abc12345", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + + .borderWidth(1) + .borderColor(Color.Green) + .width("100%") + .height("30%") + .id('RichEditorSupportColor002') + } + .borderWidth(1) + .borderColor(Color.Red) + .width("100%") + .height("70%") + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor003.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e85a007dc217dfd3cfb2aabc501093fb3b8f66b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor003.ets @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct RichEditorSupportColor003 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + WithTheme({ colorMode: ThemeColorMode.DARK }) { + Column() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("abc1234567", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + + .borderWidth(1) + .borderColor(Color.Green) + .width("100%") + .height("30%") + .id('RichEditorSupportColor003') + } + .borderWidth(1) + .borderColor(Color.Red) + .width("100%") + .height("70%") + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004.ets new file mode 100644 index 0000000000000000000000000000000000000000..b5c095ac3413a572e4024d14003af9cce9984dbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004.ets @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct RichEditorSupportColor004 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Column() { + Column() { + Button('select') + .id('select') + .width(100) + .height(60) + .onClick(()=>{ + this.controller.setSelection(2,4); + }); + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("abc123456111", + { + style: + { + fontColor: Color.Orange, + fontSize: 30 + } + }) + }) + + .borderWidth(1) + .borderColor(Color.Green) + .width("100%") + .height("30%") + .id('RichEditorSupportColor004') + } + .borderWidth(1) + .borderColor(Color.Red) + .width("100%") + .height("70%") + }.backgroundColor($r('sys.color.background_primary')) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorThreeStrikes/ComponentRichEditorThreeStrikes001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorThreeStrikes/ComponentRichEditorThreeStrikes001.ets new file mode 100644 index 0000000000000000000000000000000000000000..26c3f75b6f52f2d102ad05b2d70c27fa2bfc66bf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentRichEditorThreeStrikes/ComponentRichEditorThreeStrikes001.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct ComponentRichEditorThreeStrikes001 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State isEditing: boolean = false; + @State enableDataDetector: boolean = true; + @State enablePreviewText: boolean = false; + @State types: TextDataDetectorType[] = []; + @State phoneNumber: string = '(86) (755) ********'; + @State url: string = 'www.********.com'; + @State email: string = '***@example.com'; + @State address: string = 'XX省XX市XX区XXXX'; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + Row() { + Column() { + Text("isEditing:" + this.isEditing).id('isEditing').borderColor(Color.Green); + TextArea({text:"123456TextArea"}).draggable(true).width(100).height(50).id('TextArea'); + RichEditor(this.options) + .id('ComponentRichEditorThreeStrikes001') + .borderColor(Color.Orange) + .onReady(() => { + this.controller.addTextSpan('电话号码:' + this.phoneNumber + '\n', + { + style: + { + fontSize: 30 + } + }) + this.controller.addTextSpan('链接:' + this.url + '\n', + { + style: + { + fontSize: 30 + } + }) + this.controller.addTextSpan('邮箱:' + this.email + '\n', + { + style: + { + fontSize: 30 + } + }) + this.controller.addTextSpan('地址:' + this.address, + { + style: + { + fontSize: 30 + } + }) + }) + .copyOptions(CopyOptions.InApp) + .enableDataDetector(this.enableDataDetector) + .dataDetectorConfig({types : this.types, onDetectResultUpdate: (result: string)=>{}}) + .draggable(true) + .borderWidth(1) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0044.ets new file mode 100644 index 0000000000000000000000000000000000000000..bdbb5b88904b4c6c3cbb667e00a5afe57fc51153 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0044.ets @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorCopyPasteAttributeStrings0044 { + html = "\n" + "\n" + "\n" + "\n" + + "HTML-PASTEBOARD_HTML\n" + "\n" + "\n" + "

HEAD

\n" + "

\n" + + "\n" + ""; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + Column() { + Button('停止') + .height(40) + .onClick(() => { + this.controller.stopEditing() + }) + .id('stop') + + TextInput({ text: this.html }) + .width('95%') + .height('20%') + .margin(20) + .fontSize(12) + .focusable(true) + .copyOption(CopyOptions.InApp) + .fontColor(Color.Black) + .id('textInput01') + + RichEditor(this.options) + .onPaste((event?: PasteEvent) => { + this.controller.addTextSpan('', + { + style: + { + fontColor: Color.Orange, + fontSize: 12, + textShadow: { + radius: 10, + color: Color.Blue, + offsetX: 10, + offsetY: 0 + } + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .height('35%') + .id('RichEditorCopyPaste001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0045.ets new file mode 100644 index 0000000000000000000000000000000000000000..b580c15dc54d1e4e6623d62a6d1d73f6c297afe3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0045.ets @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorCopyPasteAttributeStrings0045 { + html = ` + + + + + 图片样式示例 + + + +

图片样式示例

+ 示例图片 + +`; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + build() { + Column() { + Button("停止") + .height(40) + .onClick(()=>{ + this.controller.stopEditing() + }) + .id('stop1') + + TextInput({ text: this.html }) + .width('95%') + .height('10%') + .margin(20) + .fontSize(12) + .copyOption(CopyOptions.InApp) + .fontColor(Color.Black) + .id('textInput02') + + RichEditor(this.options) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .height('70%') + .id('RichEditorCopyPaste002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0005.ets new file mode 100644 index 0000000000000000000000000000000000000000..63e5d3c1208d030b05f13d63340a8b381bcbd5f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0005.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { window } from '@kit.ArkUI'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorHandleOptimization0005 { + windowClass: window.Window | undefined = undefined; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + Stack() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan('HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。', + { + style: + { + fontColor: Color.Orange, + fontSize: 16, + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .id('RichEditorHandleOptimization001') + + Text("Float Window") + .textAlign(TextAlign.Center) + .width(150) + .height(150) + .backgroundColor("#ffb9f4e5") + .fontSize(16) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0007.ets new file mode 100644 index 0000000000000000000000000000000000000000..3908c24a1646fd2d26720fb95543e3301a81237a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0007.ets @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { window } from '@kit.ArkUI'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorHandleOptimization0007 { + windowClass: window.Window | undefined = undefined; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + build() { + Stack() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan('HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。'+ + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。'+ + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。', + { + style: + { + fontColor: Color.Orange, + fontSize: 16, + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .id('RichEditorHandleOptimization002') + + Text("Float Window") + .textAlign(TextAlign.Center) + .width(150) + .height(150) + .backgroundColor("#ffb9f4e5") + .fontSize(16) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0008.ets new file mode 100644 index 0000000000000000000000000000000000000000..3f0b02520e30936158104f29754dc95cfb34bfde --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0008.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { window } from '@kit.ArkUI'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorHandleOptimization0008 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + windowClass: window.Window | undefined = undefined; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + build() { + Column() { + Stack() { + RichEditor(this.options) + .onReady(() => { + this.controller.addImageSpan(("cat.jpg"), + { + imageStyle: + { + size: ["1000px", "350px"], + layoutStyle: { + margin: 5, + borderRadius: 15 + } + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('1000px') + .height("350px") + .id('RichEditorHandleOptimization003') + + Text("Float Window") + .textAlign(TextAlign.Center) + .width(100) + .height(100) + .backgroundColor("#ffb9f4e5") + .fontSize(16) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0008.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4ba81bcdbd7e576d141d0053a81bb4512e045d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0008.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorStability0008 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + build() { + Column() { + RichEditor(this.options) + .onReady(()=>{ + this.controller.addTextSpan('HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。', + { + style: + { + fontColor: Color.Orange, + fontSize: 16, + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .id('RichEditorStability001') + + Button('停止') + .height(40) + .onClick(() => { + this.controller.stopEditing() + }) + .id('StabilityStop1') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0009.ets new file mode 100644 index 0000000000000000000000000000000000000000..b02c225c34973c49af3d499b6d2fbe2fef5d88dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0009.ets @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorStability0009 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + text='HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + + build() { + Column() { + Button('停止') + .height(40) + .onClick(() => { + this.controller.stopEditing() + }) + .id('StabilityStop2') + + RichEditor(this.options) + .onReady(()=>{ + this.controller.addTextSpan(this.text, + { + style: + { + fontColor: Color.Orange, + fontSize: 18, + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .height('90%') + .id('RichEditorStability002') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d6480e322b954b5804feac79c07bfc9d938bc9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0010.ets @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorStability0010 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + text='多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + '多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 应用新体验,与你共同构建一个和谐的数字世界。' + + build() { + Column() { + Button('停止') + .height(40) + .onClick(() => { + this.controller.stopEditing() + }) + .id('StabilityStop3') + + RichEditor(this.options) + .onReady(()=>{ + this.controller.addTextSpan(this.text, + { + style: + { + fontColor: Color.Orange, + fontSize: 18 + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .height('80%') + .id('RichEditorStability003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0011.ets new file mode 100644 index 0000000000000000000000000000000000000000..02dac7fe35eea8f76dc3a76a4cdc27689ae3a251 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0011.ets @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorStability0011 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + text='HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + build() { + Column() { + Button('停止') + .height(40) + .onClick(() => { + this.controller.stopEditing() + }) + .id('StabilityStop4') + + RichEditor(this.options) + .onReady(()=>{ + this.controller.addTextSpan(this.text, + { + style: + { + fontColor: Color.Orange, + fontSize: 18 + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .height('80%') + .id('RichEditorStability004') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0013.ets new file mode 100644 index 0000000000000000000000000000000000000000..6653812b1db50020336d2fbefb5283784161db6a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0013.ets @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRichEditorStability0013 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + text='HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + 'HarmonyOS NEXT 多设备设计指南与重点特性规范,为你提供面向垂类场景、全端侧的针对性设计建议。 并有简单易用的控件助力你打造高端精致的 HarmonyOS NEXT 应用新体验,与你共同构建一个和谐的数字世界。' + + build() { + Column() { + Button('停止') + .height(40) + .onClick(() => { + this.controller.stopEditing() + }) + .id('StabilityStop5') + + RichEditor(this.options) + .onReady(()=>{ + this.controller.addTextSpan(this.text, + { + style: + { + fontColor: Color.Orange, + fontSize: 18 + } + }) + }) + .borderWidth(1) + .borderColor(Color.Green) + .width('100%') + .height('80%') + .id('RichEditorStability005') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0015.ets new file mode 100644 index 0000000000000000000000000000000000000000..81664e2e2b8b16b34aabaa30065fa2314e469825 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0015.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct ComponentTextRicheditorLineHeightLetterSpacing0015 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + Row() { + Column() { + TextArea({text:"我是TextArea"}).draggable(true).width(500).height(100).id('TextArea').lineHeight(-10).letterSpacing(-10); + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan('abcde', { + style: { + lineHeight:100, + letterSpacing:100 + } + }); + }) + .width('100%') + .id('ComponentTextRicheditorLineHeightLetterSpacing0015') + .draggable(true) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0016.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec31e1b69372a2b77277cddc55dfcfc8ca32ea03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0016.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct ComponentTextRicheditorLineHeightLetterSpacing0016 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + Row() { + Column() { + TextArea({text:"我是TextArea"}).draggable(true).width(100).height(50).id('TextArea').lineHeight(0b1010).letterSpacing(0b1010); + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan('abcde', { + style: { + lineHeight:0b1010, + letterSpacing:0b1010 + } + }); + }) + .id('ComponentTextRicheditorLineHeightLetterSpacing0016') + .draggable(true) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0002.ets index ae2cce959b8727731fbc3af9ae311e3cabf2d5be..8d01fb5a88c650dfdcae5efb01b6a1c088eb4e44 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0002.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0002.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { pasteboard } from '@kit.BasicServicesKit'; @Entry @@ -23,6 +24,15 @@ struct ComponentTextRicheditorOnWillChange0002 { @State rangeBefore: string = ''; @State rangeAfter: string = ''; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + build() { Row() { Column() { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0025.ets new file mode 100644 index 0000000000000000000000000000000000000000..e927ccbd4f700368f141253963bf78fef3fab721 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0025.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct ComponentTextRicheditorOnWillChange0025 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State replacedSpansValue: string = ''; + @State rangeBefore: string = ''; + @State rangeAfter: string = ''; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + Row() { + Column() { + Button('select') + .id('select') + .width(100) + .height(60) + .onClick(()=>{ + this.controller.setSelection(2,4); + }); + Text('replacedSpans value====' + this.replacedSpansValue).borderColor(Color.Red); + Text('rangeBefore value=====' + this.rangeBefore + 'rangeAfter value=====' + this.rangeAfter) + .borderColor(Color.Green); + RichEditor(this.options) + .id('ComponentTextRicheditorOnWillChange0025') + .borderColor(Color.Orange) + .onReady(() => { + this.controller.addTextSpan('111', { + style: { + fontStyle: FontStyle.Normal, + fontColor: Color.Black, + fontSize: 15, + } + }); + this.controller.addImageSpan(("cat.jpg"), + { + imageStyle: + { + size: ["57px", "57px"], + verticalAlign: ImageSpanAlignment.BASELINE + } + }); + }) + .borderWidth(1) + .draggable(true) + .onWillChange((value: RichEditorChangeValue) => { + this.replacedSpansValue = JSON.stringify(value.replacedSpans); + return true; + }) + .onDidChange((rangeBefore: TextRange, rangeAfter: TextRange) => { + this.rangeAfter = JSON.stringify(rangeAfter); + this.rangeBefore = JSON.stringify(rangeBefore); + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0026.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b469c49e57a1ee497fbeb767e064a82e53ff614 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0026.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct ComponentTextRicheditorOnWillChange0026 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State replacedSpansValue: string = ''; + @State rangeBefore: string = ''; + @State rangeAfter: string = ''; + + build() { + Row() { + Column() { + Text('replacedSpans value====' + this.replacedSpansValue).borderColor(Color.Red); + Text('rangeBefore value=====' + this.rangeBefore + 'rangeAfter value=====' + this.rangeAfter) + .borderColor(Color.Green); + TextArea({text:"我是TextArea"}).draggable(true).width(100).height(50).id('TextArea'); + RichEditor(this.options) + .id('ComponentTextRicheditorOnWillChange0026') + .borderColor(Color.Orange) + .onReady(() => { + this.controller.addTextSpan('111', { + style: { + fontStyle: FontStyle.Normal, + fontColor: Color.Black, + fontSize: 15, + } + }) + }) + .draggable(true) + .borderWidth(1) + .onWillChange((value: RichEditorChangeValue) => { + this.replacedSpansValue = JSON.stringify(value.replacedSpans); + return true; + }) + .onDidChange((rangeBefore: TextRange, rangeAfter: TextRange) => { + this.rangeAfter = JSON.stringify(rangeAfter); + this.rangeBefore = JSON.stringify(rangeBefore); + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString001.ets new file mode 100644 index 0000000000000000000000000000000000000000..b8212bc61b4d2f3b125cfbf7990f4570d022cc1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString001.ets @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LengthMetrics } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRicheditorSetStyledString001 { + stringLength: number = 0; + imagePixelMap: image.PixelMap | undefined = undefined; + @State selection: string = ""; + @State content: string = ""; + @State range: string = ""; + @State replaceString: string = ""; + @State rangeBefore: string = ""; + @State rangeAfter: string = ""; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + richEditorStyledString: MutableStyledString = new MutableStyledString(""); + textStyle: TextStyle = new TextStyle({ + fontWeight: FontWeight.Lighter, + fontFamily: 'HarmonyOS Sans', + fontColor: Color.Green, + fontSize: LengthMetrics.vp(30), + fontStyle: FontStyle.Normal + }) + fontStyle1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + fontStyle2: TextStyle = new TextStyle({ + fontWeight: FontWeight.Bolder, + fontFamily: 'Arial', + fontColor: Color.Orange, + fontSize: LengthMetrics.vp(50), + fontStyle: FontStyle.Italic + }) + // 创建属性字符串对象 + mutableStyledString: MutableStyledString = new MutableStyledString("init属性", + [{ start: 0, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle1 }]); + styledString: StyledString = new StyledString("属性字符串", + [{ start: 2, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle2 }]); + controller: RichEditorStyledStringController = new RichEditorStyledStringController(); + options: RichEditorStyledStringOptions = {controller: this.controller}; + + async aboutToAppear() { + console.info("aboutToAppear initial imagePixelMap"); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + + build() { + Column() { + Button("image Top").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.TOP, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_top') + Button("image Center").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.CENTER, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_center') + Button("image Bottom").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BOTTOM, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_bottom') + + Button("image Baseline").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BASELINE, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_baseline') + RichEditor(this.options) + .onReady(() => { + }) + .height("20%") + .width("100%") + .borderWidth(1) + .borderColor(Color.Black).id('ComponentTextRicheditorSetStyledString001') + + Column() { + Row() { + Button("add text").onClick(() => { + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(this.styledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + }).id('add_text') + } + + } + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString002.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f267a934e353c0b92d1d9f089503e8a4ff1d758 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString002.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LengthMetrics } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRicheditorSetStyledString002 { + stringLength: number = 0; + imagePixelMap: image.PixelMap | undefined = undefined; + @State selection: string = ""; + @State content: string = ""; + @State range: string = ""; + @State replaceString: string = ""; + @State rangeBefore: string = ""; + @State rangeAfter: string = ""; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + richEditorStyledString: MutableStyledString = new MutableStyledString(""); + textStyle: TextStyle = new TextStyle({ + fontWeight: FontWeight.Lighter, + fontFamily: 'HarmonyOS Sans', + fontColor: Color.Green, + fontSize: LengthMetrics.vp(30), + fontStyle: FontStyle.Normal + }) + fontStyle1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + fontStyle2: TextStyle = new TextStyle({ + fontWeight: FontWeight.Bolder, + fontFamily: 'Arial', + fontColor: Color.Orange, + fontSize: LengthMetrics.vp(50), + fontStyle: FontStyle.Italic + }) + // 创建属性字符串对象 + mutableStyledString: MutableStyledString = new MutableStyledString("init属性", + [{ start: 0, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle1 }]); + styledString: StyledString = new StyledString("属性字符串", + [{ start: 2, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle2 }]); + controller: RichEditorStyledStringController = new RichEditorStyledStringController(); + options: RichEditorStyledStringOptions = {controller: this.controller}; + + async aboutToAppear() { + console.info("aboutToAppear initial imagePixelMap"); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + + build() { + Column() { + Button("百分比").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.TOP, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_top') + RichEditor(this.options) + .onReady(() => { + }) + .height("20%") + .width("100%") + .borderWidth(1) + .borderColor(Color.Black).id('ComponentTextRicheditorSetStyledString002') + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString003.ets new file mode 100644 index 0000000000000000000000000000000000000000..74eeaa81c22c25b4dc3aed1d6a0e075bdc499f97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString003.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LengthMetrics } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRicheditorSetStyledString003 { + stringLength: number = 0; + imagePixelMap: image.PixelMap | undefined = undefined; + @State selection: string = ""; + @State content: string = ""; + @State range: string = ""; + @State replaceString: string = ""; + @State rangeBefore: string = ""; + @State rangeAfter: string = ""; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + richEditorStyledString: MutableStyledString = new MutableStyledString(""); + textStyle: TextStyle = new TextStyle({ + fontWeight: FontWeight.Lighter, + fontFamily: 'HarmonyOS Sans', + fontColor: Color.Green, + fontSize: LengthMetrics.vp(30), + fontStyle: FontStyle.Normal + }) + fontStyle1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + fontStyle2: TextStyle = new TextStyle({ + fontWeight: FontWeight.Bolder, + fontFamily: 'Arial', + fontColor: Color.Orange, + fontSize: LengthMetrics.vp(50), + fontStyle: FontStyle.Italic + }) + // 创建属性字符串对象 + mutableStyledString: MutableStyledString = new MutableStyledString("init属性", + [{ start: 0, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle1 }]); + styledString: StyledString = new StyledString("属性字符串", + [{ start: 2, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle2 }]); + controller: RichEditorStyledStringController = new RichEditorStyledStringController(); + options: RichEditorStyledStringOptions = {controller: this.controller}; + + async aboutToAppear() { + console.info("aboutToAppear initial imagePixelMap"); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + + build() { + Column() { + Button("设定图片大小").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: '57px', height: '57px' }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.TOP, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_top') + RichEditor(this.options) + .onReady(() => { + }) + .height("20%") + .width("100%") + .borderWidth(1) + .borderColor(Color.Black).id('ComponentTextRicheditorSetStyledString003') + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString004.ets new file mode 100644 index 0000000000000000000000000000000000000000..f702981a19bdb92e9153aea3ce331fc331939354 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString004.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LengthMetrics } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRicheditorSetStyledString004 { + stringLength: number = 0; + imagePixelMap: image.PixelMap | undefined = undefined; + @State selection: string = ""; + @State content: string = ""; + @State range: string = ""; + @State replaceString: string = ""; + @State rangeBefore: string = ""; + @State rangeAfter: string = ""; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + richEditorStyledString: MutableStyledString = new MutableStyledString(""); + textStyle: TextStyle = new TextStyle({ + fontWeight: FontWeight.Lighter, + fontFamily: 'HarmonyOS Sans', + fontColor: Color.Green, + fontSize: LengthMetrics.vp(30), + fontStyle: FontStyle.Normal + }) + fontStyle1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + fontStyle2: TextStyle = new TextStyle({ + fontWeight: FontWeight.Bolder, + fontFamily: 'Arial', + fontColor: Color.Orange, + fontSize: LengthMetrics.vp(50), + fontStyle: FontStyle.Italic + }) + // 创建属性字符串对象 + mutableStyledString: MutableStyledString = new MutableStyledString("init属性", + [{ start: 0, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle1 }]); + styledString: StyledString = new StyledString("属性字符串", + [{ start: 2, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle2 }]); + controller: RichEditorStyledStringController = new RichEditorStyledStringController(); + options: RichEditorStyledStringOptions = {controller: this.controller}; + + async aboutToAppear() { + console.info("aboutToAppear initial imagePixelMap"); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + + build() { + Column() { + Button("设定图片大小").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: '57px', height: '57px' }, + layoutStyle: { borderRadius: LengthMetrics.vp(10),margin:LengthMetrics.vp(10),padding:LengthMetrics.vp(10)}, + verticalAlign: ImageSpanAlignment.TOP, + objectFit: ImageFit.Contain, + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_top') + RichEditor(this.options) + .onReady(() => { + }) + .height("20%") + .width("100%") + .borderWidth(1) + .borderColor(Color.Black).id('ComponentTextRicheditorSetStyledString004') + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString005.ets new file mode 100644 index 0000000000000000000000000000000000000000..77a2f591d9b04b659bb518f090fb51394138b217 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString005.ets @@ -0,0 +1,189 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LengthMetrics } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRicheditorSetStyledString005 { + stringLength: number = 0; + imagePixelMap: image.PixelMap | undefined = undefined; + @State selection: string = ""; + @State content: string = ""; + @State range: string = ""; + @State replaceString: string = ""; + @State rangeBefore: string = ""; + @State rangeAfter: string = ""; + + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + richEditorStyledString: MutableStyledString = new MutableStyledString(""); + textStyle: TextStyle = new TextStyle({ + fontWeight: FontWeight.Lighter, + fontFamily: 'HarmonyOS Sans', + fontColor: Color.Green, + fontSize: LengthMetrics.vp(30), + fontStyle: FontStyle.Normal + }) + fontStyle1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + fontStyle2: TextStyle = new TextStyle({ + fontWeight: FontWeight.Bolder, + fontFamily: 'Arial', + fontColor: Color.Orange, + fontSize: LengthMetrics.vp(50), + fontStyle: FontStyle.Italic + }) + // 创建属性字符串对象 + mutableStyledString: MutableStyledString = new MutableStyledString("init属性", + [{ start: 0, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle1 }]); + styledString: StyledString = new StyledString("属性字符串", + [{ start: 2, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontStyle2 }]); + controller: RichEditorStyledStringController = new RichEditorStyledStringController(); + options: RichEditorStyledStringOptions = {controller: this.controller}; + + async aboutToAppear() { + console.info("aboutToAppear initial imagePixelMap"); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + + build() { + Column() { + Button("ImageFit.Contain").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.TOP, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_top') + Button("ImageFit.Fill").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.CENTER, + objectFit: ImageFit.Fill + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_center') + Button("ImageFit.Cover").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BOTTOM, + objectFit: ImageFit.Cover + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_bottom') + + Button("ImageFit.Auto").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BASELINE, + objectFit: ImageFit.Auto + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_baseline') + Button("ImageFit.ScaleDown").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BASELINE, + objectFit: ImageFit.ScaleDown + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_down') + Button("ImageFit.None").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.BASELINE, + objectFit: ImageFit.None + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_none') + RichEditor(this.options) + .onReady(() => { + }) + .height("20%") + .width("100%") + .borderWidth(1) + .borderColor(Color.Black).id('ComponentTextRicheditorSetStyledString005') + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString008.ets new file mode 100644 index 0000000000000000000000000000000000000000..35ac7da58defe38f83ebb775a41001aae03c5bd7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString008.ets @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LengthMetrics } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRicheditorSetStyledString008 { + stringLength: number = 0; + imagePixelMap: image.PixelMap | undefined = undefined; + @State selection: string = ""; + @State content: string = ""; + @State range: string = ""; + @State replaceString: string = ""; + @State rangeBefore: string = ""; + @State rangeAfter: string = ""; + + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + richEditorStyledString: MutableStyledString = new MutableStyledString(""); + textStyle: TextStyle = new TextStyle({ + fontWeight: FontWeight.Lighter, + fontFamily: 'HarmonyOS Sans', + fontColor: Color.Green, + fontSize: LengthMetrics.vp(30), + fontStyle: FontStyle.Normal + }) + fontStyle1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + fontStyle2: TextStyle = new TextStyle({ + fontWeight: FontWeight.Bolder, + fontFamily: 'Arial', + fontColor: Color.Orange, + fontSize: LengthMetrics.vp(50), + fontStyle: FontStyle.Italic + }) + // 创建属性字符串对象 + mutableStyledString: MutableStyledString = new MutableStyledString("init属性", + [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: this.fontStyle1 + }]); + styledString: StyledString = new StyledString("属性字符串", + [{ + start: 2, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: this.fontStyle2 + }]); + controller: RichEditorStyledStringController = new RichEditorStyledStringController(); + options: RichEditorStyledStringOptions = { controller: this.controller }; + + async aboutToAppear() { + console.info("aboutToAppear initial imagePixelMap"); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + build() { + Column() { + Button("replace").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.TOP, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image_top') + Button("select").onClick(() => { + this.controller.setSelection(-1,-1); + }).id('select') + RichEditor(this.options) + .onReady(() => { + this.controller.setStyledString(this.mutableStyledString); + }) + .height("20%") + .width("100%") + .borderWidth(1) + .borderColor(Color.Black) + .id('ComponentTextRicheditorSetStyledString008') + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString009.ets new file mode 100644 index 0000000000000000000000000000000000000000..90754f0c282bd598b2051f5f4cdd5823f39ca587 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString009.ets @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LengthMetrics } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct ComponentTextRicheditorSetStyledString009 { + stringLength: number = 0; + imagePixelMap: image.PixelMap | undefined = undefined; + @State selection: string = ""; + @State content: string = ""; + @State range: string = ""; + @State replaceString: string = ""; + @State rangeBefore: string = ""; + @State rangeAfter: string = ""; + + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + richEditorStyledString: MutableStyledString = new MutableStyledString(""); + textStyle: TextStyle = new TextStyle({ + fontWeight: FontWeight.Lighter, + fontFamily: 'HarmonyOS Sans', + fontColor: Color.Green, + fontSize: LengthMetrics.vp(30), + fontStyle: FontStyle.Normal + }) + fontStyle1: TextStyle = new TextStyle({ fontColor: Color.Blue }); + fontStyle2: TextStyle = new TextStyle({ + fontWeight: FontWeight.Bolder, + fontFamily: 'Arial', + fontColor: Color.Orange, + fontSize: LengthMetrics.vp(50), + fontStyle: FontStyle.Italic + }) + // 创建属性字符串对象 + mutableStyledString: MutableStyledString = new MutableStyledString("init属性", + [{ + start: 0, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: this.fontStyle1 + }]); + styledString: StyledString = new StyledString("属性字符串", + [{ + start: 2, + length: 5, + styledKey: StyledStringKey.FONT, + styledValue: this.fontStyle2 + }]); + controller: RichEditorStyledStringController = new RichEditorStyledStringController(); + options: RichEditorStyledStringOptions = { controller: this.controller }; + + async aboutToAppear() { + console.info("aboutToAppear initial imagePixelMap"); + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.icon')); + } + + private async getPixmapFromMedia(resource: Resource) { + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + } + + build() { + Column() { + Button("image").onClick(() => { + if (this.imagePixelMap !== undefined) { + let imageStyledString = new MutableStyledString(new ImageAttachment({ + value: this.imagePixelMap, + size: { width: 20, height: 20 }, + layoutStyle: { borderRadius: LengthMetrics.vp(10) }, + verticalAlign: ImageSpanAlignment.TOP, + objectFit: ImageFit.Contain + })) + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.appendStyledString(imageStyledString); + this.controller.setStyledString(this.richEditorStyledString); + this.controller.setCaretOffset(this.richEditorStyledString.length); + } + }).id('image') + Button("replace").onClick(() => { + let richEditorSelection = this.controller.getSelection(); + let start = richEditorSelection.start ? richEditorSelection.start : 0; + let end = richEditorSelection.end ? richEditorSelection.end : 0; + this.richEditorStyledString = this.controller.getStyledString(); + this.richEditorStyledString.setStyle({ + start: start, + length: end - start, + styledKey: StyledStringKey.FONT, + styledValue: this.textStyle + }) + this.controller.setStyledString(this.richEditorStyledString); + }).id('image_top') + Button("select").onClick(() => { + this.controller.setSelection(-1,-1); + }).id('select') + RichEditor(this.options) + .onReady(() => { + this.controller.setStyledString(this.mutableStyledString); + }) + .height("20%") + .width("100%") + .borderWidth(1) + .borderColor(Color.Black) + .id('ComponentTextRicheditorSetStyledString009') + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformance0009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformance0009.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbe00287ed525610490b0296735e1271138acdf9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformance0009.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct ComponentTextRicheditorUxConformance0009 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + @State msg : String = ''; + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + build() { + Row() { + Column() { + Text('span value=====' + this.msg) + TextArea({text:"我是TextArea"}).draggable(true).width(100).height(50).id('TextArea'); + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan('abcde', { + }); + }) + .onDragEnd(()=>{ + this.msg = JSON.stringify(this.controller.getSpans()); + console.log('msg===='+this.msg); + }) + .onIMEInputComplete(()=>{ + this.msg = JSON.stringify(this.controller.getSpans()); + console.log('msg===='+this.msg); + }) + .onDidChange(()=>{ + this.msg = JSON.stringify(this.controller.getSpans()); + console.log('msg===='+this.msg); + }) + .id('ComponentTextRicheditorUxConformance0009') + .draggable(true) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation001.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3c4db69595d40bd7dd755f9419bb1f120a24ad4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation001.ets @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct RichEditorTransformation001 { + controller: RichEditorController = new RichEditorController(); + @State lineMetrics: string = ""; + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + + Column() { + Button('select') + .id('select') + .width(100) + .height(60) + .onClick(()=>{ + this.controller.setSelection(2,4); + }); + RichEditor({ controller: this.controller }) + .width(200) + .height(100) + .borderWidth(1) + .borderColor(Color.Green) + .onReady(() => { + this.controller.addTextSpan('abc123@!#', + { + style: + { + fontSize: 30 + } + }) + }) + .scale({ x: 2, y: 0.5 }) + .borderColor(Color.Green) + .width(200) + .height(200) + .onSelectionChange((value: RichEditorRange) => { + console.log("RichEditorController value:" + JSON.stringify(value)); + }) + .id('RichEditorTransformation001') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation002.ets new file mode 100644 index 0000000000000000000000000000000000000000..458e19cb45b90b0cb131ad472e2464e849219561 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation002.ets @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct RichEditorTransformation002 { + controller: RichEditorController = new RichEditorController(); + @State lineMetrics: string = ""; + private my_offset: number | undefined = undefined + private my_builder: CustomBuilder = undefined + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + @Builder + placeholderBuilder() { + Row({ space: 2 }) { + Image($r("app.media.icon")).width(5).height(5).margin({ left: -5 }) + Text('Custom').fontSize(5) + }.width(100).height(50).padding(5) + } + + build() { + Column() { + Button('select') + .id('select') + .width(100) + .height(60) + .onClick(()=>{ + this.controller.setSelection(-1, -1); + }) + RichEditor({ controller: this.controller }) + .width(100) + .height(100) + .borderWidth(1) + .borderColor(Color.Green) + .onReady(() => { + this.controller.addTextSpan('a\uD83D\uDE00', + { + style: + { + fontSize: 15 + } + }) + this.controller.addImageSpan($r("app.media.icon"), + { + imageStyle: + { + size: ["15px", "15px"] + } + }) + this.controller.addSymbolSpan($r("sys.symbol.ohos_trash"), + { + style: + { + fontSize: 15 + } + }) + this.my_builder = () => { + this.placeholderBuilder(); + } + this.controller.addBuilderSpan(this.my_builder, { offset: this.my_offset }); + }) + .scale({ x: 5, y: 0.5 }) + .borderColor(Color.Green) + .onSelectionChange((value: RichEditorRange) => { + console.log("RichEditorController value:" + JSON.stringify(value)); + }) + .id('RichEditorTransformation002') + }.margin(10) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation003.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee1db7e570edad49962f2ca18569556ec711db18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/RichEditorTransformation/RichEditorTransformation003.ets @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { pasteboard } from '@kit.BasicServicesKit'; + +@Entry +@Component +struct RichEditorTransformation003 { + controller: RichEditorController = new RichEditorController(); + + onPageShow(): void { + let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard(); + systemPasteboard.clearData((err, data) => { + if (err) { + return; + } + }); + } + + build() { + + Column() { + Button('select') + .id('select') + .width(100) + .height(60) + .onClick(()=>{ + this.controller.setSelection(2,4); + }); + RichEditor({ controller: this.controller }) + .width('100%') + .height(150) + .borderWidth(1) + .borderColor(Color.Green) + .onReady(() => { + this.controller.addTextSpan('aaa123$#@!', + { + style: + { + fontSize: 30 + } + }) + }) + .translate({ x: 100, y: 10 }) + .borderColor(Color.Green) + .onSelectionChange((value: RichEditorRange) => { + console.log("RichEditorController value:" + JSON.stringify(value)); + }) + .id('RichEditorTransformation003') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerInterface/UIComponentButtonTextPickerInterface0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerInterface/UIComponentButtonTextPickerInterface0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..ff24378fbb317b84d6b4d1e55d7c681043f8aca7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentButtonTextPickerInterface/UIComponentButtonTextPickerInterface0420.ets @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentButtonTextPickerInterface0420 { + build() { + Column() { + TextPicker({ + range: ['Test 111111111', 'Test 2', 'Test3','Test 11', 'Test 22', 'Test33','Test 21', 'Test 22', 'Test 33'], + }).backgroundColor('#e0e0e0') + .width(400) + }.width('100%') + .height('100%') + + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png new file mode 100755 index 0000000000000000000000000000000000000000..476223a2cbaa029e0ccc67660eb768effb766501 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png new file mode 100755 index 0000000000000000000000000000000000000000..0d16a9f5d39efc178484b2bfcbe3372cb3c16a7e Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png new file mode 100755 index 0000000000000000000000000000000000000000..eaae1996c7bcdeafd8a6287b9d5d44cfda56a934 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png new file mode 100755 index 0000000000000000000000000000000000000000..846adf54057902753c7ad575ea11769db6c5eec8 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 index e58bd507f3ecff51931c351ebcabf6603cd5c40c..b27957df19e9b245dcfce292548707ef4e6edc0e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 @@ -12,15 +12,33 @@ "installationFree": false, "pages": "$profile:test_pages", "requestPermissions": [ + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "usedScene": { + "abilities":[ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, { "name": "ohos.permission.WRITE_MEDIA" }, { "name": "ohos.permission.READ_MEDIA" }, + { + "name":"ohos.permission.CAPTURE_SCREEN" + }, { "name":"ohos.permission.UPDATE_CONFIGURATION" }, + { + "name":"ohos.permission.ACCESS_SCREEN_LOCK_INNER" + }, { "name":"ohos.permission.RUNNING_LOCK" }, diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 5cc05ce92cff61b76d701a3fe495c11c73638078..8c0c10cc3602831d21d1c35c83570b4334ed263a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1801,6 +1801,42 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + + "testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0025", + "testability/pages/ComponentTextRicheditorOnWillChangeTest/ComponentTextRicheditorOnWillChange0026", + "testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0015", + "testability/pages/ComponentTextRicheditorLineHeightLetterSpacing/ComponentTextRicheditorLineHeightLetterSpacing0016", + "testability/pages/ComponentTextRicheditorUxConformanceTest/ComponentTextRicheditorUxConformance0009", + + + "testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString001", + "testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString002", + "testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString003", + "testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString004", + "testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString005", + "testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString008", + "testability/pages/ComponentTextRicheditorSetStyledString/ComponentTextRicheditorSetStyledString009", + + + "testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor001", + "testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor002", + "testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor003", + + "testability/pages/ComponentRichEditorSupportColor/RichEditorSupportColor004", + "testability/pages/ComponentRichEditorThreeStrikes/ComponentRichEditorThreeStrikes001", + "testability/pages/RichEditorTransformation/RichEditorTransformation001", + "testability/pages/RichEditorTransformation/RichEditorTransformation002", + "testability/pages/RichEditorTransformation/RichEditorTransformation003", + "testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0044", + "testability/pages/ComponentTextRichEditorCopyPasteAttributeStringsTest/ComponentTextRichEditorCopyPasteAttributeStrings0045", + "testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0008", + "testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0009", + "testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0010", + "testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0011", + "testability/pages/ComponentTextRichEditorStabilityTest/ComponentTextRichEditorStability0013", + "testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0005", + "testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0007", + "testability/pages/ComponentTextRichEditorHandleOptimizationTest/ComponentTextRichEditorHandleOptimization0008" ] -} +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/hvigor/hvigor-config.json5 b/function/ui_compare_rh/uicompare/hvigor/hvigor-config.json5 index 64655e6970c2acdf5708226c4d5a584ca52b6f37..f70ecd4112d94f9aa555adf898d53f18bf58f3e9 100644 --- a/function/ui_compare_rh/uicompare/hvigor/hvigor-config.json5 +++ b/function/ui_compare_rh/uicompare/hvigor/hvigor-config.json5 @@ -1,6 +1,5 @@ { - "hvigorVersion": "3.2.4", + "modelVersion": "5.0.0", "dependencies": { - "@ohos/hvigor-ohos-plugin": "3.2.4" } } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/hvigorw b/function/ui_compare_rh/uicompare/hvigorw deleted file mode 100644 index 54aadd226b453397860013d328fd01031648fc31..0000000000000000000000000000000000000000 --- a/function/ui_compare_rh/uicompare/hvigorw +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/function/ui_compare_rh/uicompare/hvigorw.bat b/function/ui_compare_rh/uicompare/hvigorw.bat deleted file mode 100644 index 6861293e47dfd0186da380321b73be9033507e24..0000000000000000000000000000000000000000 --- a/function/ui_compare_rh/uicompare/hvigorw.bat +++ /dev/null @@ -1,64 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* - -if "%ERRORLEVEL%" == "0" goto hvigorwEnd - -:fail -exit /b 1 - -:hvigorwEnd -if "%OS%" == "Windows_NT" endlocal - -:end diff --git a/function/ui_compare_rh/uicompare_tools/run.bat b/function/ui_compare_rh/uicompare_tools/run.bat index 3fe200aa702522de563d3a9f63384ace127aca21..5110dc05756925a4c3b99bba78d1cc2326dfc961 100644 --- a/function/ui_compare_rh/uicompare_tools/run.bat +++ b/function/ui_compare_rh/uicompare_tools/run.bat @@ -34,4 +34,4 @@ set /p param= 输入入参: python UiCompareTools_progress.py %param% -pause +pause \ No newline at end of file