diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommoneventEventInterfaceTest/ActionEventCommoneventEventInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommoneventEventInterfaceTest/ActionEventCommoneventEventInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d55d93a417743e470dc8028db2e38917d35b9c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommoneventEventInterfaceTest/ActionEventCommoneventEventInterface.test.ets @@ -0,0 +1,259 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, MouseButton, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 ActionEventCommoneventEventInterface() { + + describe('ActionEventCommoneventEventInterface', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0110 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0110 + * @tc.desc ETS侧接口设置父组件的拦截结果为NONE,子组件的拦截结果为Transparent + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0110 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0110"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.mouseClick({x:100,y:100},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:200,y:250},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:400,y:450},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0110 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0100 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0100 + * @tc.desc ETS侧接口设置父组件的拦截结果为NONE,子组件的拦截结果为Block + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0100 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0100"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.mouseClick({x:100,y:100},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:200,y:250},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:400,y:450},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0040 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0040 + * @tc.desc ETS侧接口设置子组件的拦截结果为Block + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0040 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0040"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.mouseClick({x:100,y:100},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:200,y:250},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:400,y:450},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0040 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0180 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0180 + * @tc.desc ETS侧接口设置子组件的拦截结果为Block + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0180 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0180"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.mouseClick({x:100,y:100},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:200,y:250},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:400,y:450},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0180 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0060 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0060 + * @tc.desc ETS侧接口设置子组件的拦截结果为Transparent + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0060 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0060"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.mouseClick({x:100,y:100},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:200,y:250},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:400,y:450},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0120 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0120 + * @tc.desc ETS侧接口设置子组件的拦截结果为Transparent + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0120 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0120"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.mouseClick({x:100,y:100},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:200,y:250},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:400,y:450},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0120 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0150 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0150 + * @tc.desc ETS侧接口设置一个子组件的拦截结果为NONE,另一个子子组件的拦截结果为Transparent + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0150 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0150"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.mouseClick({x:100,y:100},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:200,y:250},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await driver.mouseClick({x:400,y:450},MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_EVENT_INTERFACE_0150 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIComponentFunctionCommomattributesMenuArrowblurTest/ArkUIComponentFunctionCommomattributesMenuArrowblur.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIComponentFunctionCommomattributesMenuArrowblurTest/ArkUIComponentFunctionCommomattributesMenuArrowblur.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..250b184cb57c2c39b7578e400895ecec809ef9ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIComponentFunctionCommomattributesMenuArrowblurTest/ArkUIComponentFunctionCommomattributesMenuArrowblur.test.ets @@ -0,0 +1,308 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 ArkUIComponentFunctionCommomattributesMenuArrowblur() { + + describe('ArkUIComponentFunctionCommomattributesMenuArrowblur', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_COMMOMATTRIBUTES_MENU_ARROWBLUR_0080 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0080 + * @tc.desc 避让8,button组件设置在屏幕左方中间,bindContextMenu设置isShown,content( CustomBuilder有3个菜单),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Left) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0080', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0080 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0080"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0080 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0110 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0110 + * @tc.desc bindContextMenu不设置isShown,content(CustomBuilder有3个菜单),responseType(LongPress),enableArrow(true),backgroundBlurStyle(BlurStyle.Thick),backgroundColor("#FF00FF") + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0110', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0110 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0110"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0110 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0100 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0100 + * @tc.desc 避让1,button组件设置在屏幕上方中间,bindMenu设置isShown,content( CustomBuilder有3个菜单),showInSubWindow(true),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Top) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0100', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0100 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0100"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0100 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0010 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0010 + * @tc.desc 避让1,button组件设置在屏幕上方中间,bindMenu设置isShown,content( CustomBuilder有3个菜单),showInSubWindow(true),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Top) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0010', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0010 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0010 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0020 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0020 + * @tc.desc bindContextMenu不设置isShown,content(CustomBuilder有3个菜单),responseType(LongPress),enableArrow(true),backgroundBlurStyle(BlurStyle.Thick),backgroundColor("#FF00FF") + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0020', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0020 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0020"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0020 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0140 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0140 + * @tc.desc 避让5,button组件设置在屏幕上方中间,bindContextMenu设置isShown,content( CustomBuilder有3个菜单),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Top) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0140', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0010 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0140"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0140 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0050 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0050 + * @tc.desc bindContextMenu不设置isShown,content(CustomBuilder有3个菜单),responseType(LongPress),enableArrow(true),backgroundBlurStyle(BlurStyle.Thick),backgroundColor("#FF00FF") + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0050', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0050 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0050"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await btn.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0050 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0120 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0120 + * @tc.desc 避让2,button组件设置在屏幕右方中间,bindMenu设置isShown,content( CustomBuilder有3个菜单),showInSubWindow(true),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Right) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0120', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0120 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0120"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0120 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0060 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0060 + * @tc.desc 避让7,button组件设置在屏幕下方中间,bindContextMenu设置isShown,content( CustomBuilder有3个菜单),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Bottom) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0060', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0060 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0060"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0060 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0130 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0130 + * @tc.desc 避让3,button组件设置在屏幕下方中间,bindMenu设置isShown,content( CustomBuilder有3个菜单),showInSubWindow(true),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Bottom) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0130', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0130 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0130"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0130 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0070 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0070 + * @tc.desc 避让4,button组件设置在屏幕左方中间,bindMenu设置isShown,content( CustomBuilder有3个菜单),showInSubWindow(true),enableArrow(true),backgroundBlurStyle(BlurStyle.Regular),backgroundColor(0xff0000),placement(Placement.Left) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0070', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0070 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0070"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0070 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0030 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0030 + * @tc.desc bindContextMenu设置isShown,content(CustomBuilder有3个菜单),enableArrow(true),backgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR),backgroundColor(Color.Pink) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0030', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0030 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0030"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_ARROWBLUR_0030 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIComponentFunctionCommomattributesMenuEffectenhancementTest/ArkUIComponentFunctionCommomattributesMenuEffectenhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIComponentFunctionCommomattributesMenuEffectenhancementTest/ArkUIComponentFunctionCommomattributesMenuEffectenhancement.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bca6ff3b4baac8564a5ba0ab79f9c89a03af1ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIComponentFunctionCommomattributesMenuEffectenhancementTest/ArkUIComponentFunctionCommomattributesMenuEffectenhancement.test.ets @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 ArkUIComponentFunctionCommomattributesMenuEffectenhancement() { + + describe('ArkUIComponentFunctionCommomattributesMenuEffectenhancement', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0120 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0120 + * @tc.desc 验证bindMenu组件的弹出/退出动效:二级菜单EMBEDDED_EXPAND(嵌入式) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0120', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0120 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0120"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let menu = await driver.findComponent(ON.id('menu1')); + await Utils.sleep(1000); + await menu.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0120 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0080 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0080 + * @tc.desc 验证bindContextMenu组件的弹出/退出动效:二级菜单EMBEDDED_EXPAND(嵌入式) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0080', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0080 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0080"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let menu = await driver.findComponent(ON.id('menu1')); + await Utils.sleep(1000); + await menu.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.click(200,200); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0080 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0090 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0090 + * @tc.desc 验证bindContextMenu组件的弹出/退出动效:二级菜单SIDE_EXPAND(侧边) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0090', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0090 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0090"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let menu = await driver.findComponent(ON.id('menu1')); + await Utils.sleep(1000); + await menu.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0090 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0100 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0100 + * @tc.desc 验证bindContextMenu组件的弹出/退出动效:二级菜单STACK_EXPAND(悬浮式) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0100', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0100 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0100"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let menu = await driver.findComponent(ON.id('menu1')); + await Utils.sleep(1000); + await menu.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0100 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0130 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0130 + * @tc.desc 验证bindMenu组件的弹出/退出动效:二级菜单SIDE_EXPAND(侧边) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0130', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0130 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0130"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let menu = await driver.findComponent(ON.id('menu1')); + await Utils.sleep(1000); + await menu.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.click(200,200); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0130 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0140 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0140 + * @tc.desc 验证bindMenu组件的弹出/退出动效:二级菜单STACK_EXPAND(悬浮式) + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0140', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0140 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0140"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + let menu = await driver.findComponent(ON.id('menu1')); + await Utils.sleep(1000); + await menu.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.click(200,200); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0140 finish.`); + done(); + }) + /* + * @tc.number ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0110 + * @tc.name ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0110 + * @tc.desc 验证bindMenu组件的弹出/退出动效:一级菜单 + */ + it('ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0110', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0110 start.`); + Settings.createWindow("testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0110"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await driver.click(200,200); + await Utils.sleep(1000); + let button = await driver.findComponent(ON.id('button')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `ARKUI_COMPONENTFUNCTION_COMMOMATTRIBUTES_MENU_EFFECTENHANCEMENT_0110 finish.`); + done(); + }) + }) +} 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..f1aa2eff9dbb103e8241dccb76f8b720a26eff1f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -149,6 +149,31 @@ import UIComponentPopupBoxToastStyleInterface001 from './UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test'; import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import ActionEventCommoneventEventInterface + from "./ActionEventCommoneventEventInterfaceTest/ActionEventCommoneventEventInterface.test"; +import ArkUIComponentFunctionCommomattributesMenuArrowblur + from "./ArkUIComponentFunctionCommomattributesMenuArrowblurTest/ArkUIComponentFunctionCommomattributesMenuArrowblur.test"; +import ArkUIComponentFunctionCommomattributesMenuEffectenhancement + from "./ArkUIComponentFunctionCommomattributesMenuEffectenhancementTest/ArkUIComponentFunctionCommomattributesMenuEffectenhancement.test"; +import ThemeComponentStylesSwitch from "./ThemeComponentStylesSwitchTest/ThemeComponentStylesSwitch.test"; +import UIComponentPopupboxPromptactionUiextension + from "./UIComponentPopupboxPromptactionUiextensionTest/UIComponentPopupboxPromptactionUiextension.test"; +import UIComponentPopupboxSpecificationsAlignment + from "./UIComponentPopupboxSpecificationsAlignmentTest/UIComponentPopupboxSpecificationsAlignment.test"; +import UIComponentPopupboxPromptSupportcustomizationstyle + from "./UIComponentPopupboxPromptSupportcustomizationstyleTest/UIComponentPopupboxPromptSupportcustomizationstyle.test"; +import UIMotionFoundationMatrix4Interface + from "./UIMotionFoundationMatrix4InterfaceTest/UIMotionFoundationMatrix4Interface.test"; +import UIComponentPopupboxPopupFollowtransformoftarget + from "./UiComponentPopupboxPopupFollowtransformoftargetTest/UIComponentPopupboxPopupFollowtransformoftarget.test"; +import UIComponentPopupBoxPopupInUiExtension + from "./UIComponentPopupBoxPopupInUiExtensionTest/UIComponentPopupBoxPopupInUiExtension.test"; +import UIAttributesBackgroundSeriable from "./UIAttributesBackgroundSeriableTest/UIAttributesBackgroundSeriable.test"; +import SubAceActionWindowWindowCustom from "./SubAceActionWindowWindowCustomTest/SubAceActionWindowWindowCustom.test"; +import SubAceActionWindowCustomIzation + from "./SubAceActionWindowCustomIzationTest/SubAceActionWindowCustomIzation.test"; +import UIComponentUicontextReplacement from "./UIComponentUicontextReplacement/UIComponentUicontextReplacement.test"; +import UIComponentUIContext from './UIComponentUIContextTest/UIComponentUIContext.test'; export default function testsuite() { ComponentTextRicheditorFontfeatures(); @@ -239,6 +264,22 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + ThemeComponentStylesSwitch(); + UIMotionFoundationMatrix4Interface(); + ArkUIComponentFunctionCommomattributesMenuArrowblur(); + ArkUIComponentFunctionCommomattributesMenuEffectenhancement(); + UIComponentPopupboxPromptactionUiextension(); + ActionEventCommoneventEventInterface(); + UIComponentPopupboxSpecificationsAlignment(); + UIComponentPopupboxPopupFollowtransformoftarget(); + UIComponentPopupBoxPopupInUiExtension(); + UIComponentPopupboxPromptSupportcustomizationstyle(); + UIAttributesBackgroundSeriable(); + SubAceActionWindowWindowCustom(); + SubAceActionWindowCustomIzation(); + + UIComponentUicontextReplacement(); + UIComponentUIContext(); } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/SubAceActionWindowCustomIzationTest/SubAceActionWindowCustomIzation.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/SubAceActionWindowCustomIzationTest/SubAceActionWindowCustomIzation.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e96d3e95c5d322251f8e568041cc127ea73cb3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/SubAceActionWindowCustomIzationTest/SubAceActionWindowCustomIzation.test.ets @@ -0,0 +1,413 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, MouseButton, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 SubAceActionWindowCustomIzation() { + + describe('SubAceActionWindowCustomIzation', () => { + + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_ACTION_WINDOW_CUSTOMIZATION_0020 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0020 + * @tc.desc 2、点击无响应 + 3、标题栏高度发生变化80 + 4、点击无响应 + 5、标题栏高度发生变化88 + 6、点击无响应 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0020 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0020"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button0')); + let btn1 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + let btn3 = await driver.findComponent(ON.id('button3')); + let btn4 = await driver.findComponent(ON.id('button4')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await btn3.click(); + await Utils.sleep(1000); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0080 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0080 + * @tc.desc 2、点击无响应 + 3、标题栏高度发生变化80 + 4、点击无响应 + 5、标题栏高度发生变化88 + 6、点击无响应 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0080 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0080"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button0')); + let btn1 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + let btn3 = await driver.findComponent(ON.id('button3')); + let btn4 = await driver.findComponent(ON.id('button4')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await btn3.click(); + await Utils.sleep(1000); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0060 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0060 + * @tc.desc 2、点击无响应 + 3、标题栏高度发生变化80 + 4、点击无响应 + 5、标题栏高度发生变化88 + 6、点击无响应 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0060 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0060"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button0')); + let btn1 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + let btn3 = await driver.findComponent(ON.id('button3')); + let btn4 = await driver.findComponent(ON.id('button4')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await btn3.click(); + await Utils.sleep(1000); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0120 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0120 + * @tc.desc 2、点击无响应 + 3、标题栏高度发生变化80 + 4、点击无响应 + 5、标题栏高度发生变化88 + 6、点击无响应 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0120 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0120"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button0')); + let btn1 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + let btn3 = await driver.findComponent(ON.id('button3')); + let btn4 = await driver.findComponent(ON.id('button4')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await btn3.click(); + await Utils.sleep(1000); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0160 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0160 + * @tc.desc 三键会覆盖文字;menu弹出来的弹框会把三键覆盖掉 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0160 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0160"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0130 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0130 + * @tc.desc 双击之后窗口全屏 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0130 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0130"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button1')); + let point = await (await driver.findComponent(ON.id('button2'))).getBoundsCenter(); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0200 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0200 + * @tc.desc 标题栏隐藏 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0200 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0150 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0150 + * @tc.desc 标题栏隐藏 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0200 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0150"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0100 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0100 + * @tc.desc 2、点击无响应 + 3、标题栏高度发生变化80 + 4、点击无响应 + 5、标题栏高度发生变化88 + 6、点击无响应 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0100 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0100"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button0')); + let btn1 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + let btn3 = await driver.findComponent(ON.id('button3')); + let btn4 = await driver.findComponent(ON.id('button4')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await btn3.click(); + await Utils.sleep(1000); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0040 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0040 + * @tc.desc 2、点击无响应 + 3、标题栏高度发生变化80 + 4、点击无响应 + 5、标题栏高度发生变化88 + 6、点击无响应 + */ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0040 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0040"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn0 = await driver.findComponent(ON.id('button0')); + let btn1 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + let btn3 = await driver.findComponent(ON.id('button3')); + let btn4 = await driver.findComponent(ON.id('button4')); + await Utils.sleep(1000); + await btn0.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await btn3.click(); + await Utils.sleep(1000); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0190 + * @tc.name SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0190 + * @tc.desc 3、标题栏隐藏 +*/ + it('SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0190 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0190"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id('button1')); + let btn2 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_CUSTOMIZATION_0190 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/SubAceActionWindowWindowCustomTest/SubAceActionWindowWindowCustom.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/SubAceActionWindowWindowCustomTest/SubAceActionWindowWindowCustom.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ee85467bc5122af6e079c240b05b1ad3c2d1f5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/SubAceActionWindowWindowCustomTest/SubAceActionWindowWindowCustom.test.ets @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { 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 SubAceActionWindowWindowCustom() { + + describe('SubAceActionWindowWindowCustom', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_ACTION_WINDOW_WINDOWCUSTOM_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0320 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0320") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let input: Component = await driver.findComponent(ON.id('input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0320 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0330 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0330") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let input: Component = await driver.findComponent(ON.id('input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0330 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0340 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0340") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let input: Component = await driver.findComponent(ON.id('input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0340 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0350 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0350") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let input: Component = await driver.findComponent(ON.id('input')); + await Utils.sleep(1000); + await input.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0350 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0080 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0080") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0080 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0090 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0090") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0090 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0310 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0310") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0310 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0370 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0370") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0370 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0530 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0530") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0530 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0600 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0600") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0600 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0610 start.`); + Settings.createWindow("testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0610") + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_WINDOW_WINDOWCUSTOM_0610 finish.`); + done(); + }) + + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ThemeComponentStylesSwitchTest/ThemeComponentStylesSwitch.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ThemeComponentStylesSwitchTest/ThemeComponentStylesSwitch.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..475c49caad9918be2a9bedea821c42bfa4e03ac4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ThemeComponentStylesSwitchTest/ThemeComponentStylesSwitch.test.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 ThemeComponentStylesSwitch() { + + describe('ThemeComponentStylesSwitch', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_THEME_COMPONENT_STYLESWITCH_0350 + * @tc.name SUB_ACE_THEME_COMPONENT_STYLESWITCH_0350 + * @tc.desc Divider组件页面局部自定义Theme配色风格切换 + */ + it('SUB_ACE_THEME_COMPONENT_STYLESWITCH_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_THEME_COMPONENT_STYLESWITCH_0350 start.`); + Settings.createWindow("testability/pages/ThemeComponentStylesSwitch/ThemeComponentStylesSwitch0350"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + let test = await driver.findComponent(ON.id('test')); + await test.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_THEME_COMPONENT_STYLESWITCH_0350 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributesBackgroundSeriableTest/UIAttributesBackgroundSeriable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributesBackgroundSeriableTest/UIAttributesBackgroundSeriable.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..00861f1227565b22b4c47069161b2bc4afb274b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAttributesBackgroundSeriableTest/UIAttributesBackgroundSeriable.test.ets @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { i18n } from '@kit.LocalizationKit' +import { uiAppearance } from '@kit.ArkUI' + +/* + * + * 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 UIAttributesBackgroundSeriable() { + + describe('UIAttributesBackgroundSeriable', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_ATTRIBUTES_BACKGROUND_SERIABLE_0020 + * @tc.name SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0020 + * @tc.desc List不等高场景 + */ + it('SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0020 start.`); + Settings.createWindow("testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0020"); + await Utils.sleep(1000); + let driver = Driver.create(); + let list = await driver.findComponent(ON.id('list')); + await list.scrollToBottom(2000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0030 + * @tc.name SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0030 + * @tc.desc 设置update的childSize为极值 + */ + it('SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0030 start.`); + Settings.createWindow("testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0030"); + await Utils.sleep(1000); + let driver = Driver.create(); + await driver.drag(200,800,200,200,2000); + await Utils.sleep(1000); + await driver.drag(200,800,200,200,2000); + await Utils.sleep(1000); + await driver.drag(200,800,200,200,2000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0030 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0050 + * @tc.name SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0050 + * @tc.desc 设置list的显隐性 + */ + it('SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0050 start.`); + Settings.createWindow("testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0050"); + await Utils.sleep(1000); + let driver = Driver.create(); + let button = await driver.findComponent(ON.id('btn')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_ATTRIBUTES_BACKGROUND_SERIABLE_0050 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupInUiExtensionTest/UIComponentPopupBoxPopupInUiExtension.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupInUiExtensionTest/UIComponentPopupBoxPopupInUiExtension.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b6b51363f4f7a61987d725f59a9c894bc66e6e72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupInUiExtensionTest/UIComponentPopupBoxPopupInUiExtension.test.ets @@ -0,0 +1,450 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { 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 UIComponentPopupBoxPopupInUiExtension() { + + describe('UIComponentPopupBoxPopupInUiExtension', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_POPUPBOX_POPUP_INUIEXTENSION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0100 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0100") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0100 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0010") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0010 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0020") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0020 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0030") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0030 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0050") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0050 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0130") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0130 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0140 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0140") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0140 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0150 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0150") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0150 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0160 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0160") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0160 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0170 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0170 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0190 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0190") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0190 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0240 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0240") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0240 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0270 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0270") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0270 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0280 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0280") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0280 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0290 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0290") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0290 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0300 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0300") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0300 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0310 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0310") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0310 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0330 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0330") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0330 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0380 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0380") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0380 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0410 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0410") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0410 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0420 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0420") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0420 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0430 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0430") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0430 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0440 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0440") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0440 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0450 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0450") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0450 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0470 start.`); + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0470") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_INUIEXTENSION_0470 finish.`); + done(); + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxPromptSupportcustomizationstyleTest/UIComponentPopupboxPromptSupportcustomizationstyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxPromptSupportcustomizationstyleTest/UIComponentPopupboxPromptSupportcustomizationstyle.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c8baea49efc988bf90fcbac53724343a847ed34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxPromptSupportcustomizationstyleTest/UIComponentPopupboxPromptSupportcustomizationstyle.test.ets @@ -0,0 +1,341 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 UIComponentPopupboxPromptSupportcustomizationstyle() { + + describe('UIComponentPopupboxPromptSupportcustomizationstyle', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_SUPPORTCUSTOMIZATIONSTYLE_0540 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0540 + * @tc.desc null2:(toast设置promptAction.ToastShowMode.TOP_MOST)且toast配置backgroundBlurStyle:null) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0540 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0540"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0540 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0560 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0560 + * @tc.desc toast设置promptAction.ToastShowMode.DEFAULT,textColor(Color.Red),backgroundBlurStyle: BlurStyle.COMPONENT_REGULAR + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0560 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0560"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0560 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0600 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0600 + * @tc.desc toast设置promptAction.ToastShowMode.DEFAULT,textColor(Color.Red),backgroundBlurStyle: BlurStyle.BACKGROUND_ULTRA_THICK + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0600 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0600"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0600 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0630 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0630 + * @tc.desc toast设置promptAction.ToastShowMode.DEFAULT,textColor(Color.Red),backgroundBlurStyle: BlurStyle.BACKGROUND_ULTRA_THICK + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0630 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0630"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0630 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0660 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0660 + * @tc.desc 设置默认值1:(toast设置promptAction.ToastShowMode.DEFAULT)且toast配置backgroundColor:(Color.Transparent),textColor(Color.Black),shadow(ShadowStyle.OUTER_DEFAULT_MD) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0660 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0660"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0660 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0690 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0690 + * @tc.desc 不设置1:(toast设置promptAction.ToastShowMode.TOP_MOST)但toast不配置backgroundColor:(不设置),textColor(不设置),shadow(不设置) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0690 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0690"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0690 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0740 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0740 + * @tc.desc toast设置promptAction.ToastShowMode.TOP_MOST,textColor(Color.Red),backgroundBlurStyle: BlurStyle.Regular,shadow(ShadowStyle.OUTER_TOP_MOST_SM) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0740 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0740"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0740 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0710 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0710 + * @tc.desc toast设置promptAction.ToastShowMode.TOP_MOST,textColor(Color.Red),backgroundBlurStyle: BlurStyle.Regular,shadow(ShadowStyle.OUTER_TOP_MOST_SM) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0710 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0710"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0710 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0750 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0750 + * @tc.desc toast设置promptAction.ToastShowMode.TOP_MOST,textColor(Color.Red),backgroundBlurStyle: BlurStyle.COMPONENT_ULTRA_THIN + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0750 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0750"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0750 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0800 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0800 + * @tc.desc toast设置promptAction.ToastShowMode.TOP_MOST,backgroundColor(Color.Pink),textColor(Color.Green),shadow({radius:50px,type:ShadowType.COLOR,color:ColoringStrategy.PRIMARY,offsetX:50px,offsety:50px,fill:true}) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0800 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0800"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0800 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0790 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0790 + * @tc.desc toast设置promptAction.ToastShowMode.DEFAULT,textColor(Color.Red),backgroundBlurStyle: BlurStyle.BACKGROUND_THIN,shadow(ShadowStyle.OUTER_FLOATING_SM) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0790 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0790"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0790 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0820 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0820 + * @tc.desc toast设置promptAction.ToastShowMode.TOP_MOST,textColor(Color.Red),backgroundBlurStyle: BlurStyle.BACKGROUND_REGULAR,shadow(ShadowStyle.OUTER_FLOATING_MD) + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0820 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0820"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0820 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0380 + * @tc.desc toast设置promptAction.ToastShowMode.TOP_MOST,textColor(Color.Red),backgroundBlurStyle: BlurStyle.COMPONENT_ULTRA_THICK + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0380 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0380"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0380 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0460 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0460 + * @tc.desc toast设置promptAction.ToastShowMode.TOP_MOST,textColor(Color.Red),backgroundBlurStyle: BlurStyle.COMPONENT_ULTRA_THICK + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0460 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0460"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('btn')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPT_SUPPORTCUSTOMIZATIONSTYLE_0460 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxPromptactionUiextensionTest/UIComponentPopupboxPromptactionUiextension.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxPromptactionUiextensionTest/UIComponentPopupboxPromptactionUiextension.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4844cd2ff8fd5b05c0de3d7fa4d1a9c51cb7b837 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxPromptactionUiextensionTest/UIComponentPopupboxPromptactionUiextension.test.ets @@ -0,0 +1,937 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 UIComponentPopupboxPromptactionUiextension() { + + describe('UIComponentPopupboxPromptactionUiextension', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_PROMPTACTION_UIEXTENSION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0040 + * @tc.desc "1、半模态弹出 2、toast弹出 2.1、显示在UIExtension区域中 2.2、在UIExtension区域中顶部起始端对齐" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0040"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button2')); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0100 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0100 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域底部偏上位置" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0100 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0100"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0060 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域底部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0060"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0060 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0010 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域中横向和纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0070 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域中顶部起始端对齐" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0070"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0070 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0050 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域底部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0050"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0080 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域尾端纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0080"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0020 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域中横向和纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0020 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0020"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0030 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域中起始端纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0030"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0090 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域底部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0090"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0130 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域默认底部偏上位置" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0130"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0140 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0140 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域中顶部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0140 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0140"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0110 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域底部偏上位置" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0110 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0110"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0160 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0160 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域中顶部起始端对齐" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0160 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0160"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0120 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0120 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中(不会超出UIExtension区域) 1.2、在UIExtension区域中顶部横向居中后向上移动200(显示截断)" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0120 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0120"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0170 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0170 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域中横向和纵向居中" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0170 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0170"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0190 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0190 + * @tc.desc "1、半模态弹出 2、toast弹出 2.1、显示在主窗口区域中 2.2、在主窗口区域中顶部起始端对齐" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0190 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0190"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button2')); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0180 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0180 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域底部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0180 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0180"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0200 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0200 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域中横向和纵向居中 2、同1 3、同1" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0200 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0200"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let btn1 = await driver.findComponent(ON.id('button1')); + await btn1.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button2')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0200 finish.`); + done(); + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0210 +* @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0210 +* @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中(不会超出主窗口区域) 1.2、在应用主窗口区域中顶部横向居中向上移动200(显示截断)" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0210 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0210"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id('button1')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0230 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0230 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域中横向和纵向居中 2、同1 3、同1" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0230 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0230"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id('button1')); + await btn1.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button2')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0220 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0220 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域底部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0220 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0220"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0280 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0280 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域底部起始端" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0280 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0280"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0280 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0250 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0250 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域中起始端纵向居中" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0250 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0250"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0250 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0270 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0270 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域中顶部尾端" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0270 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0270"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0270 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0260 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0260 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域底部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0260 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0260"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0290 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0290 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域中顶部尾端" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0290 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0290"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0300 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0300 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域中顶部尾端" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0300 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0300"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0240 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0240 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域底部起始端" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0240 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0240"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0310 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0310 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域尾端纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0310 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0310"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0310 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0330 +* @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0330 +* @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域中横向和纵向居中 2、同1 3、同1" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0330 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0330"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id('button1')); + await btn1.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button2')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0330 finish.`); + done(); + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0350 +* @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0350 +* @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域底部偏上位置" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0350 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0350"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0340 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0340 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域底部起始端" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0340 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0340"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0340 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0320 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0320 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域中起始端纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0320 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0320"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0320 finish.`); + done(); + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0360 +* @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0360 +* @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域中顶部横向居中" +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0360 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0360"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0370 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0370 + * @tc.desc "1、toast弹出 1.1、显示在全屏区域中 1.2、在全屏区域底部偏上位置" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0370 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0370"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + await btn.click(); + await Utils.sleep(2000); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0370 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0410 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0410 + * @tc.desc "1、toast弹出 1.1、显示在应用主窗口区域中 1.2、在应用主窗口区域中顶部横向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0410 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0410"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0410 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0380 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0380 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域中顶部起始端对齐" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0380 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0380"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0380 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0400 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0400 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域默认底部偏上位置" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0400 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0400"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0400 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0390 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0390 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域尾端纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0390 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0390"); + await Utils.sleep(1000); + let driver = Driver.create(); + let test = await driver.findComponent(ON.id('button1')); + await test.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0390 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0150 + * @tc.desc "1、toast弹出 1.1、显示在UIExtension区域中 1.2、在UIExtension区域尾端纵向居中" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0150 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0150"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button0')); + let btn1 = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + let test = await driver.findComponent(ON.id('button2')); + await test.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_PROMPTACTION_UIEXTENSION_0150 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxSpecificationsAlignmentTest/UIComponentPopupboxSpecificationsAlignment.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxSpecificationsAlignmentTest/UIComponentPopupboxSpecificationsAlignment.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..612d51a85d80cb6072074beb5c78a5ab556d38f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupboxSpecificationsAlignmentTest/UIComponentPopupboxSpecificationsAlignment.test.ets @@ -0,0 +1,587 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 UIComponentPopupboxSpecificationsAlignment() { + + describe('UIComponentPopupboxSpecificationsAlignment', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_ALIGNMENT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0040 + * @tc.desc "2、打开自定义弹窗 3、UIExtension区域和弹窗消失" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0040"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + let btn1 = await driver.findComponent(ON.id('button2')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0120 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0120 + * @tc.desc 3、焦点位置落在subWindow:F上 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0120"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_ENTER); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0130 + * @tc.desc "2、焦点位置落在button上 3、焦点位置落在subWindow:F上" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0130"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + let btn1 = await driver.findComponent(ON.text('close_AlertDialog')); + await btn1.click(); + await Utils.sleep(1000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0250 + * @tc.desc 2、对话框正常弹出,且基于主窗口对齐,蒙层大小为全屏,遮罩层未发生偏移,maskRect设置不生效 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0250"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0270 + * @tc.desc 2、对话框正常弹出,且基于主窗口对齐,蒙层大小为全屏,遮罩层未发生偏移,maskRect设置不生效 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0270"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0300 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0300 + * @tc.desc 2、对话框正常弹出 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0300"); + await Utils.sleep(800); + let driver = Driver.create(); + let pointCenter=await(await driver.findComponent(ON.id('EmbeddedComponentID'))).getBoundsCenter();//模拟退出(点击遮罩层) + await Utils.sleep(800); + let Top = await driver.findComponent(ON.id('TopAlign')); + await Utils.sleep(800); + await Top.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Center = await driver.findComponent(ON.id('CenterAlign')); + await Utils.sleep(800); + await Center.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let Bottom = await driver.findComponent(ON.id('BottomAlign')); + await Utils.sleep(800); + await Bottom.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Defaultn = await driver.findComponent(ON.id('DefaultAlign')); + await Utils.sleep(800); + await Defaultn.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let TopStart = await driver.findComponent(ON.id('TopStartAlign')); + await Utils.sleep(800); + await TopStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let TopEnd = await driver.findComponent(ON.id('TopEndAlign')); + await Utils.sleep(800); + await TopEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let CenterStart = await driver.findComponent(ON.id('CenterStartAlign')); + await Utils.sleep(800); + await CenterStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let CenterEnd = await driver.findComponent(ON.id('CenterEndAlign')); + await Utils.sleep(800); + await CenterEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let BottomStart = await driver.findComponent(ON.id('BottomStartAlign')); + await Utils.sleep(800); + await BottomStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let BottomEnd = await driver.findComponent(ON.id('BottomEndAlign')); + await Utils.sleep(800); + await BottomEnd.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0330 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0330 + * @tc.desc 2、对话框正常弹出 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0330 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0330"); + await Utils.sleep(800); + let driver = Driver.create(); + let pointCenter=await(await driver.findComponent(ON.id('EmbeddedComponentID'))).getBoundsCenter();//模拟退出(点击遮罩层) + await Utils.sleep(800); + let Top = await driver.findComponent(ON.id('TopAlign')); + await Utils.sleep(800); + await Top.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Center = await driver.findComponent(ON.id('CenterAlign')); + await Utils.sleep(800); + await Center.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let Bottom = await driver.findComponent(ON.id('BottomAlign')); + await Utils.sleep(800); + await Bottom.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Defaultn = await driver.findComponent(ON.id('DefaultAlign')); + await Utils.sleep(800); + await Defaultn.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let TopStart = await driver.findComponent(ON.id('TopStartAlign')); + await Utils.sleep(800); + await TopStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let TopEnd = await driver.findComponent(ON.id('TopEndAlign')); + await Utils.sleep(800); + await TopEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let CenterStart = await driver.findComponent(ON.id('CenterStartAlign')); + await Utils.sleep(800); + await CenterStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let CenterEnd = await driver.findComponent(ON.id('CenterEndAlign')); + await Utils.sleep(800); + await CenterEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-100)); + await Utils.sleep(800); + let BottomStart = await driver.findComponent(ON.id('BottomStartAlign')); + await Utils.sleep(800); + await BottomStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let BottomEnd = await driver.findComponent(ON.id('BottomEndAlign')); + await BottomEnd.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0230 + * @tc.desc "2、打开自定义弹窗 3、UIExtension区域和弹窗消失" + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0230"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0280 + * @tc.desc 2、操作菜单正常弹出,且基于主窗口居中对齐,大小全屏 +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0280"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0310 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0310 + * @tc.desc 2、对话框正常弹出 +*/ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0310"); + await Utils.sleep(800); + let driver = Driver.create(); + let pointCenter=await(await driver.findComponent(ON.id('EmbeddedComponentID'))).getBoundsCenter();//模拟退出(点击遮罩层) + await Utils.sleep(800); + let Top = await driver.findComponent(ON.id('TopAlign')); + await Utils.sleep(800); + await Top.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Center = await driver.findComponent(ON.id('CenterAlign')); + await Utils.sleep(800); + await Center.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-200)); + await Utils.sleep(800); + let Bottom = await driver.findComponent(ON.id('BottomAlign')); + await Utils.sleep(800); + await Bottom.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Defaultn = await driver.findComponent(ON.id('DefaultAlign')); + await Utils.sleep(800); + await Defaultn.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-200)); + await Utils.sleep(800); + let TopStart = await driver.findComponent(ON.id('TopStartAlign')); + await Utils.sleep(800); + await TopStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let TopEnd = await driver.findComponent(ON.id('TopEndAlign')); + await Utils.sleep(800); + await TopEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let CenterStart = await driver.findComponent(ON.id('CenterStartAlign')); + await Utils.sleep(800); + await CenterStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-200)); + await Utils.sleep(800); + let CenterEnd = await driver.findComponent(ON.id('CenterEndAlign')); + await Utils.sleep(800); + await CenterEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-200)); + await Utils.sleep(800); + let BottomStart = await driver.findComponent(ON.id('BottomStartAlign')); + await Utils.sleep(800); + await BottomStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let BottomEnd = await driver.findComponent(ON.id('BottomEndAlign')); + await BottomEnd.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0240 + * @tc.desc 2、自定义弹窗正常弹出,且基于主窗口对齐,蒙层大小为全屏,遮罩层未发生偏移,maskRect设置不生效 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0240"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + let btn1 = await driver.findComponent(ON.id('button2')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0240 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0320 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0320 + * @tc.desc 2、对话框正常弹出 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0320 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0320"); + await Utils.sleep(800); + let driver = Driver.create(); + let pointCenter=await(await driver.findComponent(ON.id('EmbeddedComponentID'))).getBoundsCenter();//模拟退出(点击遮罩层) + await Utils.sleep(800); + let Top = await driver.findComponent(ON.id('TopAlign')); + await Utils.sleep(800); + await Top.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Center = await driver.findComponent(ON.id('CenterAlign')); + await Utils.sleep(800); + await Center.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-300)); + await Utils.sleep(800); + let Bottom = await driver.findComponent(ON.id('BottomAlign')); + await Utils.sleep(800); + await Bottom.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let Defaultn = await driver.findComponent(ON.id('DefaultAlign')); + await Utils.sleep(800); + await Defaultn.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-300)); + await Utils.sleep(800); + let TopStart = await driver.findComponent(ON.id('TopStartAlign')); + await Utils.sleep(800); + await TopStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let TopEnd = await driver.findComponent(ON.id('TopEndAlign')); + await Utils.sleep(800); + await TopEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let CenterStart = await driver.findComponent(ON.id('CenterStartAlign')); + await Utils.sleep(800); + await CenterStart.click(); + await Utils.sleep(500); + await driver.click(pointCenter.x,(pointCenter.y-300)); + await Utils.sleep(800); + let CenterEnd = await driver.findComponent(ON.id('CenterEndAlign')); + await Utils.sleep(800); + await CenterEnd.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,(pointCenter.y-300)); + await Utils.sleep(800); + let BottomStart = await driver.findComponent(ON.id('BottomStartAlign')); + await Utils.sleep(800); + await BottomStart.click(); + await Utils.sleep(800); + await driver.click(pointCenter.x,pointCenter.y); + await Utils.sleep(800); + let BottomEnd = await driver.findComponent(ON.id('BottomEndAlign')); + await BottomEnd.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0320 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0260 + * @tc.desc 2、自定义弹窗正常弹出,且基于主窗口对齐,蒙层大小为全屏,遮罩层未发生偏移,maskRect设置不生效 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0260"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('button1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_POPUPBOX_SPECIFICATIONS_ALIGNMENT_0260 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUIContextTest/UIComponentUIContext.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUIContextTest/UIComponentUIContext.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b23506cc8dc79f1c2358648bf241a27dffc3460 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUIContextTest/UIComponentUIContext.test.ets @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, MouseButton, ON } from '@kit.TestKit' +import { KeyCode } from '@kit.InputKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 UIComponentUIContext() { + + describe('UIComponentUIContext', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_UICONTEXT_getUIObserver_0010_1 + * @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_1 start.`); + Settings.createWindow("testability/pages/UIComponentUIContext/UIComponentUIContextGetUIObserver0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn1 = await driver.findComponent(ON.id('btn1')); + let btn2 = await driver.findComponent(ON.id('btn2')); + await Utils.sleep(1000); + await btn1.click(); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await btn2.click(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_2 + * @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_2 start.`); + Settings.createWindow("testability/pages/UIComponentUIContext/UIComponentUIContextGetUIObserver0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn1 = await driver.findComponent(ON.id('btn1')); + let btn2 = await driver.findComponent(ON.id('btn2')); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getUIObserver_0010_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_getPromptAction_0010 + * @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_getPromptAction_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_getPromptAction_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getPromptAction_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUIContext/UIComponentUIContextGetPromptAction0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(2000); + let button = await driver.findComponent(ON.id('btn1')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getPromptAction_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_getFocusControl_0010 + * @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_getFocusControl_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_getFocusControl_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getFocusControl_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUIContext/UIComponentUIContextGetFocusControl0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(2000); + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000); + let clearFocusBtn = await driver.findComponent(ON.id('clearFocusBtn')); + await Utils.sleep(1000); + await clearFocusBtn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getFocusControl_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_getMediaQuery_0010 + * @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_getMediaQuery_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_getMediaQuery_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getMediaQuery_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUIContext/UIComponentUIContextGetMediaQuery0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getMediaQuery_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_getComponentUtils_0010 + * @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_getComponentUtils_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_getComponentUtils_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getComponentUtils_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUIContext/UIComponentUIContextGetComponentUtils0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + await Utils.sleep(1000); + let btn = await driver.findComponent(ON.id('btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_getComponentUtils_0010 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUicontextReplacement/UIComponentUicontextReplacement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUicontextReplacement/UIComponentUicontextReplacement.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4cb1c7ea19ba796652b2b1ea3f894e2efcd45338 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUicontextReplacement/UIComponentUicontextReplacement.test.ets @@ -0,0 +1,186 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, beforeEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +export default function UIComponentUicontextReplacement() { + + describe('UIComponentUicontextReplacement', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_UICONTEXT_showActionSheet_0010 +* @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_showActionSheet_0010 +* @tc.desc 多实例 +*/ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_showActionSheet_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showActionSheet_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowActionSheet0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('show')); + await btn.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showActionSheet_0010 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_showAlertDialog_0010 +* @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_showAlertDialog_0010 +* @tc.desc 多实例 +*/ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_showAlertDialog_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showAlertDialog_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowAlertDialog0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('show')); + await btn.click(); + await Utils.sleep(1000); + let confirmButton = await driver.findComponent(ON.text('confirmButton')); + await confirmButton.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showAlertDialog_0010 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_showDatePickerDialog_0010 +* @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_showDatePickerDialog_0010 +* @tc.desc 多实例 +*/ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_showDatePickerDialog_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showDatePickerDialog_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowDatePickerDialog0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('show')); + await btn.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showDatePickerDialog_0010 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_showTextPickerDialog_0010 +* @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_showTextPickerDialog_0010 +* @tc.desc 多实例 +*/ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_showTextPickerDialog_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showTextPickerDialog_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTextPickerDialog0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('show')); + await btn.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showTextPickerDialog_0010 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_showTimePickerDialog_0010 +* @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_showTimePickerDialog_0010 +* @tc.desc 多实例 +*/ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_showTimePickerDialog_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showTimePickerDialog_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTimePickerDialog0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('show')); + await btn.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_showTimePickerDialog_0010 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_UICONTEXT_runScopedTask_CalendarPickerDialog_0010 +* @tc.name SUB_ACE_UI_COMPONENT_UICONTEXT_runScopedTask_CalendarPickerDialog_0010 +* @tc.desc 多实例 +*/ + it('SUB_ACE_UI_COMPONENT_UICONTEXT_runScopedTask_CalendarPickerDialog_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_runScopedTask_CalendarPickerDialog_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUicontextReplacement/UIComponentUicontextRunScopedTaskCalendarPickerDialog0010"); + await Utils.sleep(1000); + let driver = Driver.create(); + let show = await driver.findComponent(ON.id('show')); + await show.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UICONTEXT_runScopedTask_CalendarPickerDialog_0010 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIMotionFoundationMatrix4InterfaceTest/UIMotionFoundationMatrix4Interface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIMotionFoundationMatrix4InterfaceTest/UIMotionFoundationMatrix4Interface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..381064d02fe4c3ea65caca91725f7eb6590fff9f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIMotionFoundationMatrix4InterfaceTest/UIMotionFoundationMatrix4Interface.test.ets @@ -0,0 +1,369 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON } from '@kit.TestKit' +import { uiAppearance } from '@kit.ArkUI' +import { i18n } from '@kit.LocalizationKit' + +/* + * + * 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 UIMotionFoundationMatrix4Interface() { + + describe('UIMotionFoundationMatrix4Interface', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_MOTION_FOUNDATION_MATRIX4_INTERFACE_0010 + * @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0010 + * @tc.desc Divider组件页面局部自定义Theme配色风格切换 + */ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0010"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0020 + * @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0020 + * @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0020 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0020"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0020 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0030 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0030 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0030 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0030"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0030 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0040 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0040 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0040 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0040"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0040 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0050 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0050 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0050 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0050"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0060 + * @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0060 + * @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0060 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0060"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0010 finish.`); + done(); + }) + + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0070 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0070 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0070 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0070"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0070 finish.`); + done(); + }) + + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0080 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0080 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0080 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0080"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0080 finish.`); + done(); + }) + + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0090 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0090 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0090 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0090"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0090 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0100 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0100 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0100 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0100"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0100 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0110 + * @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0110 + * @tc.desc Divider组件页面局部自定义Theme配色风格切换 + */ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0110 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0110"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0110 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0120 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0120 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0120 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0120"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0120 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0130 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0130 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0130 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0130"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0130 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0140 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0140 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0140 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0140"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0140 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0150 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0150 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0150 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0150"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0150 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0160 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0160 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0160 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0160"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0160 finish.`); + done(); + }) + /* +* @tc.number SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0170 +* @tc.name SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0170 +* @tc.desc Divider组件页面局部自定义Theme配色风格切换 +*/ + it('SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0170"); + await Utils.sleep(1000); + let driver = Driver.create(); + let btn = await driver.findComponent(ON.id('textlog')); + await btn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0170 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxPopupFollowtransformoftargetTest/UIComponentPopupboxPopupFollowtransformoftarget.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxPopupFollowtransformoftargetTest/UIComponentPopupboxPopupFollowtransformoftarget.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..231f231f2ec56766c1fab8985f0488e03969bb3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentPopupboxPopupFollowtransformoftargetTest/UIComponentPopupboxPopupFollowtransformoftarget.test.ets @@ -0,0 +1,416 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { 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 UIComponentPopupboxPopupFollowtransformoftarget() { + + describe('UIComponentPopupboxPopupFollowtransformoftarget', () => { + beforeEach(async (done: Function) => { + if (uiAppearance.getDarkMode() == uiAppearance.DarkMode.ALWAYS_DARK) { + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT).then(() => { + console.info('Setting before Set dark-mode successfully.'); + }).catch((error: Error) => { + console.error('Setting before Set dark-mode failed, ' + error.message); + }); + Utils.sleep(1000); + } else { + console.info('Setting before dark-mode is uiAppearance.DarkMode.ALWAYS_LIGHT'); + } + i18n.System.setAppPreferredLanguage('zh-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_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0460 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0460") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0460 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0470 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0470") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0470 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0480 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0480") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0480 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0490 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0490") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0490 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0500 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0500") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0500 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0890 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0890") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0890 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0900 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0900") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0900 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0910', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0910 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0910") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0910 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0920 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0920") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0920 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0930 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0930") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0930 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0940 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0940") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0940 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0950 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0950") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0950 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0960 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0960") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0960 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0970', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0970 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0970") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0970 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0980 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0980") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_0980 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_1000 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1000") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_1000 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_1130 start.`); + Settings.createWindow("testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1130") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button: Component = await driver.findComponent(ON.id('button')); + let column: Component = await driver.findComponent(ON.id('column')); + await button.click(); + await Utils.sleep(4000); + await column.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_FOUNDATION_MATRIX4_INTERFACE_1130 finish.`); + done(); + }) + + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets index c74ae272407cbf707ddcfaaacf42c1e132d5452d..07d1bbd86550255ba5ba7f960dc4ebeded31496f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets @@ -36,14 +36,14 @@ async function sleep(time: number): Promise { } class Settings { - isPhone: boolean = true; + isPhone: boolean = false; windowClass: window.Window | undefined = undefined windowCreateType: string = "changeWindow"; private static DEFAULT_WIDTH: number = 720; - private static DEFAULT_HEIGHT: number = 1280; + private static DEFAULT_HEIGHT: number = 1412; private static DEFAULT_DPI: number = 240; - private static DEFAULT_OFFSET_X: number = 0; - private static DEFAULT_OFFSET_Y: number = 60; + private static DEFAULT_OFFSET_X: number = 100; + private static DEFAULT_OFFSET_Y: number = 132; private portrait: boolean = true changeWindowPosition(windowClass: window.Window, X: number | undefined, Y: number | undefined) { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets index 7f06aa4d872061e0682441fd8f47b33730bc78c1..5cab11d482a8d7318966168a30c45ca5cb5dd534 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -14,6 +14,9 @@ */ import {Driver , ON} from '@ohos.UiTest' +import { BusinessError, screenLock } from '@kit.BasicServicesKit'; +import Settings from './Settings'; +import { KeyCode } from '@kit.InputKit'; export default class Utils { @@ -39,7 +42,44 @@ export default class Utils { } + /** + * The app breathes and then lights up the screen + * + * @param driver + */ + static async lockAndUnlock(driver: Driver) { + await screenLock.lock((err: BusinessError, data: Boolean) => { + if (err) { + console.error(`Failed to lock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded in locking the screen. result: ${data}`); + }); + await Utils.sleep(2000); + await screenLock.unlock((err: BusinessError) => { + if (err) { + console.error(`Failed to unlock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded unlocking the screen.`); + }); + await driver.drag(100, 900, 100, 1, 1000); + } + /** + * The application switches to the desktop and back to the application + * + * @param driver + */ + static async homeAndBack(driver: Driver) { + let currentWindow = await Settings.windowClass; + if (currentWindow) { + await currentWindow.hide(); + await driver.triggerKey(KeyCode.KEYCODE_HOME); + await Utils.sleep(2000); + await currentWindow.showWindow(); + } + } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/entryembeddeduiextability/UIComponentPopupboxPromptactionUiextensionAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/entryembeddeduiextability/UIComponentPopupboxPromptactionUiextensionAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..73867a27837a957c09f97e3bdc783fb06709e7c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/entryembeddeduiextability/UIComponentPopupboxPromptactionUiextensionAbility.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { UIExtensionContentSession, Want } from '@kit.AbilityKit'; +import EmbeddedUIExtensionAbility from '@ohos.app.ability.EmbeddedUIExtensionAbility'; +import { promptAction } from '@kit.ArkUI'; + +export default class UIComponentPopupboxPromptactionUiextensionAbility extends EmbeddedUIExtensionAbility { + onCreate() { + hilog.info(0x0000, 'testTag', `onCreate`); + } + + onForeground() { + hilog.info(0x0000, 'testTag', `onForeground`) + } + + onBackground() { + hilog.info(0x0000, 'testTag', `onBackground`) + } + + onDestroy() { + hilog.info(0x0000, 'testTag', `onDestroy`) + } + + onSessionCreate(want: Want, session: UIExtensionContentSession) { + let storage: LocalStorage = new LocalStorage(); + let showMode_E: Object | null | undefined | string = want.parameters?.showMode_E; + let alignment_E: Object | null | undefined | string = want.parameters?.alignment_E; + let offset_E: Object | undefined | Offset = want.parameters?.offsets; + + if (offset_E === null) { + offset_E = { + dx: 0, dy: 0 + }; + } else if (offset_E === undefined) { + offset_E = { + dx: 0, dy: 0 + } + } + if (showMode_E === 'null') { + showMode_E = null; + } else if (showMode_E === 'undefined') { + showMode_E = undefined + } + + if (alignment_E === 'null') { + alignment_E = null; + } else if (alignment_E === 'undefined') { + alignment_E = undefined; + } + + storage.setOrCreate('session', session); + storage.setOrCreate('showMode_E', showMode_E); + storage.setOrCreate('alignment_E', alignment_E); + storage.setOrCreate('offset_E', offset_E) + session.loadContent(want.uri, storage); + hilog.info(0x0000, 'testTag', `onSessionCreate done`) + } + + onSessionDestroy(session: UIExtensionContentSession) { + hilog.info(0x0000, 'testTag', `onSessionDestroy`) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/entryembeddeduiextability/UIComponentPopupboxSpecificationsAlignmentAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/entryembeddeduiextability/UIComponentPopupboxSpecificationsAlignmentAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..1912e745ee98ac3e923ab6f56b3dd4c851990801 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/entryembeddeduiextability/UIComponentPopupboxSpecificationsAlignmentAbility.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { UIExtensionContentSession, Want } from '@kit.AbilityKit'; +import EmbeddedUIExtensionAbility from '@ohos.app.ability.EmbeddedUIExtensionAbility'; +import { promptAction } from '@kit.ArkUI'; + +export default class UIComponentPopupboxSpecificationsAlignmentAbility extends EmbeddedUIExtensionAbility { + onCreate() { + hilog.info(0x0000, 'testTag', `onCreate`); + } + + onForeground() { + hilog.info(0x0000, 'testTag', `onForeground`) + } + + onBackground() { + hilog.info(0x0000, 'testTag', `onBackground`) + } + + onDestroy() { + hilog.info(0x0000, 'testTag', `onDestroy`) + } + + onSessionCreate(want: Want, session: UIExtensionContentSession) { + let storage: LocalStorage = new LocalStorage(); + storage.setOrCreate('session', session); + session.loadContent(want.uri, storage); + hilog.info(0x0000, 'testTag', `onSessionCreate done`) + } + + onSessionDestroy(session: UIExtensionContentSession) { + hilog.info(0x0000, 'testTag', `onSessionDestroy`) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/image/background.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/image/background.png new file mode 100644 index 0000000000000000000000000000000000000000..7a32b59293c29076b7ff37af37dc09318aa26462 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/image/background.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/image/startIcon.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/image/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..c59a90fb37dd9cea9724d9e1b953767416981efc Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/image/startIcon.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..09e20c0ac3b559863f98f65bfb86d971420d1f91 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0040.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 { matrix4, promptAction } from '@kit.ArkUI'; +import { hiSysEvent } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct ActionEventCommoneventEventInterface0100 { + isPolygon(event: TouchEvent) { + return true; + } + build() { + Column() { + Stack(){ + Stack(){ + }.id('stack2').width('70%').height('70%').backgroundColor(Color.Green) + .onTouch(()=>{ + promptAction.showToast({message:'stack2响应事件'}); + }) + Stack(){ + Button('button组件').id('btn') + .onTouch(()=>{ + promptAction.showToast({message:'button响应事件'}); + }) + }.id('stack3').width('40%').height('40%').backgroundColor(Color.Orange) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.Block; + } + return HitTestMode.Default; + }) + + .onTouch(()=>{ + promptAction.showToast({ message:'stack3响应事件' }); + }) + }.id('stack1').width('80%').height('80%').backgroundColor(Color.Red) + .onTouch(()=>{ + promptAction.showToast({message:'stack1响应事件'}); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..951709b1dc2b696be4d12420446712f065ce3207 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0060.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 { matrix4, promptAction } from '@kit.ArkUI'; +import { hiSysEvent } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct ActionEventCommoneventEventInterface0060 { + isPolygon(event: TouchEvent) { + return true; + } + build() { + Column() { + Stack(){ + Stack(){ + }.id('stack2').width('70%').height('70%').backgroundColor(Color.Green) + .onTouch(()=>{ + promptAction.showToast({message:'stack2响应事件'}); + }) + Stack(){ + Button('button组件').id('btn') + .onTouch(()=>{ + promptAction.showToast({message:'button响应事件'}); + }) + }.id('stack3').width('40%').height('40%').backgroundColor(Color.Orange) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.Transparent; + } + return HitTestMode.Default; + }) + + .onTouch(()=>{ + promptAction.showToast({ message:'stack3响应事件' }); + }) + }.id('stack1').width('80%').height('80%').backgroundColor(Color.Red) + .onTouch(()=>{ + promptAction.showToast({message:'stack1响应事件'}); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..ff6913a7f5cd43c2da93b0ee0224b1dc65821fde --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0100.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 { matrix4, promptAction } from '@kit.ArkUI'; +import { hiSysEvent } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct ActionEventCommoneventEventInterface0100 { + isPolygon(event: TouchEvent) { + return true; + } + build() { + Column() { + Stack(){ + Stack(){ + }.id('stack2').width('70%').height('70%').backgroundColor(Color.Green) + .onTouch(()=>{ + promptAction.showToast({message:'stack2响应事件'}); + }) + Stack(){ + Button('button组件').id('btn') + .onTouch(()=>{ + promptAction.showToast({message:'button响应事件'}); + }) + }.id('stack3').width('40%').height('40%').backgroundColor(Color.Orange) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.Block; + } + return HitTestMode.Default; + }) + .onTouch(()=>{ + promptAction.showToast({message:'stack3响应事件'}); + }) + }.id('stack1').width('80%').height('80%').backgroundColor(Color.Red) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.None; + } else { + return HitTestMode.Default; + } + }) + .onTouch(()=>{ + promptAction.showToast({message:'stack1响应事件'}); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..c85076fb31f7e1fc6844f4be70fdb703a1735ef6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0110.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; +import { hiSysEvent } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct ActionEventCommoneventEventInterface0110 { + isPolygon(event: TouchEvent) { + return true; + } + build() { + Column() { + Stack(){ + Stack(){ + }.id('stack2').width('70%').height('70%').backgroundColor(Color.Green) + .onTouch(()=>{ + promptAction.showToast({message:'子stack响应事件'}); + }) + Stack(){ + Button('button组件').id('btn') + .onTouch(()=>{ + promptAction.showToast({message:'button响应事件'}); + }) + }.id('stack3').width('40%').height('40%').backgroundColor(Color.Orange) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.Transparent; + } + return HitTestMode.Default; + }) + }.id('stack1').width('80%').height('80%').backgroundColor(Color.Red) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.None; + } else { + return HitTestMode.Default; + } + }) + .onTouch(()=>{ + promptAction.showToast({message:'stack1响应事件'}); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac9b4ffaa1240d65041a42cd40548793621531c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0120.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 { matrix4, promptAction } from '@kit.ArkUI'; +import { hiSysEvent } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct ActionEventCommoneventEventInterface0120 { + isPolygon(event: TouchEvent) { + return true; + } + build() { + Column() { + Stack(){ + Stack(){ + }.id('stack2').width('70%').height('70%').backgroundColor(Color.Green) + .onTouch(()=>{ + promptAction.showToast({message:'stack2响应事件'}); + }) + Stack(){ + Button('button组件').id('btn') + .onTouch(()=>{ + promptAction.showToast({message:'button响应事件'}); + }) + }.id('stack3').width('40%').height('40%').backgroundColor(Color.Orange) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.Default; + } + return HitTestMode.Default; + }) + .onTouch(()=>{ + promptAction.showToast({ message:'stack3响应事件' }); + }) + }.id('stack1').width('80%').height('80%').backgroundColor(Color.Red) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.None; + } + return HitTestMode.Default; + }) + .onTouch(()=>{ + promptAction.showToast({message:'stack1响应事件'}); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f29f3e2949f6894f434e00b8fed1cd3d24288d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0150.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 { matrix4, promptAction } from '@kit.ArkUI'; +import { hiSysEvent } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct ActionEventCommoneventEventInterface0150 { + isPolygon(event: TouchEvent) { + return true; + } + build() { + Column() { + Stack(){ + Stack(){ + }.id('stack2').width('70%').height('70%').backgroundColor(Color.Green) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.None; + } + return HitTestMode.Default; + }) + .onTouch(()=>{ + promptAction.showToast({message:'stack2响应事件'}); + }) + Stack(){ + Button('button组件').id('btn') + .onTouch(()=>{ + promptAction.showToast({message:'button响应事件'}); + }) + }.id('stack3').width('40%').height('40%').backgroundColor(Color.Orange) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.Transparent; + } + return HitTestMode.Default; + }) + .onTouch(()=>{ + promptAction.showToast({ message:'stack3响应事件' }); + }) + }.id('stack1').width('80%').height('80%').backgroundColor(Color.Red) + .onTouch(()=>{ + promptAction.showToast({message:'stack1响应事件'}); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..b867a5448819214f88b48cb71cd89f89f37f3a1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0180.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 { matrix4, promptAction } from '@kit.ArkUI'; +import { hiSysEvent } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct ActionEventCommoneventEventInterface0180 { + isPolygon(event: TouchEvent) { + return true; + } + build() { + Column() { + Stack(){ + Stack(){ + }.id('stack2').width('70%').height('70%').backgroundColor(Color.Green) + .onTouch(()=>{ + promptAction.showToast({message:'stack2响应事件'}); + }) + Stack(){ + Button('button组件').id('btn') + .onTouch(()=>{ + promptAction.showToast({message:'button响应事件'}); + }) + }.id('stack3').width('40%').height('40%').backgroundColor(Color.Orange) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.None; + } + return HitTestMode.Default; + }) + + .onTouch(()=>{ + promptAction.showToast({ message:'stack3响应事件' }); + }) + }.id('stack1').width('80%').height('80%').backgroundColor(Color.Red) + .onTouchIntercept((event : TouchEvent) => { + if (this.isPolygon(event)) { + return HitTestMode.Block; + } + return HitTestMode.Default; + }) + .onTouch(()=>{ + promptAction.showToast({message:'stack1响应事件'}); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..1058c3f6cfeaa631e65281dce6a042a30d7bf69c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0010.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0010 { + @State isShown:boolean = false; + @Builder + subWindow() { + Menu() { + MenuItem({ content: "子菜单1" }) + MenuItem({ content: "子菜单2" }) + } + } + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" ,builder:this.subWindow()}) + MenuItem({ content: "菜单2" ,builder:this.subWindow()}) + MenuItem({ content: "菜单3" ,builder:this.subWindow()}) + }.backgroundColor(Color.Orange).subMenuExpandingMode(SubMenuExpandingMode.SIDE_EXPAND) + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .id('btn') + .onClick(()=>{ + this.isShown = true; + }) + .bindContextMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Thick, + backgroundColor:Color.Orange, + placement:Placement.Top + }) + }.width('100%').justifyContent(FlexAlign.Center).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..590ed91e1c8d0cceb9ac5516c2f6eb63bc4e4cad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0020.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0020 { + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "HelloWorld" }).contentFontColor(Color.White) + MenuItem({ content: "HelloWorld" }).contentFontColor(Color.White) + MenuItem({ content: "HelloWorld" }).contentFontColor(Color.White) + }.backgroundColor(Color.Green) + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .bindMenu(this.MyMenu(),{ + enableArrow:true, + showInSubWindow:false, + backgroundBlurStyle:BlurStyle.Thin, + backgroundColor:Color.Green + }) + }.width('100%').justifyContent(FlexAlign.Center).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d2f91be632147098a15b57babdd6a9eba1b3f16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0030.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0030 { + @State isShown:boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor(Color.Pink) + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .onClick(()=>{ + this.isShown = true; + }) + .id('btn') + .bindContextMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:Color.Pink, + placement:Placement.Top + }) + }.width('100%').justifyContent(FlexAlign.Center).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc232076c340db13590c357ef6e3ae93f4bb1ca4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0050.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0050 { + @State click:ResponseType = ResponseType.RightClick; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FFFF00') + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .onClick(()=>{ + this.click = ResponseType.LongPress; + }) + .id('btn') + .bindContextMenu(this.MyMenu(),this.click,{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Thin, + backgroundColor:'#FFFF00' + }) + }.width('100%').justifyContent(FlexAlign.Center).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b23615873eb604c7da224b9c290e82527888268 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0060.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0060 { + @State isShown:boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FFB6C1') + } + build() { + Column() { + Button('bindContextMenu') + .id('btn') + .margin({bottom:100}) + .onClick(()=>{ + this.isShown = true; + }) + .bindContextMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:'#0xff0000', + placement:Placement.Bottom + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.End) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..10b8c225e92da214b45c1ca0f363fcbbf88ca306 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0070.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0070 { + @State isShown:boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FFB6C1') + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .margin({bottom:100}) + .onClick(()=>{ + this.isShown = true; + }) + .bindMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:'#0xff0000', + placement:Placement.Left + }) + }.width('100%').justifyContent(FlexAlign.Start) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..dcf37720522201c81581299b25f7aa0fd6cd622d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0080.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0080 { + @State isShown: boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FFB6C1') + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .id('btn') + .onClick(()=>{ + this.isShown = true; + }) + .bindContextMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:'#0xff0000', + placement:Placement.Left + }) + }.width('100%').justifyContent(FlexAlign.Start).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..119366421edd834053988ff6d49a588c1a646cb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0100.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0100 { + @State isShown:boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FFB6C1') + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .onClick(()=>{ + this.isShown = true; + }) + .bindMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:'#0xff0000', + placement:Placement.Top + }) + }.width('100%').justifyContent(FlexAlign.Center).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..c75d59f9e1e7557e65364ab29ed4768fc73fef76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0110.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0110 { + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FF00FF') + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .id('btn') + .bindContextMenu(this.MyMenu(),ResponseType.LongPress,{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Thick, + backgroundColor:'#FF00FF' + }) + }.width('100%').justifyContent(FlexAlign.Start).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..847f1a8809a5289401f8f3223fbc5b8ca3892fc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0120.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0120 { + @State isShown:boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "HelloWorld" }).contentFontColor(Color.White) + MenuItem({ content: "HelloWorld" }).contentFontColor(Color.White) + MenuItem({ content: "HelloWorld" }).contentFontColor(Color.White) + }.backgroundColor('#FFB6C1') + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .onClick(()=>{ + this.isShown = true; + }) + .bindMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + showInSubWindow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:'#0xff0000', + placement:Placement.Right + }) + }.width('100%').justifyContent(FlexAlign.End).height('100%') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d1303aac2264c036e5f8b44807453a7d1898e73 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0130.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0130 { + @State isShown:boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FFB6C1') + } + build() { + Column() { + Button('bindMenu') + .id('btn') + .margin({bottom:100}) + .onClick(()=>{ + this.isShown = true; + }) + .bindMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:'#0xff0000', + placement:Placement.Bottom + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.End) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..820bbd33b42c6f2ce2b44b9f72bc1e20ec68ad57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0140.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuArrowblur0140 { + @State isShown:boolean = false; + @Builder + MyMenu() { + Menu() { + MenuItem({ content: "菜单1" }) + MenuItem({ content: "菜单2" }) + MenuItem({ content: "菜单3" }) + }.backgroundColor('#FFB6C1') + } + build() { + Column() { + Button('bindContextMenu') + .id('btn') + .margin({top:100}) + .onClick(()=>{ + this.isShown = true; + }) + .bindContextMenu(this.isShown,this.MyMenu(),{ + enableArrow:true, + backgroundBlurStyle:BlurStyle.Regular, + backgroundColor:'#0xff0000', + placement:Placement.Top + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..03bc10dcf30e71d0a1587f7376efa7e34740723c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0080.ets @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +import Window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuEffectenhancement0080 { + @State opity: number = 1; + @State portrait: boolean = true; + @State isShown:boolean = false; + private changeOrientation() { + let windowClass: Window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + let promise = Window.getLastWindow(context); + promise.then((data) => { + windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch(() => { + console.error('Failed to obtain the top window. Cause: '); + }); + } + @Builder + subWindow() { + Menu() { + MenuItem({ content: "子菜单1" }) + MenuItem({ content: "子菜单2" }) + } + } + @Builder + MyMenu() { + Menu() { + MenuItem({ + content: "菜单1" , + builder:this.subWindow(), + }).id('menu1') + MenuItem({ + content: "菜单2" , + builder:this.subWindow(), + }) + }.subMenuExpandingMode(SubMenuExpandingMode.EMBEDDED_EXPAND) + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .onClick(()=>{ + this.isShown = true; + }) + .id('btn') + .bindContextMenu(this.isShown,this.MyMenu(),{ + placement:Placement.Top, + onDisappear: ()=>{ + this.isShown = false; + } + }) + }.width('100%').justifyContent(FlexAlign.Center).height(400) + Button('切换横竖屏') + .margin({top:30}) + .id('button') + .onClick(()=>{ + if (this.opity == 0) { + this.opity = 1; + } else { + this.opity = 0; + } + this.changeOrientation(); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..7fae7559613b35e38f1794a174db8d32e4ba8964 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0090.ets @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +import Window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuEffectenhancement0090 { + @State opity: number = 1; + @State portrait: boolean = true; + @State isShown:boolean = false; + private changeOrientation() { + let windowClass: Window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + let promise = Window.getLastWindow(context); + promise.then((data) => { + windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch(() => { + console.error('Failed to obtain the top window. Cause: '); + }); + } + @Builder + subWindow() { + Menu() { + MenuItem({ content: "子菜单1" }) + MenuItem({ content: "子菜单2" }) + } + } + @Builder + MyMenu() { + Menu() { + MenuItem({ + content: "菜单1" , + builder:this.subWindow(), + }).id('menu1') + MenuItem({ + content: "菜单2" , + builder:this.subWindow(), + }) + }.subMenuExpandingMode(SubMenuExpandingMode.SIDE_EXPAND) + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .onClick(()=>{ + this.isShown = true; + }) + .id('btn') + .bindContextMenu(this.isShown,this.MyMenu(),{ + placement:Placement.Top, + onDisappear: ()=>{ + this.isShown = false; + } + }) + }.width('100%').justifyContent(FlexAlign.Center).height(400) + Button('切换横竖屏') + .margin({top:30}) + .id('button') + .onClick(()=>{ + if (this.opity == 0) { + this.opity = 1; + } else { + this.opity = 0; + } + this.changeOrientation(); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..93baa8da68f73e612b105b9915f19710c8242d68 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0100.ets @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +import Window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuEffectenhancement0100 { + @State opity: number = 1; + @State portrait: boolean = true; + @State isShown:boolean = false; + private changeOrientation() { + let windowClass: Window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + let promise = Window.getLastWindow(context); + promise.then((data) => { + windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch(() => { + console.error('Failed to obtain the top window. Cause: '); + }); + } + @Builder + subWindow() { + Menu() { + MenuItem({ content: "子菜单1" }) + MenuItem({ content: "子菜单2" }) + } + } + @Builder + MyMenu() { + Menu() { + MenuItem({ + content: "菜单1" , + builder:this.subWindow(), + }).id('menu1') + MenuItem({ + content: "菜单2" , + builder:this.subWindow(), + }) + }.subMenuExpandingMode(SubMenuExpandingMode.STACK_EXPAND) + } + build() { + Column() { + Row(){ + Button('bindContextMenu') + .onClick(()=>{ + this.isShown = true; + }) + .id('btn') + .bindContextMenu(this.isShown,this.MyMenu(),{ + placement:Placement.Top, + onDisappear: ()=>{ + this.isShown = false; + } + }) + }.width('100%').justifyContent(FlexAlign.Center).height(400) + Button('切换横竖屏') + .margin({top:30}) + .id('button') + .onClick(()=>{ + if (this.opity == 0) { + this.opity = 1; + } else { + this.opity = 0; + } + this.changeOrientation(); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..85a5eb71f37810daa55a51e8daff8fd0041cd9b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0110.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 { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +import Window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuEffectenhancement0110 { + @State opity: number = 1; + @State portrait: boolean = true; + private changeOrientation() { + let windowClass: Window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + let promise = Window.getLastWindow(context); + promise.then((data) => { + windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch(() => { + console.error('Failed to obtain the top window. Cause: '); + }); + } + @Builder + MyMenu() { + Menu() { + MenuItem({content: "菜单1"}) + MenuItem({content: "菜单2"}) + } + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .bindMenu(this.MyMenu(),{ + placement:Placement.Top + }) + }.width('100%').justifyContent(FlexAlign.Center).height(400) + Button('切换横竖屏') + .margin({top:30}) + .id('button') + .onClick(()=>{ + if (this.opity == 0) { + this.opity = 1; + } else { + this.opity = 0; + } + this.changeOrientation(); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..03abaddb24d108110302fa70684e576392ba52ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0120.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +import Window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuEffectenhancement0120 { + @State opity: number = 1; + @State portrait: boolean = true; + private changeOrientation() { + let windowClass: Window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + let promise = Window.getLastWindow(context); + promise.then((data) => { + windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch(() => { + console.error('Failed to obtain the top window. Cause: '); + }); + } + @Builder + subWindow() { + Menu() { + MenuItem({ content: "子菜单1" }) + MenuItem({ content: "子菜单2" }) + } + } + @Builder + MyMenu() { + Menu() { + MenuItem({ + content: "菜单1" , + builder:this.subWindow(), + }).id('menu1') + MenuItem({ + content: "菜单2" , + builder:this.subWindow(), + }) + }.subMenuExpandingMode(SubMenuExpandingMode.EMBEDDED_EXPAND) + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .bindMenu(this.MyMenu(),{ + placement:Placement.Top + }) + }.width('100%').justifyContent(FlexAlign.Center).height(400) + Button('切换横竖屏') + .margin({top:30}) + .id('button') + .onClick(()=>{ + if (this.opity == 0) { + this.opity = 1; + } else { + this.opity = 0; + } + this.changeOrientation(); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..ef2c374dfda8ce8a97ce8a70e62a7f229e8be034 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0130.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +import Window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuEffectenhancement0130 { + @State opity: number = 1; + @State portrait: boolean = true; + private changeOrientation() { + let windowClass: Window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + let promise = Window.getLastWindow(context); + promise.then((data) => { + windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch(() => { + console.error('Failed to obtain the top window. Cause: '); + }); + } + @Builder + subWindow() { + Menu() { + MenuItem({ content: "子菜单1" }) + MenuItem({ content: "子菜单2" }) + } + } + @Builder + MyMenu() { + Menu() { + MenuItem({ + content: "菜单1" , + builder:this.subWindow(), + }).id('menu1') + MenuItem({ + content: "菜单2" , + builder:this.subWindow(), + }) + }.subMenuExpandingMode(SubMenuExpandingMode.SIDE_EXPAND) + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .bindMenu(this.MyMenu(),{ + placement:Placement.Top + }) + }.width('100%').justifyContent(FlexAlign.Center).height(400) + Button('切换横竖屏') + .margin({top:30}) + .id('button') + .onClick(()=>{ + if (this.opity == 0) { + this.opity = 1; + } else { + this.opity = 0; + } + this.changeOrientation(); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..f12767ff2424ebfbf726d618b97e9f0aa1baa9fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0140.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; +import displaySync from '@ohos.graphics.displaySync'; + +import Window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct ArkUIComponentFunctionCommomattributesMenuEffectenhancement0140 { + @State opity: number = 1; + @State portrait: boolean = true; + private changeOrientation() { + let windowClass: Window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + let promise = Window.getLastWindow(context); + promise.then((data) => { + windowClass = data; + if (this.portrait) { + //切换成横屏 + let orientation = Window.Orientation.LANDSCAPE; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } else { + //切换成竖屏 + let orientation = Window.Orientation.PORTRAIT; + windowClass.setPreferredOrientation(orientation, (err) => { + }); + this.portrait = !this.portrait; + console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); + } + }).catch(() => { + console.error('Failed to obtain the top window. Cause: '); + }); + } + @Builder + subWindow() { + Menu() { + MenuItem({ content: "子菜单1" }) + MenuItem({ content: "子菜单2" }) + } + } + @Builder + MyMenu() { + Menu() { + MenuItem({ + content: "菜单1" , + builder:this.subWindow(), + }).id('menu1') + MenuItem({ + content: "菜单2" , + builder:this.subWindow(), + }) + }.subMenuExpandingMode(SubMenuExpandingMode.STACK_EXPAND) + } + build() { + Column() { + Row(){ + Button('bindMenu') + .id('btn') + .bindMenu(this.MyMenu(),{ + placement:Placement.Top + }) + }.width('100%').justifyContent(FlexAlign.Center).height(400) + Button('切换横竖屏') + .margin({top:30}) + .id('button') + .onClick(()=>{ + if (this.opity == 0) { + this.opity = 1; + } else { + this.opity = 0; + } + this.changeOrientation(); + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ExampleUIExtAbility/ExampleUIExtAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ExampleUIExtAbility/ExampleUIExtAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a3226b71546bc64dd2afae509abde5235741936 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ExampleUIExtAbility/ExampleUIExtAbility.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {UIExtensionAbility, UIExtensionContentSession, Want } from '@kit.AbilityKit'; + +const TAG: string = '[ExampleUIExtAbility]' +export default class ExampleUIExtAbility extends UIExtensionAbility { + + onCreate() { + console.info(TAG, `onCreate`); + } + + onForeground() { + console.info(TAG, `onForeground`); + } + + onBackground() { + console.info(TAG, `onBackground`); + } + + onDestroy() { + console.info(TAG, `onDestroy`); + } + + onSessionCreate(want: Want, session: UIExtensionContentSession) { + console.info(TAG, `onSessionCreate, want: ${JSON.stringify(want)}`); + let param: Record = { + 'session': session + }; + let storage: LocalStorage = new LocalStorage(param); + session.loadContent(want.uri, storage); + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ebef8260e8f31f01cec86c0adcd448b31a65b3f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0020.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 { ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0020 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = '工具栏/标题栏宽度:-->'; + @State toolBarHeight: number | string | null = null; + private buttons: Record[] = [ + { 'ToolBar高度设置20': 20 }, + { 'ToolBar高度设置80': 80 }, + { 'ToolBar高度设置113': 113 }, + { 'ToolBar高度设置88.88': 88.88 }, + { 'ToolBar高度设置abc': 'abc' } + ] + + async aboutToAppear() { + let names: Array<'status' | 'navigation'> = []; + await Settings.windowClass?.setWindowSystemBarEnable(names); + await Settings.windowClass?.setWindowLayoutFullScreen(true);//设置全屏 + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .height(this.toolBarHeight) + .backgroundColor(Color.Blue) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.Message += newValue.height + '--->'; + }) + Text(this.Message) + .fontSize(16) + Grid() { + ForEach(this.buttons, (item: Record, index) => { + GridItem() { + Button(this.ansButton(item)[0]) + .type(ButtonType.Normal) + .id("button" + index) + .onClick(() => { + this.toolBarHeight = this.ansButton(item)[1]; + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } + + ansButton(item: Record): [string, number | string | null] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } + + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..41a048fcaa867134c2cfdb90d2cc28e28f8eaf5d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0040.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0040 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = '工具栏/标题栏宽度:-->'; + @State toolBarHeight: number | string | null = null; + private buttons: Record[] = [ + { 'ToolBar高度设置20': 20 }, + { 'ToolBar高度设置80': 80 }, + { 'ToolBar高度设置113': 113 }, + { 'ToolBar高度设置88.88': 88.88 }, + { 'ToolBar高度设置abc': 'abc' } + ] + + async aboutToAppear() { + await Settings.windowClass?.resize(700, 800); //模拟分屏状态 + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .height(this.toolBarHeight) + .backgroundColor(Color.Blue) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.Message += newValue.height + '--->'; + }) + Text(this.Message) + .fontSize(16) + Grid() { + ForEach(this.buttons, (item: Record, index) => { + GridItem() { + Button(this.ansButton(item)[0]) + .type(ButtonType.Normal) + .id("button" + index) + .onClick(() => { + this.toolBarHeight = this.ansButton(item)[1]; + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } + + ansButton(item: Record): [string, number | string | null] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba22eb1b57564480d8c64cb7e499cbe33186ed51 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0060.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0060 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = '工具栏/标题栏宽度:-->'; + @State toolBarHeight: number | string | null = null; + private buttons: Record[] = [ + { 'ToolBar高度设置20': 20 }, + { 'ToolBar高度设置80': 80 }, + { 'ToolBar高度设置113': 113 }, + { 'ToolBar高度设置88.88': 88.88 }, + { 'ToolBar高度设置abc': 'abc' } + ] + + async aboutToAppear() { + let names: Array<'status' | 'navigation'> = []; + await Settings.windowClass?.setWindowSystemBarEnable(names);//沉浸式模拟最大化窗口 + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .height(this.toolBarHeight) + .backgroundColor(Color.Blue) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.Message += newValue.height + '--->'; + }) + Text(this.Message) + .fontSize(16) + Grid() { + ForEach(this.buttons, (item: Record, index) => { + GridItem() { + Button(this.ansButton(item)[0]) + .type(ButtonType.Normal) + .id("button" + index) + .onClick(() => { + this.toolBarHeight = this.ansButton(item)[1]; + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } + + ansButton(item: Record): [string, number | string | null] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..69400ebe41e3d5e9bb8cdad81423b6f1ac6ba985 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0080.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0080 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = '工具栏/标题栏宽度:-->'; + @State toolBarHeight: number | string | null = null; + private buttons: Record[] = [ + { 'ToolBar高度设置20': 20 }, + { 'ToolBar高度设置80': 80 }, + { 'ToolBar高度设置113': 113 }, + { 'ToolBar高度设置88.88': 88.88 }, + { 'ToolBar高度设置abc': 'abc' } + ] + + async aboutToAppear() { + await Settings.windowClass?.resize(700, 600); //模拟自由窗口 + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .height(this.toolBarHeight) + .backgroundColor(Color.Blue) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.Message += newValue.height + '--->'; + }) + Text(this.Message) + .fontSize(16) + Grid() { + ForEach(this.buttons, (item: Record, index) => { + GridItem() { + Button(this.ansButton(item)[0]) + .type(ButtonType.Normal) + .id("button" + index) + .onClick(() => { + this.toolBarHeight = this.ansButton(item)[1]; + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } + + ansButton(item: Record): [string, number | string | null] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb836b6e19e3cc2ae4448cf8ff8aa242258a1d2a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0100.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0100 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = '工具栏/标题栏宽度:-->'; + @State toolBarHeight: number | string | null = null; + private buttons: Record[] = [ + { 'ToolBar高度设置20': 20 }, + { 'ToolBar高度设置80': 80 }, + { 'ToolBar高度设置113': 113 }, + { 'ToolBar高度设置88.88': 88.88 }, + { 'ToolBar高度设置abc': 'abc' } + ] + + async aboutToAppear() { + await Settings.windowClass?.resize(700, 600); //模拟自由窗口状态 + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .height(this.toolBarHeight) + .backgroundColor(Color.Blue) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.Message += newValue.height + '--->'; + }) + Text(this.Message) + .fontSize(16) + Grid() { + ForEach(this.buttons, (item: Record, index) => { + GridItem() { + Button(this.ansButton(item)[0]) + .type(ButtonType.Normal) + .id("button" + index) + .onClick(() => { + this.toolBarHeight = this.ansButton(item)[1]; + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } + + ansButton(item: Record): [string, number | string | null] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..4abb362bfa0658ebbccb4153893448fb740d5c20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0120.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 { ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0120 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = '工具栏/标题栏宽度:-->'; + @State toolBarHeight: number | string | null = null; + private buttons: Record[] = [ + { 'ToolBar高度设置20': 20 }, + { 'ToolBar高度设置80': 80 }, + { 'ToolBar高度设置113': 113 }, + { 'ToolBar高度设置88.88': 88.88 }, + { 'ToolBar高度设置abc': 'abc' } + ] + + async aboutToAppear() { + let names: Array<'status' | 'navigation'> = []; + await Settings.windowClass?.setWindowSystemBarEnable(names); //模拟放大到最大状态 + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .height(this.toolBarHeight) + .backgroundColor(Color.Blue) + .onAreaChange((oldValue: Area, newValue: Area) => { + this.Message += newValue.height + '--->'; + }) + Text(this.Message) + .fontSize(16) + Grid() { + ForEach(this.buttons, (item: Record, index) => { + GridItem() { + Button(this.ansButton(item)[0]) + .type(ButtonType.Normal) + .id("button" + index) + .onClick(() => { + this.toolBarHeight = this.ansButton(item)[1]; + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } + + ansButton(item: Record): [string, number | string | null] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } + + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..e0f667c78eefa9f5d9c317fc6d0f61bb15487b5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0130.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 { promptAction, ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0130 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = 'Double Click'; + @State toolBarVisible: Visibility = Visibility.Visible; + + async aboutToAppear() { + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .id('button2') + .visibility(this.toolBarVisible) + .backgroundColor(Color.Blue) + .gesture(TapGesture({ + count: 2, + }) + .onAction(async () => { + let names: Array<'status' | 'navigation'> = []; + await Settings.windowClass?.setWindowSystemBarEnable(names); + await Settings.windowClass?.setWindowLayoutFullScreen(true); + }) + + ) + + Text(this.Message) + .fontSize(16) + Button('显示/隐藏') + .id('button1') + .onClick(() => { + if (this.toolBarVisible == Visibility.Visible) { + this.toolBarVisible = Visibility.Hidden; + promptAction.showToast({ message: "Ok Open Toast", alignment: Alignment.TopStart }); + } else { + this.toolBarVisible = Visibility.Visible; + } + + }) + + } + .gesture(TapGesture({ + count: 2, + }) + .onAction(async () => { + let names: Array<'status' | 'navigation'> = []; + await Settings.windowClass?.setWindowSystemBarEnable(names); + await Settings.windowClass?.setWindowLayoutFullScreen(true); + }) + + ) + + }.align(Alignment.Top) + .width('100%').height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f87d39ed7b91a2a3bc615fdba99ea75991bd897 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0150.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction, ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0150 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = 'Double Click'; + @State toolBarVisible: Visibility = Visibility.Visible; + + async aboutToAppear() { + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .visibility(this.toolBarVisible) + .backgroundColor(Color.Blue) + .gesture(TapGesture({ + count: 2, + }) + .onAction(async () => { + await Settings.windowClass?.setWindowLayoutFullScreen(true); + }) + + ) + + Text(this.Message) + .fontSize(16) + Button('显示/隐藏') + .id('button1') + .onClick(() => { + if (this.toolBarVisible == Visibility.Visible) { + this.toolBarVisible = Visibility.Hidden; + promptAction.showToast({ message: "Ok Open Toast", alignment: Alignment.TopStart }); + } else { + this.toolBarVisible = Visibility.Visible; + } + + }) + Button('子窗口') + .id('button2') + .onClick(async () => { + let windowClass: window.Window; + //获取上下文 + // 获取上下文,使用common模块 + let context = getContext(this) as common.UIAbilityContext; + await Settings.windowClass?.resize(500, 500); + + + context.windowStage?.createSubWindow('towWindow') + .then(async (wndowClass) => { + wndowClass.setUIContent("testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0150", + (err) => { + if (err.code) { + console.error("TAG", `Failed to load the window. Cause : ${JSON.stringify(err)}`) + return; + } + console.info("TAG", `Succeeded in loading the content.`); + wndowClass.resize(700, 800); + wndowClass.moveWindowTo(0, 700); + //显示悬浮窗 + wndowClass.showWindow((err) => { + if (err.code) { + console.error("TAG", `Failed to show the window. Cause : ${JSON.stringify(err)}`) + return; + } + console.info("TAG", `Succeeded in showing the window.`); + }) + }) + }) + .catch((error: Error) => { + console.error("TAG", JSON.stringify(error)) + }) + + }) + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + .backgroundColor(Color.Green) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f30942a6ec052e841c3c9a21e127dc309bf3431 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0160.ets @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ComposeTitleBar, ComposeTitleBarMenuItem, promptAction, ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0160 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = 'ToolBar V-H'; + @State toolBarVisible: Visibility = Visibility.Visible; + private menuItems: Array = [ + { + //菜单图片资源 + value: "/testability/image/startIcon.png", + //启用图标 + isEnabled: true, + label:'mesu1', + //点击菜单时触发事件 + action: () => promptAction.showToast({ message: "show toast index 1" }) + }, + { + value: "/testability/image/startIcon.png", + isEnabled: true, + action: () => promptAction.showToast({ message: "show toast index 1" }) + }, + { + value: "/testability/image/startIcon.png", + isEnabled: true, + action: () => promptAction.showToast({ message: "show toast index 1" }) + }, + { + value: "/testability/image/startIcon.png", + isEnabled: true, + action: () => promptAction.showToast({ message: "show toast index 1" }) + }, + ] + async aboutToAppear() { + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ComposeTitleBar({ + title: "标题", + subtitle: "副标题", + menuItems: this.menuItems, + }) + .onClick(()=>{ + if(this.toolBarVisible==Visibility.Visible){ + this.toolBarVisible=Visibility.Hidden; + promptAction.showToast({message:"Ok Open Toast",alignment:Alignment.TopStart}); + }else { + this.toolBarVisible=Visibility.Visible; + } + }) + .visibility(this.toolBarVisible) + .backgroundColor(Color.Blue) + + Text(this.Message) + .fontSize(16) + Button('显示/隐藏') + .id('button1') + .onClick(()=>{ + if(this.toolBarVisible==Visibility.Visible){ + this.toolBarVisible=Visibility.Hidden; + promptAction.showToast({message:"Ok Open Toast",alignment:Alignment.TopStart}); + }else { + this.toolBarVisible=Visibility.Visible; + } + + }) + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..02316d8d43b2aad2422994ecf57556bff10e85d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0190.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction, ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0190 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = 'Double Click'; + @State toolBarVisible: Visibility = Visibility.Visible; + + async aboutToAppear() { + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + Text(this.Message) + .fontSize(16) + Button('显示/隐藏') + .id('button1') + .onClick(() => { + if (this.toolBarVisible == Visibility.Visible) { + this.toolBarVisible = Visibility.Hidden; + promptAction.showToast({ message: "Ok Open Toast", alignment: Alignment.TopStart }); + } else { + this.toolBarVisible = Visibility.Visible; + } + + }) + + Button('改变窗口大小') + .id('button2') + .onClick(async () => { + await Settings.windowClass?.resize(700, 800); + }) + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d1c42cbb9d6251d9b43b7021f6042d1ba4da4a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction, router, ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0200 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = 'router Click'; + + async aboutToAppear() { + this.toolbarList.push({ + content: '标题:盖将自其变者而观之,然后知固非一成不变也;自其不变者而观之,然后知未始有固也', + action: () => { + }, + }) + } + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + ToolBar({ + activateIndex: 2, + toolBarList: this.toolbarList, + }) + .id('button2') + .backgroundColor(Color.Blue) + + Text(this.Message) + .fontSize(16) + Button('跳转') + .id('button1') + .onClick(() => { + router.replaceUrl({url:'testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200_1'}) + + }) + + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200_1.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200_1.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec0d52203b99f41cf6296b5d88cc5d2021091408 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200_1.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promptAction, router, ToolBar, ToolBarOptions, window } from '@kit.ArkUI' +import { common } from '@kit.AbilityKit'; +import Settings from '../../../test/model/Settings'; + + +@Entry +@Component +struct SubAceActionWindowCustomIzation0200_1 { + @State toolbarList: ToolBarOptions = new ToolBarOptions(); + @State Message: string = 'Tow Web'; + + build() { + Row() { + Stack() { + Column({ space: 6 }) { + + + Text(this.Message) + .fontSize(16) + } + }.align(Alignment.Top) + .width('100%').height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..88bbcc7036734472b477c85a0507624faa6873a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0080.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Builder +function builder1(text: string) { + Index0080({ link1: text || '' }) +} + +@Entry +@Component +struct SubAceActionWindowWindowCustom0080 { + build() { + Column() { + builder1('text') + } + } +} + +@Component +struct Index0080 { + @Prop link1: string; + + build() { + Text(this.link1) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..51f0ec71fba832e1730e83fa10b5e8e96eb82506 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0090.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Builder +function builder10090(text:string){ + builder20090(text) +} + +@Builder +function builder20090(text:string){ + Text(text) + .fontSize(50) +} + +@Entry +@Component +struct SubAceActionWindowWindowCustom0090 { + @State statel: string = 'text1'; + + @Builder + builder3(text:string) { + builder20090(text) + this.builder4(text) + } + + @Builder + builder4(text:string) { + Text(text).fontSize(50) + } + + build() { + Column() { + builder10090(this.statel ) + this.builder3(this.statel) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..41115f06fe027f8bf05d48d6f011a0f3277381df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0310.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Builder +function builder10310(text:string){ + builder20310(text) +} + +@Builder +function builder20310(text:string){ + Text(text) + .fontSize(50) +} + +@Entry +@Component +struct SubAceActionWindowWindowCustom0310 { + @State statel: string = 'text1'; + + @Builder + builder1(text:string) { + builder20310(text) + } + + + build() { + Column() { + builder10310(this.statel ) + this.builder1(this.statel) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..19c8ff2bc6dc8668fe0286ca37eaa6d19c63b9ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0320.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct SubAceActionWindowWindowCustom0320 { + controller: TextInputController = new TextInputController(); + + build() { + Column() { + Button('button') + .onClick(() => { + this.controller.setTextSelection(0, 3, { menuPolicy: MenuPolicy.SHOW }) + }) + .id('button') + TextArea({ text: 'text', controller: this.controller }) + .id('input') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..8052c3740cb6d34af1a0225a2b563b821be61bc1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0330.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct SubAceActionWindowWindowCustom0330 { + controller: TextInputController = new TextInputController(); + + build() { + Column() { + Button('button') + .onClick(() => { + this.controller.setTextSelection(0, 3, { menuPolicy: MenuPolicy.SHOW }) + }) + .id('button') + TextArea({ text: $r("app.string.message"), controller: this.controller }) + .id('input') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..a2fbec78f91d75f3203ee9f41cd7d0ffeadd3dd3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0340.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct SubAceActionWindowWindowCustom0340 { + controller: TextInputController = new TextInputController(); + + build() { + Column() { + Button('button') + .onClick(()=>{ + this.controller.setTextSelection(0, 3, {menuPolicy:MenuPolicy.SHOW}) + }) + .id('button') + TextInput({text:"123456",controller:this.controller}) + .id('input') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..b8013cac147e4820fb573da1a9a24f51b5726de5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0350.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct SubAceActionWindowWindowCustom0350 { + controller: TextInputController = new TextInputController(); + + build() { + Column() { + Button('button') + .onClick(()=>{ + this.controller.setTextSelection(0, 3, {menuPolicy:MenuPolicy.SHOW}) + }) + .id('button') + TextInput({text:"123456",controller:this.controller}) + .id('input') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..45e3a13ac62af2fe2a4705b548d71663f8174c00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0370.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct SubAceActionWindowWindowCustom0370 { + @Builder + builder1() { + Text('111').fontSize(50) + } + + build() { + Column() { + Index0370({ builderParam1: this.builder1 }) + } + } +} + +@Component +struct Index0370 { + @BuilderParam builderParam1: () => void + @BuilderParam builderParam2: () => void = this.builder2 + + @Builder + builder2() { + Text('111').fontSize(50) + } + + build() { + Column() { + this.builderParam1() + this.builderParam2() + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..dec89b8f6a1eb9f2d2344b8743ca854adadf3c62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0530.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct SubAceActionWindowWindowCustom0530 { + @State state1: string='111' + build() { + Column() { + Index0530({link1: this.state1}) + } + } +} + +@Component +struct Index0530 { + @Prop link1: string; + + build() { + Text(this.link1) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0600.ets new file mode 100644 index 0000000000000000000000000000000000000000..46552a55f37b94214b745a594232d90c0e902842 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0600.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface Params060 { + text: string +} + +@Entry +@Component +struct SubAceActionWindowWindowCustom0600 { + @State statel: string = 'text1'; + + @Builder + builder1(params: Params060) { + Text(params.text).fontSize(50) + } + + build() { + Column() { + this.builder1({ text: this.statel }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0610.ets new file mode 100644 index 0000000000000000000000000000000000000000..f656a44d001764462de61b6a5894a067d4e1da66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0610.ets @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface Params { + text: string +} + +@Entry +@Component +struct SubAceActionWindowWindowCustom0610 { + @State statel: string = 'text1'; + + @Builder + builder1(params: Params) { + Text(params.text).fontSize(50) + } + + build() { + Column() { + this.builder1({ text: this.statel }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ThemeComponentStylesSwitch/ThemeComponentStylesSwitch0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ThemeComponentStylesSwitch/ThemeComponentStylesSwitch0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..09403f5b86fe3559b38b88159c92ef090e088ab7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ThemeComponentStylesSwitch/ThemeComponentStylesSwitch0350.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 { CustomTheme, CustomColors, Theme, ThemeControl } from '@kit.ArkUI' + +class CustomColorsImpl implements CustomColors { + backgroundPrimary = Color.Red; // 自定义背景颜色 +} + +class PageCustomTheme implements CustomTheme { + colors?: CustomColors; + + constructor(colors: CustomColors) { + this.colors = colors; + } +} + +const TAG: string = 'y_yang' +const CustomColorsTheme = new PageCustomTheme(new CustomColorsImpl()) +ThemeControl.setDefaultTheme(CustomColorsTheme) // setDefaultTheme 应该在应用入口页面调用或者在 Ability 中调用 + +@Entry +@Component +struct ThemeComponentStylesSwitch0350 { + @State showDivider: boolean = false; + @State changeTheme: boolean = false; + @State textColor: ResourceColor = Color.Green; + @State columBgColor: ResourceColor = Color.Red; + + aboutToAppear(): void { + const CustomColorsTheme = new PageCustomTheme(new CustomColorsImpl()); + ThemeControl.setDefaultTheme(CustomColorsTheme); // setDefaultTheme 应该在应用入口页面调用或者在 Ability 中调用 + } + + // onWillApplyTheme 中可获取当前组件上下文的 Theme 对象 + // - 此处在 onWillApplyTheme 中将状态变量 textColor、columBgColor, + // - 赋值为当前使用的 Theme 对象 CustomColorsTheme 中的配色 + onWillApplyTheme(theme: Theme): void { + this.textColor = theme.colors.fontPrimary; + this.columBgColor = theme.colors.backgroundPrimary; + console.log(TAG, 'ThemeComponentStylesSwitch0350 onWillApplyTheme'); + } + + build() { + Column() { + Row() { + Button('Divider') + .id('btn') + .fontSize(24) + .onClick(() => { + console.log(TAG, 'click Divider'); + this.showDivider = !this.showDivider; + }) + + Button('test++') + .id('test') + .fontSize(24) + .onClick(() => { + console.log(TAG, 'click test++'); + this.changeTheme = !this.changeTheme; + }) + } + .width('100%') + .justifyContent(FlexAlign.SpaceEvenly) + + if (this.showDivider) { + // Divider 初始值配色样式 + Divider() + .strokeWidth(10)// + .backgroundColor(this.changeTheme ? this.columBgColor : $r('sys.color.background_primary')) + .margin({ top: 50 }) + } + } + .width('100%').height('100%') + } +} + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..172b8be831f3e4ea1bc7b484a6a64f33ba1a032c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0020.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { update } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct UIAttributesBackgroundSeriable0020 { + private arr:number[] = []; + @State listChildrenSize:ChildrenMainSize = new ChildrenMainSize(100); + aboutToAppear(){ + for (let i = 0; i < 8; i++) { + this.arr.push(i) + } + this.listChildrenSize.update(1,300); + } + build() { + Column() { + List({space:20}){ + ForEach(this.arr,(item:number)=>{ + ListItem(){ + Text(item+'') + .height(item == 1 ? 300 : 100) + .width('90%') + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }) + }.backgroundColor(Color.Gray) + .id('list') + .layoutWeight(1) + .scrollBar(BarState.On) + .childrenMainSize(this.listChildrenSize) + .alignListItem(ListItemAlign.Center) + } + .width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..b568e2608a3e77445d5c8405cfc6555c197fb6cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0030.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { update } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct UIAttributesBackgroundSeriable0030 { + private arr:number[] = []; + @State listChildrenSize:ChildrenMainSize = new ChildrenMainSize(100); + aboutToAppear(){ + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + this.listChildrenSize.update(2,2000); + } + build() { + Column() { + List({space:20}){ + ForEach(this.arr,(item:number)=>{ + ListItem(){ + Text(item+'') + .height(item == 2 ? 2000 : 100) + .width('90%') + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }) + }.backgroundColor(Color.Gray) + .id('list') + .layoutWeight(1) + .scrollBar(BarState.On) + .childrenMainSize(this.listChildrenSize) + .alignListItem(ListItemAlign.Center) + } + .width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..0eb6da1f66ba502d42d506626c1423a1b9ce42e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0050.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { update } from '@kit.BasicServicesKit'; + + +@Entry +@Component +struct UIAttributesBackgroundSeriable0050 { + private arr:number[] = []; + @State flag:boolean = false; + @State listChildrenSize:ChildrenMainSize = new ChildrenMainSize(100); + aboutToAppear(){ + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + build() { + Column() { + Button('动态切换item高度').onClick(()=>{ + this.flag = true; + animateTo({ + duration:1000 + },()=>{ + this.listChildrenSize.update(1,300); + }) + }).id('btn') + List({space:20}){ + ForEach(this.arr,(item:number)=>{ + ListItem(){ + Text(item+'') + .height(item == 1 && this.flag == true ? 300 : 100) + .width('90%') + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }) + }.backgroundColor(Color.Gray) + .id('list') + .layoutWeight(1) + .scrollBar(BarState.On) + .childrenMainSize(this.listChildrenSize) + .alignListItem(ListItemAlign.Center) + } + .width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..18f0cbe670b941ef2557dbc49b102112d1a91d94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0010.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0010 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.RightBottom, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..07bd4384438680b42651dbec2c3a28991ad05f76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0100 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..b66994efc8c10b02830d0e1f4c4af55f9935fe25 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0130.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0130 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.Bottom, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..769694a27c65f4e3a335c6cae413aa8446ad164b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0140.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0140 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.RightTop, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..f30319b053b5983171a1cb0f8cc4e67e6c294439 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0150.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0150 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.BottomRight, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c0e28d1d96de0be2e1fc6b81a19eef24c711ff5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0240.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0240 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.TopLeft, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..6352404b4ff88259bb379a76e45edbb86b27c7ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0280.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0280 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.Top, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..9df36081e0d2e0b000f8fd7996a5d7817b669269 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0290.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0290 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.RightBottom, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..ece5689ce7c56d92e11cc9e7d29abb5b22820e58 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0310.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0310 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.Left, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ff6a181737ce39f42036754b3ffe0488c86393a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0330.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0330 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.TopRight, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..406dbf5f16f2a26bcacc751600cb2833cd501cae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0380.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0380 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.Bottom, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..f347148ad0d0dd0748b92728d11e283faf80c8ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0450.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0450 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.BottomLeft, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ae3fab216c57191b10b46ff8fa09a6684e678a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0470.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { uiExtension, window } from '@kit.ArkUI'; +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +struct Extension0470 { + @State message: string = 'EmbeddedUIExtensionAbility Index'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + @State handlePopup: boolean = false; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: false, + placement: Placement.LeftTop, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + }.width('100%').height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7ceb19b01977480fdfe2ffa0c0ebb0f3b0822b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0010.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0010 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0010', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..78c5d371b21d0afee833d1eb6c208919a7712178 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0020.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0020 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.LeftBottom, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..1bc9156a3be34c0dd0feb6da6b0c8c3ad15cbd53 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0030.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0030 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.LeftTop, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..c91e99ee8c173df5d2ce0640b1d64a38c0704796 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0050.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0050 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.BottomRight, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7d7c622bff07978a05cd4663d741bf74776b996 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0100.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0100 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.BottomRight, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..abb8a2eb607e84a5f1cf7a117133c1d2b68cc3f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0130.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0130 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0130', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..f2c803e2d2941d11258e1e8ddda7c7a86976f2df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0140.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0140 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0140', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..6763c14bdf3821889fab7765c224342f7ab738c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0150.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0150 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0150', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ed453418a1f5b1376bb202aed6419a2033cf916 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0160.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0160 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.TopRight, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..5bb17bafc32c90b5da90b8bb46c1594afd247097 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0170.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0170 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.Bottom, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..454707ae159e4ba59c4f3f12dd3e2d47c46ab6a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0190.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0190 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.Bottom, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c98a66d61799006dedddce8996e09a4fea25254 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0240.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0240 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0240', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..4acff3ad789120bc2df10e148e8381e0dc34b217 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0270.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0270 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.RightTop, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..b35c4d6a90a3574c6fb70a9920a1df19dca60610 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0280.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0280 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0280', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..b762ed0b7575c06fd75fb8ac48edac8e814fdf04 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0290.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0290 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0290', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..9140965fd559ae9eaff0b84e49c979e08ae1b478 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0300.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0300 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.BottomRight, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..e98a859a6d9fdc8a29ef958253c3e8dc00e5e8f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0310.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0310 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0310', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..bece862fca5abb7d984c98705397c6718eab0b71 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0330.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0330 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0330', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec0793377807e0b44336fc08c2de33c70c6e03dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0380.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0380 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0380', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..15725198baf650d483698d37fd10edb63d6c65a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0410.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0410 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.Top, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..20f462206163441a0a6924603fb2e14fef16f072 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0420.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0420 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.LeftTop, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..08b69276dc289e4801ce47387a415a6bfb2031e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0430.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0430 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.BottomLeft, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..754cc9c9d5460d35d6226ff8bd89afb7fc498e59 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0440.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 { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0440 { + @State message: string = 'Message: ' + @State handlePopup: boolean = false + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + Button('PopupOptions') + .id('button') + .margin({ top: '20%' }) + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + popupColor: Color.Yellow, + showInSubWindow: true, + placement: Placement.Left, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + UIExtensionComponent(this.want) + .width('100%') + .height('50%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..518a749f28315e1325410648503b8a37c364496a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0450.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0450 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0450', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..c6a96ea675fa96b8b555b7346becb9043a372d90 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0470.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Want } from '@kit.AbilityKit'; + +@Entry +@Component +struct UIComponentPopupBoxPopupInUiExtension0470 { + @State message: string = 'Message: ' + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "ExampleUIExtAbility", + uri: 'testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0470', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + } + + build() { + Row() { + Column() { + Text('Index页面') + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .width('100%') + .height('90%') + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..266092ddc0071200b5ae0d8bf841c5c9098d90ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0460.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0460 { + @State handlePopup: boolean = false; + @State x: number = 1; + @State y: number = 1; + + @Builder popupBuilderFollowtransformoftarget0460() { + Row({ space: 2 }) { + Image($r("app.media.icon")).width(24).height(24).margin({ left: -5 }) + Text('Custom Popup').fontSize(10) + }.width(100).height(50).padding(5) + } + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 0.5; + this.y = 2; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + builder: this.popupBuilderFollowtransformoftarget0460, + placement: Placement.Top, + mask: {color:'#33000000'}, + popupColor: Color.Yellow, + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .scale({ x: this.x, y: this.y }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..7adee648c5ff709c8cb6931d08c97348924ef075 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0470.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0470 { + @State handlePopup: boolean = false; + @State matrix: matrix4.Matrix4Transit = matrix4.identity(); + + @Builder popupBuilderFollowtransformoftarget0470() { + Row({ space: 2 }) { + Image($r("app.media.icon")).width(24).height(24).margin({ left: -5 }) + Text('Custom Popup').fontSize(10) + }.width(100).height(50).padding(5) + } + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.matrix = matrix4.identity().translate({ x: 50, y: 100 }).scale({ x: 0.5, y: 2 }).rotate({angle: 90}); + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + builder: this.popupBuilderFollowtransformoftarget0470, + placement: Placement.Top, + mask: {color:'#33000000'}, + popupColor: Color.Yellow, + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .transform(this.matrix) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0480.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d406db06e718ed35ddbe36a1ee3a33c592f2fc4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0480.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0480 { + @State handlePopup: boolean = false; + @State x: number = 0; + @State y: number = 0; + + @Builder popupBuilderFollowtransformoftarget0480() { + Row({ space: 2 }) { + Image($r("app.media.icon")).width(24).height(24).margin({ left: -5 }) + Text('Custom Popup').fontSize(10) + }.width(100).height(50).padding(5) + } + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 50; + this.y = 100; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + builder: this.popupBuilderFollowtransformoftarget0480, + placement: Placement.Top, + mask: {color:'#33000000'}, + popupColor: Color.Yellow, + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .translate({ x: this.x, y: this.y }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0490.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5f37c4e18583cd22df457bf1bf8ad094712b483 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0490.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0490 { + @State handlePopup: boolean = false; + @State angle: number = 0; + + @Builder popupBuilderFollowtransformoftarget0490() { + Row({ space: 2 }) { + Image($r("app.media.icon")).width(24).height(24).margin({ left: -5 }) + Text('Custom Popup').fontSize(10) + }.width(100).height(50).padding(5) + } + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.angle = 90; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + builder: this.popupBuilderFollowtransformoftarget0490, + placement: Placement.Top, + mask: {color:'#33000000'}, + popupColor: Color.Yellow, + followTransformOfTarget: true, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .rotate({ angle: this.angle}) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..c2eba3ed4a1913f8d212b57f366b75f0300b2256 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0500.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0500 { + @State handlePopup: boolean = false; + @State x: number = 1; + @State y: number = 1; + + @Builder popupBuilderFollowtransformoftarget0500() { + Row({ space: 2 }) { + Image($r("app.media.icon")).width(24).height(24).margin({ left: -5 }) + Text('Custom Popup').fontSize(10) + }.width(100).height(50).padding(5) + } + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 0.5; + this.y = 2; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + builder: this.popupBuilderFollowtransformoftarget0500, + placement: Placement.Top, + mask: {color:'#33000000'}, + popupColor: Color.Yellow, + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .scale({ x: this.x, y: this.y }) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0890.ets new file mode 100644 index 0000000000000000000000000000000000000000..e643f7fa02362cece9e930df48ec265d75674b82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0890.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0890 { + @State handlePopup: boolean = false; + @State angle: number = 0; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.angle = 90; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .rotate({angle: this.angle}) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0900.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0900.ets new file mode 100644 index 0000000000000000000000000000000000000000..b13a2f380a1fefd38bb3ad3761f46c2ec5280340 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0900.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0900 { + @State handlePopup: boolean = false; + @State x: number = 1; + @State y: number = 1; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 0.5; + this.y = 2; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .scale({ x: this.x, y: this.y }) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0910.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0910.ets new file mode 100644 index 0000000000000000000000000000000000000000..4950f3cdd2b64ec018d9a49c63c5e61977d3f5f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0910.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0910 { + @State handlePopup: boolean = false; + @State matrix: matrix4.Matrix4Transit = matrix4.identity(); + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.matrix = matrix4.identity().translate({ x: 50, y: 100 }).scale({ x: 0.5, y: 2 }).rotate({angle: 90}); + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .transform(this.matrix) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0920.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0920.ets new file mode 100644 index 0000000000000000000000000000000000000000..a55c98c22605d709a4faed89ea902ceaefe690e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0920.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0920 { + @State handlePopup: boolean = false; + @State x: number = 0; + @State y: number = 0; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 50; + this.y = 100; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .translate({ x: this.x, y: this.y }) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0930.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0930.ets new file mode 100644 index 0000000000000000000000000000000000000000..03c1900bfe594b88f11f56f6cdb7978f538abe82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0930.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0930 { + @State handlePopup: boolean = false; + @State angle: number = 0; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.angle = 90; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .rotate({angle: this.angle}) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0940.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0940.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a1445e9f3bb262aae9af5fe6a14eaf4ec28e5df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0940.ets @@ -0,0 +1,76 @@ + /* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0940 { + @State handlePopup: boolean = false; + @State x: number = 1; + @State y: number = 1; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 0.5; + this.y = 2; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .scale({ x: this.x, y: this.y }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0950.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0950.ets new file mode 100644 index 0000000000000000000000000000000000000000..d75b2b24cff07757b5a3bc55c85642d3e92755d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0950.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0950 { + @State handlePopup: boolean = false; + @State matrix: matrix4.Matrix4Transit = matrix4.identity(); + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.matrix = matrix4.identity().translate({ x: 50, y: 100 }).scale({ x: 0.5, y: 2 }).rotate({angle: 90}); + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .transform(this.matrix) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0960.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0960.ets new file mode 100644 index 0000000000000000000000000000000000000000..abb73362935b610d858fd6f9a1faa4ad2246b53c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0960.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0960 { + @State handlePopup: boolean = false; + @State x: number = 0; + @State y: number = 0; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 50; + this.y = 100; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: null, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .translate({ x: this.x, y: this.y }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0970.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0970.ets new file mode 100644 index 0000000000000000000000000000000000000000..20770405860fc23aafef6a7570f94543f1c8132f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0970.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0970 { + @State handlePopup: boolean = false; + @State angle: number = 0; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.angle = 90; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: true, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .rotate({angle: this.angle}) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0980.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b02f41abf8bf84f24595a445a435cf378b4d208 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0980.ets @@ -0,0 +1,76 @@ + /* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget0980 { + @State handlePopup: boolean = false; + @State x: number = 1; + @State y: number = 1; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 0.5; + this.y = 2; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: true, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .scale({ x: this.x, y: this.y }) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1000.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1000.ets new file mode 100644 index 0000000000000000000000000000000000000000..2211c3bb4eae5811d3e038243718099bc1a77c15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1000.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget1000 { + @State handlePopup: boolean = false; + @State x: number = 0; + @State y: number = 0; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.x = 50; + this.y = 100; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: true, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .translate({ x: this.x, y: this.y }) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1130.ets new file mode 100644 index 0000000000000000000000000000000000000000..dcb5f95816c7e923acb339e8d219c2d4771c9163 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1130.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct UIComponentPopupboxPopupFollowtransformoftarget1130 { + @State handlePopup: boolean = false; + @State angle: number = 0; + + build() { + Column() { + Button('column') + .id('column') + .onClick(() => { + this.angle = 90; + }) + Column() { + Button('PopupOptions') + .id('button') + .onClick(() => { + this.handlePopup = true; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + messageOptions: { + textColor: Color.Red, + font: { + size: '14vp', + style: FontStyle.Italic, + weight: FontWeight.Bolder + } + }, + targetSpace: '15vp', + followTransformOfTarget: undefined, + autoCancel: false, + onStateChange: (e) => { + let timer = setTimeout(() => { + this.handlePopup = false; + }, 3000); + if (!e.isVisible) { + this.handlePopup = false; + clearTimeout(timer); + } + }, + onWillDismiss: false + }) + } + .backgroundColor(Color.Gray) + .height(100) + .width(100) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .rotate({angle: this.angle}) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..64a52fbbb71e6a6ae953377e84f959a551edaaf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0380.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0380 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + backgroundBlurStyle:BlurStyle.COMPONENT_ULTRA_THICK, + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..70d426c81ea70606a7fdcca8187c713eff074aa4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0460.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0460 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Green, + backgroundColor:Color.Pink, + shadow:{ + radius:50, + type:ShadowType.COLOR, + color:ColoringStrategy.AVERAGE, + offsetX:50, + offsetY:50, + fill:true + }, + showMode:promptAction.ToastShowMode.DEFAULT + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad878c6c8544a7e2a80037728ef11b670e757515 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0540.ets @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0540 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + backgroundBlurStyle:null, + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad33820f981fb14f6f594db10f5ab26502e58501 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0560.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0560 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + backgroundBlurStyle:BlurStyle.COMPONENT_REGULAR, + showMode:promptAction.ToastShowMode.DEFAULT + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0600.ets new file mode 100644 index 0000000000000000000000000000000000000000..80b986655713ab5a642696bcc81d3d318243093b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0600.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0600 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + backgroundBlurStyle:BlurStyle.BACKGROUND_ULTRA_THICK, + showMode:promptAction.ToastShowMode.DEFAULT + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0630.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fa54fdae27139e3d40c342d670888eb913f9efb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0630.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0630 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + backgroundBlurStyle:BlurStyle.BACKGROUND_THICK, + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0660.ets new file mode 100644 index 0000000000000000000000000000000000000000..50731b79eacdf9306fd15cc320a12b1722e7e144 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0660.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0660 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Black, + backgroundColor:Color.Transparent, + shadow:ShadowStyle.OUTER_DEFAULT_MD, + showMode:promptAction.ToastShowMode.DEFAULT + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0690.ets new file mode 100644 index 0000000000000000000000000000000000000000..c6f7a8b69757bb795cc7dc5d6ef397abb414f633 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0690.ets @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0690 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0710.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb184ee0d4e20ac5c1fb93e0b2c8df0f91187084 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0710.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0710 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + backgroundBlurStyle:BlurStyle.Thick, + shadow:ShadowStyle.OUTER_DEFAULT_LG, + showMode:promptAction.ToastShowMode.DEFAULT + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0740.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd94362d3f9161e833ccee5dfd63c6659a70d600 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0740.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0740 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + backgroundBlurStyle:BlurStyle.Regular, + shadow:ShadowStyle.OUTER_DEFAULT_SM, + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0750.ets new file mode 100644 index 0000000000000000000000000000000000000000..f71c0202c679535a7d94825a3bc661d3c1ed0a2b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0750.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0750 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + backgroundBlurStyle:BlurStyle.COMPONENT_ULTRA_THIN, + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0790.ets new file mode 100644 index 0000000000000000000000000000000000000000..92484bdb334e4295f92867e38ce22f241390e0f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0790.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0790 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + shadow:ShadowStyle.OUTER_FLOATING_SM, + backgroundBlurStyle:BlurStyle.BACKGROUND_THIN, + showMode:promptAction.ToastShowMode.DEFAULT + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0800.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0800.ets new file mode 100644 index 0000000000000000000000000000000000000000..56a48a6e655773fd47649e7c167d39e559b0308c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0800.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0800 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Green, + backgroundColor:Color.Pink, + shadow:{ + radius:50, + type:ShadowType.COLOR, + color:ColoringStrategy.PRIMARY, + offsetX:50, + offsetY:50, + fill:true + }, + backgroundBlurStyle:BlurStyle.COMPONENT_ULTRA_THIN, + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0820.ets new file mode 100644 index 0000000000000000000000000000000000000000..232242d33f89c9b813b7da24c45deb89d2c8c009 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0820.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4, promptAction } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupboxPromptSupportcustomizationstyle0820 { + build() { + Column() { + Button('TOP_MOST_toast').fontSize(30).padding(10) + .id('btn') + .onClick(()=>{ + promptAction.showToast({ + message:'Toast 显示在应用内', + textColor:Color.Red, + shadow:ShadowStyle.OUTER_FLOATING_MD, + backgroundBlurStyle:BlurStyle.BACKGROUND_REGULAR, + showMode:promptAction.ToastShowMode.TOP_MOST + }) + }) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000.ets new file mode 100644 index 0000000000000000000000000000000000000000..4f4477c84f62be794e50cc093bfe7a60cac7e559 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0010 { + @State message: string = 'EmbeddedUIExtensionAbility 0040'; + @State showMode_E: promptAction.ToastShowMode | null | undefined= undefined; + @State alignment_E: Alignment | null | undefined= undefined; + @State offsets:Offset={dx:0,dy:0}; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + private subWindow: window.Window | undefined = undefined; + + aboutToAppear(): void { + this.showMode_E = storage.get('showMode_E'); + this.alignment_E = storage.get('alignment_E'); + this.offsets=storage.get('offset_E') as Offset; + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({space:4}) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('showToast') + .id('button1') + .onFocus(()=>{ + this.message='showToast 点击'; + }) + .onClick(()=>{ + promptAction.showToast({ + message:"ok,我是Test toast", + duration:2000, + showMode: this.showMode_E, + alignment: this.alignment_E, + offset:this.offsets + }) + }) + + + }.width('100%').height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001.ets new file mode 100644 index 0000000000000000000000000000000000000000..e7a153bbaf560b4359ba4668ee18feb4a263c3c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0040 { + @State isShow: boolean = false; + @State showMode_E: promptAction.ToastShowMode | null | undefined = undefined; + @State alignment_E: Alignment | null | undefined = undefined; + @State offsets:Offset={dx:0,dy:0}; + @State sheetHeight: number = 300; + @State message: string = 'EmbeddedUIExtensionAbility 0040'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + private subWindow: window.Window | undefined = undefined; + + aboutToAppear(): void { + this.showMode_E = storage.get('showMode_E'); + this.alignment_E = storage.get('alignment_E'); + this.offsets=storage.get('offset_E') as Offset; + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('bindSheetButton') + .id('button1') + .onFocus(() => { + this.message = 'IndexButton 获取焦点'; + }) + .onClick(() => { + this.isShow = true; + }) + .bindSheet($$this.isShow, this.myBuilder(), { + height: this.sheetHeight, + backgroundColor: Color.Green, + onWillAppear: () => { + console.log("BindSheet onWillAppear.") + }, + onAppear: () => { + console.log("BindSheet onAppear.") + }, + onWillDisappear: () => { + console.log("BindSheet onWillDisappear.") + }, + onDisappear: () => { + console.log("BindSheet onDisappear.") + } + }) + + }.width('100%').height('100%') + } + + @Builder + myBuilder() { + Column() { + Button("show toast") + .id('button2') + .margin(10) + .fontSize(20) + .onClick(() => { + promptAction.showToast({ + message: "ok,我是Test toast", + duration: 2000, + showMode: this.showMode_E, + alignment: this.alignment_E, + offset:this.offsets + }) + // this.isShow = false; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..7feba50cc3ace6ff9ecbc7e9888e5e482483284b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0010.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0010 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.Center + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..a805aa521aae9ac01d74849e9f975e7e72ea7022 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0020.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0020 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.Center + } + }; + + build() { + + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..7281e759aa7736e49aebeda2c50457a0bff77222 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0030.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0030 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.Start + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..a4b71cc4eb32073c59a3e590a48f68c732b91d83 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0040.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0040 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.TopStart + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..523344d65f74f64141bfeb104828094e8f7113a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0050.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0050 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.BottomEnd + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..e75b177f038b6e4aefac5f702449083bb62c166a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0060.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0060 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.Bottom + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..666beb7b6670c21ae54b6183634c0c8a5363d1fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0070.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0070 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.TopStart + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba309b725e161e9ab34e8c8e45fb7bd9206e0ca4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0080.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0080 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.End + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..266bb2d26b21d0d63b062dd8fd3cdab2f48d3f7b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0090.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0090 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.Bottom + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..60cff288ff0613959949ec1d97693465bbb51c3b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0100.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0100 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":'null' + } + }; + + aboutToAppear(): void { + // Settings.windowClass?.resize(600, 600); + } + + build() { + + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('50%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b061e94fa034b90a0ec2c08ed43837fc0e24053 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0110.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0110 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":'null' + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..6162501af84b3e2d32daf3f8b6866136ce135ba7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0120.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0120 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.Top, + "offsets": {dx:0,dy:-200 } + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc4502c39d5f96f7775046a63427a5728803a27e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0130.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0130 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":"undefined" + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..d6af1a34e2008cfe10e5d84553e166f1500fe589 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0140.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0140 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.Top + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..93f10216af5c6591625ad53e99f84a2e23954811 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0150.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0150 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.TopStart + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(600, 700); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebbf28d29651ded657523ae4bba6b880dd5262d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0160.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0160 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.TopStart + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c5bd3f5018a1093157a3e34b8fdad54e386c97e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0170.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0170 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.Center + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..dccfefd6fd372570d3d5006880663bedfbd7a595 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0180.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0180 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.BottomEnd + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d83e3e385656c70fbc8ff9faeec88b86ffc0500 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0190.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0190 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri:'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.TopStart + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..05016ae9ceb2c5b5daca385e6a4a2576cc2c8c3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0200.ets @@ -0,0 +1,247 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + FoldSplitContainer, + PresetSplitRatio, + ExtraRegionPosition, + ExpandedRegionLayoutOptions, + HoverModeRegionLayoutOptions, + FoldedRegionLayoutOptions, + promptAction +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Component +struct Region { + @Prop title: string; + @BuilderParam content: () => void; + @Prop compBackgroundColor: string; + + build() { + Column({ space: 8 }) { + Text(this.title) + .fontSize("24fp") + .fontWeight(600) + + Scroll() { + this.content() + } + .layoutWeight(1) + .width("100%") + } + .backgroundColor(this.compBackgroundColor) + .width("100%") + .height("100%") + .padding(12) + } +} + +interface RadioOptions { + label: string; + value: Object | undefined | null; + onChecked: () => void; +} + +@Component +struct RadioOption { + @Prop label: string; + @Prop value: Object | undefined | null; + @Prop options: Array; + + build() { + Row() { + Text(this.label) + Blank() + Column({ space: 4 }) { + ForEach(this.options, (option: RadioOptions) => { + Row() { + Radio({ + group: this.label, + value: JSON.stringify(option.value), + }) + .checked(this.value === option.value) + .onChange((checked) => { + if (checked) { + option.onChecked(); + } + }) + Text(option.label) + } + }) + } + .alignItems(HorizontalAlign.Start) + } + .alignItems(VerticalAlign.Top) + .backgroundColor(Color.White) + .borderRadius(8) + .padding(8) + .width("100%") + } +} + +@Entry +@Component +struct UIComponentPopupboxPromptactionUiextension0200 { + @State expandedRegionLayoutOptions: ExpandedRegionLayoutOptions = { + horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, + verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1, + isExtraRegionPerpendicular: true, + extraRegionPosition: ExtraRegionPosition.TOP + }; + @State foldingRegionLayoutOptions: HoverModeRegionLayoutOptions = { + horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, + showExtraRegion: false, + extraRegionPosition: ExtraRegionPosition.TOP + }; + @State foldedRegionLayoutOptions: FoldedRegionLayoutOptions = { + verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1 + }; + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E": promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E": Alignment.Center + } + }; + + @Builder + MajorRegion() { + Region({ + title: "折叠态配置", + compBackgroundColor: "rgba(255, 0, 0, 0.1)", + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + @Builder + MinorRegion() { + Region({ + title: "悬停态配置", + compBackgroundColor: "rgba(0, 255, 0, 0.1)" + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + @Builder + ExtraRegion() { + Region({ + title: "展开态配置", + compBackgroundColor: "rgba(0, 0, 255, 0.1)" + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + build() { + Column() { + FoldSplitContainer({ + primary: () => { + this.MajorRegion() + }, + secondary: () => { + this.MinorRegion() + }, + extra: () => { + this.ExtraRegion() + }, + expandedLayoutOptions: this.expandedRegionLayoutOptions, //展开 + hoverModeLayoutOptions: this.foldingRegionLayoutOptions, //悬停 + foldedLayoutOptions: this.foldedRegionLayoutOptions, //折叠 + }) + } + .width("100%") + .height("100%") + } + + private changeSize() { + + + Settings.windowClass?.resize(600, 600); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..4400e1c07cf19ceb93707054fbf5165d17584edd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0210.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0210 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.Top, + "offsets": {dx:0,dy:-200 } + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..0306fea9f0ae70f6bdff7b70d81382e67eef5999 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0220.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0220 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.TopEnd + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..434dd960395dcd34c9ad459fe399cbf7136452e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0230.ets @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + FoldSplitContainer, + PresetSplitRatio, + ExtraRegionPosition, + ExpandedRegionLayoutOptions, + HoverModeRegionLayoutOptions, + FoldedRegionLayoutOptions, + promptAction +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Component +struct Region { + @Prop title: string; + @BuilderParam content: () => void; + @Prop compBackgroundColor: string; + + build() { + Column({ space: 8 }) { + Text(this.title) + .fontSize("24fp") + .fontWeight(600) + + Scroll() { + this.content() + } + .layoutWeight(1) + .width("100%") + } + .backgroundColor(this.compBackgroundColor) + .width("100%") + .height("100%") + .padding(12) + } +} + + +interface RadioOptions { + label: string; + value: Object | undefined | null; + onChecked: () => void; +} + +@Component +struct RadioOption { + @Prop label: string; + @Prop value: Object | undefined | null; + @Prop options: Array; + + build() { + Row() { + Text(this.label) + Blank() + Column({ space: 4 }) { + ForEach(this.options, (option: RadioOptions) => { + Row() { + Radio({ + group: this.label, + value: JSON.stringify(option.value), + }) + .checked(this.value === option.value) + .onChange((checked) => { + if (checked) { + option.onChecked(); + } + }) + Text(option.label) + } + }) + } + .alignItems(HorizontalAlign.Start) + } + .alignItems(VerticalAlign.Top) + .backgroundColor(Color.White) + .borderRadius(8) + .padding(8) + .width("100%") + } +} + +@Entry +@Component +struct UIComponentPopupboxPromptactionUiextension0230 { + @State expandedRegionLayoutOptions: ExpandedRegionLayoutOptions = { + horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, + verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1, + isExtraRegionPerpendicular: true, + extraRegionPosition: ExtraRegionPosition.TOP + }; + @State foldingRegionLayoutOptions: HoverModeRegionLayoutOptions = { + horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, + showExtraRegion: false, + extraRegionPosition: ExtraRegionPosition.TOP + }; + @State foldedRegionLayoutOptions: FoldedRegionLayoutOptions = { + verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1 + }; + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.Center + } + }; + + @Builder + MajorRegion() { + Region({ + title: "折叠态配置", + compBackgroundColor: "rgba(255, 0, 0, 0.1)", + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + @Builder + MinorRegion() { + Region({ + title: "悬停态配置", + compBackgroundColor: "rgba(0, 255, 0, 0.1)" + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + @Builder + ExtraRegion() { + Region({ + title: "展开态配置", + compBackgroundColor: "rgba(0, 0, 255, 0.1)" + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + + + + build() { + Column() { + FoldSplitContainer({ + primary: () => { + this.MajorRegion() + }, + secondary: () => { + this.MinorRegion() + }, + extra: () => { + this.ExtraRegion() + }, + expandedLayoutOptions: this.expandedRegionLayoutOptions,//展开 + hoverModeLayoutOptions: this.foldingRegionLayoutOptions,//悬停 + foldedLayoutOptions: this.foldedRegionLayoutOptions,//折叠 + }) + } + .width("100%") + .height("100%") + } + + private changeSize() { + + + Settings.windowClass?.resize(600, 600); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..c238c1e3e1b810edf0dad7ba1873e1238f9e55a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0240.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0240 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.BottomStart + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..b57a49863bb272bfbf56a1d41422d47cd91b59f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0250.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0250 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.Start + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e7b0a9d793bd2e88e6555138d88b63a3d473ebe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0260.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0260 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.Bottom + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..e21068413eb234ca11d9f73d60e9464496f8d53a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0270.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0270 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.TopEnd + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..e6f5072a5752c123199ae9e12d1e027a3b594d60 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0280.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0280 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.BottomStart + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..f0c84cfce5b9093077c1203d9688b06e53cd333b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0290.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0290 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.BottomEnd + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..b68b2ee87ae9cdb909b014c2b72dfe324cdf3250 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0300.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0300 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.TopEnd + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8d80af6df636c3c967c16469e04812bbb7229a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0310.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0310 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.End + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..a84b7a4a971503dba76338bff63b453da1112b48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0320.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0320 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":Alignment.Start + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..aca18cd0b6d135aeb9a32afd72fd4eaa618ccee9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0330.ets @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + FoldSplitContainer, + PresetSplitRatio, + ExtraRegionPosition, + ExpandedRegionLayoutOptions, + HoverModeRegionLayoutOptions, + FoldedRegionLayoutOptions, + promptAction +} from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; + +@Component +struct Region { + @Prop title: string; + @BuilderParam content: () => void; + @Prop compBackgroundColor: string; + + build() { + Column({ space: 8 }) { + Text(this.title) + .fontSize("24fp") + .fontWeight(600) + + Scroll() { + this.content() + } + .layoutWeight(1) + .width("100%") + } + .backgroundColor(this.compBackgroundColor) + .width("100%") + .height("100%") + .padding(12) + } +} + + +interface RadioOptions { + label: string; + value: Object | undefined | null; + onChecked: () => void; +} + +@Component +struct RadioOption { + @Prop label: string; + @Prop value: Object | undefined | null; + @Prop options: Array; + + build() { + Row() { + Text(this.label) + Blank() + Column({ space: 4 }) { + ForEach(this.options, (option: RadioOptions) => { + Row() { + Radio({ + group: this.label, + value: JSON.stringify(option.value), + }) + .checked(this.value === option.value) + .onChange((checked) => { + if (checked) { + option.onChecked(); + } + }) + Text(option.label) + } + }) + } + .alignItems(HorizontalAlign.Start) + } + .alignItems(VerticalAlign.Top) + .backgroundColor(Color.White) + .borderRadius(8) + .padding(8) + .width("100%") + } +} + +@Entry +@Component +struct UIComponentPopupboxPromptactionUiextension0330 { + @State expandedRegionLayoutOptions: ExpandedRegionLayoutOptions = { + horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, + verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1, + isExtraRegionPerpendicular: true, + extraRegionPosition: ExtraRegionPosition.TOP + }; + @State foldingRegionLayoutOptions: HoverModeRegionLayoutOptions = { + horizontalSplitRatio: PresetSplitRatio.LAYOUT_3V2, + showExtraRegion: false, + extraRegionPosition: ExtraRegionPosition.TOP + }; + @State foldedRegionLayoutOptions: FoldedRegionLayoutOptions = { + verticalSplitRatio: PresetSplitRatio.LAYOUT_1V1 + }; + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.Center + } + }; + + @Builder + MajorRegion() { + Region({ + title: "折叠态配置", + compBackgroundColor: "rgba(255, 0, 0, 0.1)", + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + @Builder + MinorRegion() { + Region({ + title: "悬停态配置", + compBackgroundColor: "rgba(0, 255, 0, 0.1)" + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + @Builder + ExtraRegion() { + Region({ + title: "展开态配置", + compBackgroundColor: "rgba(0, 0, 255, 0.1)" + }) { + Column({ space: 4 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .constraintSize({ minHeight: "100%" }) + } + } + + + + + build() { + Column() { + FoldSplitContainer({ + primary: () => { + this.MajorRegion() + }, + secondary: () => { + this.MinorRegion() + }, + extra: () => { + this.ExtraRegion() + }, + expandedLayoutOptions: this.expandedRegionLayoutOptions,//展开 + hoverModeLayoutOptions: this.foldingRegionLayoutOptions,//悬停 + foldedLayoutOptions: this.foldedRegionLayoutOptions,//折叠 + }) + } + .width("100%") + .height("100%") + } + + private changeSize() { + + + Settings.windowClass?.resize(600, 600); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba859722197d9f0993339869dce20d47b6c33761 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0340.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0340 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.BottomStart + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5447785efef406c40b1a79408f8d07bc31cd2bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0350.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0350 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":"undefined" + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..48e2fd49c1775b2058f4b4045db802a513d00b8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0360.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0360 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.Top + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4da18640342687a04dc6650f96b626ae5c26504 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0370.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { common, Want } from '@kit.AbilityKit' +import { promptAction, window } from '@kit.ArkUI'; +import { settings } from '@kit.BasicServicesKit'; +import Settings from '../../../test/model/Settings'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0370 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.SYSTEM_TOP_MOST, + "alignment_E":"undefined" + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + Button('changeSize') + .id('button0') + .onClick(() => { + this.changeSize(); + }) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + + private changeSize() { + + + Settings.windowClass?.resize(300, 400); + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..063a2022dab4bb0ef222f4d633d5a78a96df4c45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0380.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0380 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.TopStart + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..16aebf1820837306de26867242e26d761d638591 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0390.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0390 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":Alignment.End + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..54b27f6296b8c2c2777903f20278063bc1fecc96 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0400.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0400 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.DEFAULT, + "alignment_E":"null" + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d177a225fbe1a6e19db272631f021ac2b8ef0bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0410.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxPromptactionUiextension0410 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxPromptactionUiextensionAbility", + uri: 'testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + "showMode_E":promptAction.ToastShowMode.TOP_MOST, + "alignment_E":Alignment.Top + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..987989fa9236ac0ea4c2555472300c24f5c04507 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0040.ets @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0040 { + @State message: string = 'EmbeddedUIExtensionAbility 0040'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + private subWindow: window.Window | undefined = undefined; + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + }, + confirm: () => { + } + }), + autoCancel: true, + alignment: DialogAlignment.Center, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + showInSubWindow: false, + isModal: true, + customStyle: false, + cornerRadius: 10, + }) + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('CustomDialog') + .id('button1') + .onFocus(() => { + this.message = 'CustomDialog-->点击'; + }) + .onClick(() => { + this.dialogController?.open(); + }) + + + }.width('100%').height('100%') + } +} + +@CustomDialog +struct CustomDialogExample { + @State Mesasge:string='自定义弹窗'; + controller?: CustomDialogController; + cancel: () => void = () => { + }; + confirm: () => void = () => { + }; + + build() { + Column() { + Text(this.Mesasge) + .fontSize(30) + .height(100) + Button('点我打开二级弹窗->showInSubWindow:true') + .id('button2') + .onClick(() => { + if (this.controller != undefined) { + this.Mesasge+='已点击二级弹窗' + AlertDialog.show({ message: "tow AlertDialog Open", showInSubWindow: true }) + } + }) + .margin(20) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..db39a5eb5069cd5c481ee8126b8ce23afbb71500 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0120.ets @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0120 { + @State message: string = 'EmbeddedUIExtensionAbility 0120'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + private subWindow: window.Window | undefined = undefined; + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + }, + confirm: () => { + } + }), + autoCancel: true, + alignment: DialogAlignment.Center, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + showInSubWindow: false, + isModal: true, + customStyle: false, + cornerRadius: 10, + }) + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('CustomDialog') + .id('button1') + .onFocus(() => { + this.message = 'CustomDialog-->点击'; + }) + .onClick(() => { + this.dialogController?.open(); + }) + + + }.width('100%').height('100%') + } +} + +@CustomDialog +struct CustomDialogExample { + @State Mesasge:string='自定义弹窗'; + controller?: CustomDialogController; + cancel: () => void = () => { + }; + confirm: () => void = () => { + }; + + build() { + Column() { + Text(this.Mesasge) + .fontSize(30) + .height(100) + Button('close CustomDialog') + .id('button2') + .onClick(() => { + if (this.controller != undefined) { + this.Mesasge+='close CustomDialog' + this.controller.close(); + } + }) + .margin(20) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..c682aca2467227a4fa54f7bc8f1bc485c8d45f24 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0130.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0130 { + @State message: string = 'EmbeddedUIExtensionAbility 0120'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('AlertDialog') + .id('button1') + .onFocus(() => { + this.message = 'AlertDialog-->点击'; + }) + .onClick(() => { + AlertDialog.show( + { + message: 'AlertDialog Open', + showInSubWindow: false, + confirm: { + value: "close_AlertDialog", + action: () => { + } + } + } + ) + }) + + + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4420fbf6a61c85b4c152c8e462b436b1ac34907 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0230.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0230 { + @State message: string = 'EmbeddedUIExtensionAbility 0040'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + private subWindow: window.Window | undefined = undefined; + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + }, + confirm: () => { + } + }), + autoCancel: true, + alignment: DialogAlignment.Center, + maskRect:{x: 30,y: 30,width: '80%',height: '80%'}, + gridCount: 4, + showInSubWindow: false, + isModal: true, + customStyle: false, + cornerRadius: 10, + }) + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('CustomDialog') + .id('button1') + .onFocus(() => { + this.message = 'CustomDialog-->点击'; + }) + .onClick(() => { + this.dialogController?.open(); + }) + + + }.width('100%').height('100%') + } +} + +@CustomDialog +struct CustomDialogExample { + @State Mesasge:string='自定义弹窗'; + controller?: CustomDialogController; + cancel: () => void = () => { + }; + confirm: () => void = () => { + }; + + build() { + Column() { + Text(this.Mesasge) + .fontSize(30) + .height(100) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8ea068eb21f1dad547d94babe1ca6c9c2a597e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0240.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0240 { + @State message: string = 'EmbeddedUIExtensionAbility 0240'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + private subWindow: window.Window | undefined = undefined; + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + }, + confirm: () => { + } + }), + autoCancel: true, + alignment: DialogAlignment.Center, + maskRect: { + x: 15, + y: 30, + width: "90%", + height: '80%' + }, + gridCount: 4, + showInSubWindow: false, + isModal: true, + customStyle: false, + cornerRadius: 10, + }) + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('CustomDialog') + .id('button1') + .onFocus(() => { + this.message = 'CustomDialog-->点击'; + }) + .onClick(() => { + this.dialogController?.open(); + }) + + + }.width('100%').height('100%') + } +} + +@CustomDialog +struct CustomDialogExample { + @State Mesasge: string = '自定义弹窗'; + controller?: CustomDialogController; + cancel: () => void = () => { + }; + confirm: () => void = () => { + }; + + build() { + Column() { + Text(this.Mesasge) + .fontSize(30) + .height(100) + Button('点我打开二级弹窗->showInSubWindow:true') + .id('button2') + .onClick(() => { + if (this.controller != undefined) { + this.Mesasge += '已点击二级弹窗' + AlertDialog.show({ message: "tow AlertDialog Open", showInSubWindow: true }) + } + }) + .margin(20) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..a6e2a7f7a45751c083499cc9fd0711d37d1f3165 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0250.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0250 { + @State message: string = 'EmbeddedUIExtensionAbility 0120'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('showDialog') + .id('button1') + .onFocus(() => { + this.message = 'showDialog-->点击'; + }) + .onClick(() => { + promptAction.showDialog({ + title:'showDialog', + message:"ok,我是Test showDialog", + showInSubWindow:false, + maskRect:{x: 30,y: 30,width: '80%',height: '80%'} + + }) + + }) + + + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa8947ebb44c2ff0fbf6539b394aebcc65684e14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0260.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 { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0260 { + @State message: string = 'EmbeddedUIExtensionAbility 0260'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('showDialog') + .id('button1') + .onFocus(() => { + this.message = 'showDialog-->点击'; + }) + .onClick(() => { + ActionSheet.show({ // 建议使用 this.getUIContext().showActionSheet()接口 + title: 'ActionSheet title', + subtitle: 'ActionSheet subtitle', + message: 'message', + autoCancel: true, + confirm: { + defaultFocus: true, + value: 'Confirm button', + action: () => { + console.log('Get Alert Dialog handled') + } + }, + cancel: () => { + console.log('actionSheet canceled') + }, + onWillDismiss:(dismissDialogAction: DismissDialogAction)=> { + console.info("reason=" + JSON.stringify(dismissDialogAction.reason)) + console.log("dialog onWillDismiss") + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss() + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss() + } + }, + alignment: DialogAlignment.Bottom, + maskRect: { + x: 15, + y: 30, + width: "90%", + height: '80%' + }, + sheets: [ + { + title: 'apples', + action: () => { + console.log('apples') + } + }, + { + title: 'bananas', + action: () => { + console.log('bananas') + } + }, + { + title: 'pears', + action: () => { + console.log('pears') + } + } + ] + }) + }) + + + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..e716ac78db5950bd7b75cf86055627d0876a95d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0270.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0270 { + @State message: string = 'EmbeddedUIExtensionAbility 0270'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('AlertDialog') + .id('button1') + .onFocus(() => { + this.message = 'AlertDialog-->点击'; + }) + .onClick(() => { + AlertDialog.show({ + title:'showDialog', + message:"ok,我是Test AlertDialog", + showInSubWindow:false, + maskRect:{x: 30,y: 30,width: '80%',height: '80%'} + + }) + + }) + + + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c41c62ba6ad334e0580892a07e83cbfec02631b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0280.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { prompt, promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0280 { + @State message: string = 'EmbeddedUIExtensionAbility 0280'; + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + private subWindow: window.Window | undefined = undefined; + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('showActionMenu') + .id('button1') + .onFocus(() => { + this.message = 'CustomDialog-->点击'; + }) + .onClick(() => { + promptAction.showActionMenu({ + title: 'showActionMenu Title Info', + buttons: [ + { + text: 'item1', + color: '#666666' + }, + { + text: 'item2', + color: '#000000' + }, + ] + }) + .then(() => { + console.info('showActionMenu success, click button: '); + }) + .catch((err: Error) => { + console.info('showActionMenu error: ' + err); + }) + }) + + + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..92f6e60200d6cb60bb9fcd28629982cfa4701cec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0300.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0300 { + @State message: string = 'EmbeddedUIExtensionAbility 0270'; + private aligns: Record[] = [ + { 'Top': DialogAlignment.Top }, + { 'Center': DialogAlignment.Center }, + { 'Bottom': DialogAlignment.Bottom }, + { 'Default': DialogAlignment.Default }, + { 'TopStart': DialogAlignment.TopStart }, + { 'TopEnd': DialogAlignment.TopEnd }, + { 'CenterStart': DialogAlignment.CenterStart }, + { 'CenterEnd': DialogAlignment.CenterEnd }, + { 'BottomStart': DialogAlignment.BottomStart }, + { 'BottomEnd': DialogAlignment.BottomEnd } + ] + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('AlertDialog') + .id('button1') + .onFocus(() => { + this.message = 'AlertDialog-->点击'; + }) + .onClick(() => { + AlertDialog.show({ + title: 'showDialog', + message: "ok,我是Test AlertDialog", + showInSubWindow: false, + alignment: DialogAlignment.Top + }) + }) + Grid() { + ForEach(this.aligns, (item: Record) => { + GridItem() { + Button(this.ansyAlign(item)[0]) + .type(ButtonType.Normal) + .id(this.ansyAlign(item)[0] + 'Align') + .onClick(() => { + AlertDialog.show({ + title: 'showDialogT1', + message: "ok,我是Test AlertDialog", + showInSubWindow: false, + autoCancel:true, + alignment: this.ansyAlign(item)[1] + }) + + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + .id('button2') + .width('100%').height('100%') + } + + ansyAlign(item: Record): [string, DialogAlignment] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..80557102c9c63d2260dbd62a80394a9f4ce78e7b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0310.ets @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0330 { + @State message: string = 'EmbeddedUIExtensionAbility 0270'; + private aligns: Record[] = [ + { 'Top': DialogAlignment.Top }, + { 'Center': DialogAlignment.Center }, + { 'Bottom': DialogAlignment.Bottom }, + { 'Default': DialogAlignment.Default }, + { 'TopStart': DialogAlignment.TopStart }, + { 'TopEnd': DialogAlignment.TopEnd }, + { 'CenterStart': DialogAlignment.CenterStart }, + { 'CenterEnd': DialogAlignment.CenterEnd }, + { 'BottomStart': DialogAlignment.BottomStart }, + { 'BottomEnd': DialogAlignment.BottomEnd } + ] + @State dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + }, + confirm: () => { + } + }), + autoCancel: true, + alignment: DialogAlignment.Center, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + showInSubWindow: false, + isModal: true, + customStyle: false, + cornerRadius: 10, + }) + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('CustomDialog') + .id('button1') + .onFocus(() => { + this.message = 'AlertDialog-->点击'; + }) + .onClick(() => { + this.dialogController?.open(); + }) + Grid() { + ForEach(this.aligns, (item: Record) => { + GridItem() { + Button(this.ansyAlign(item)[0]) + .type(ButtonType.Normal) + .id(this.ansyAlign(item)[0] + 'Align') + .onClick(() => { + this.dialogController = new CustomDialogController({ + builder: CustomDialogExample({ + cancel: () => { + }, + confirm: () => { + } + }), + autoCancel: true, + alignment: this.ansyAlign(item)[1], + offset: { dx: 0, dy: -20 }, + gridCount: 4, + showInSubWindow: false, + isModal: true, + customStyle: false, + cornerRadius: 10, + }); + this.dialogController.open(); + + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + .id('button2') + .width('100%').height('100%') + } + + ansyAlign(item: Record): [string, DialogAlignment] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} + +@CustomDialog +struct CustomDialogExample { + @State Mesasge: string = '自定义弹窗'; + controller?: CustomDialogController; + cancel: () => void = () => { + }; + confirm: () => void = () => { + }; + + build() { + Column() { + Text(this.Mesasge) + .fontSize(30) + .height(100) + Button('点我打开二级弹窗->showInSubWindow:true') + .id('button2') + .onClick(() => { + if (this.controller != undefined) { + this.Mesasge += '已点击二级弹窗' + AlertDialog.show({ message: "tow AlertDialog Open", showInSubWindow: true }) + } + }) + .margin(20) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..6561a30a3caa4e7d4a1d3224ee2493a1c463004e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0320.ets @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0320 { + private customDialogComponentId: number = 0; + @State message: string = 'EmbeddedUIExtensionAbility 0270'; + private aligns: Record[] = [ + { 'Top': DialogAlignment.Top }, + { 'Center': DialogAlignment.Center }, + { 'Bottom': DialogAlignment.Bottom }, + { 'Default': DialogAlignment.Default }, + { 'TopStart': DialogAlignment.TopStart }, + { 'TopEnd': DialogAlignment.TopEnd }, + { 'CenterStart': DialogAlignment.CenterStart }, + { 'CenterEnd': DialogAlignment.CenterEnd }, + { 'BottomStart': DialogAlignment.BottomStart }, + { 'BottomEnd': DialogAlignment.BottomEnd } + ] + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('openCustomDialog') + .id('button1') + .onFocus(() => { + this.message = 'openCustomDialog-->点击'; + }) + .onClick(() => { + AlertDialog.show({ + title: 'showDialog', + message: "ok,我是Test AlertDialog", + showInSubWindow: false, + alignment: DialogAlignment.Top + }) + }) + Grid() { + ForEach(this.aligns, (item: Record) => { + GridItem() { + Button(this.ansyAlign(item)[0]) + .type(ButtonType.Normal) + .id(this.ansyAlign(item)[0] + 'Align') + .onClick(() => { + promptAction.openCustomDialog({ + builder: () => { + this.customDialogComponent() + }, + showInSubWindow:false, + autoCancel:true, + alignment:this.ansyAlign(item)[1], + onWillDismiss: (dismissDialogAction: DismissDialogAction) => { + console.info("reason" + JSON.stringify(dismissDialogAction.reason)) + console.log("dialog onWillDismiss") + if (dismissDialogAction.reason == DismissReason.PRESS_BACK) { + dismissDialogAction.dismiss() + } + if (dismissDialogAction.reason == DismissReason.TOUCH_OUTSIDE) { + dismissDialogAction.dismiss() + } + } + }).then((dialogId: number) => { + this.customDialogComponentId = dialogId + }) + + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + .id('button2') + .width('100%').height('100%') + } + @Builder customDialogComponent() { + Column() { + Text('弹窗').fontSize(30) + Row({ space: 50 }) { + Button("确认").onClick(() => { + promptAction.closeCustomDialog(this.customDialogComponentId) + }) + Button("取消").onClick(() => { + promptAction.closeCustomDialog(this.customDialogComponentId) + }) + } + }.height(200).padding(5).justifyContent(FlexAlign.SpaceBetween) + } + + ansyAlign(item: Record): [string, DialogAlignment] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b4d5f96d3486f6eefd40bde370c9e1a9e7a324e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0330.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIExtensionContentSession } from '@kit.AbilityKit'; +import { promptAction, uiExtension, window } from '@kit.ArkUI'; + +let storage = LocalStorage.getShared() + +@Entry(storage) +@Component +export struct Extension0330 { + @State message: string = 'EmbeddedUIExtensionAbility 0270'; + private aligns: Record[] = [ + { 'Top': DialogAlignment.Top }, + { 'Center': DialogAlignment.Center }, + { 'Bottom': DialogAlignment.Bottom }, + { 'Default': DialogAlignment.Default }, + { 'TopStart': DialogAlignment.TopStart }, + { 'TopEnd': DialogAlignment.TopEnd }, + { 'CenterStart': DialogAlignment.CenterStart }, + { 'CenterEnd': DialogAlignment.CenterEnd }, + { 'BottomStart': DialogAlignment.BottomStart }, + { 'BottomEnd': DialogAlignment.BottomEnd } + ] + private session: UIExtensionContentSession | undefined = storage.get('session'); + private extensionWindow: uiExtension.WindowProxy | undefined = this.session?.getUIExtensionWindowProxy(); + + aboutToAppear(): void { + this.extensionWindow?.on('windowSizeChange', (size: window.Size) => { + console.info(`size = ${JSON.stringify(size)}`); + }); + this.extensionWindow?.on('avoidAreaChange', (info: uiExtension.AvoidAreaInfo) => { + console.info(`type = ${JSON.stringify(info.type)}, area = ${JSON.stringify(info.area)}`); + }); + } + + aboutToDisappear(): void { + this.extensionWindow?.off('windowSizeChange'); + this.extensionWindow?.off('avoidAreaChange'); + storage.clear(); + } + + build() { + Column({ space: 4 }) { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + + Button('AlertDialog') + .id('button1') + .onFocus(() => { + this.message = 'AlertDialog-->点击'; + }) + .onClick(() => { + promptAction.showDialog({ + title: 'showDialog', + message: "ok,我是Test AlertDialog", + showInSubWindow: false, + alignment: DialogAlignment.Top + }) + }) + Grid() { + ForEach(this.aligns, (item: Record) => { + GridItem() { + Button(this.ansyAlign(item)[0]) + .type(ButtonType.Normal) + .id(this.ansyAlign(item)[0] + 'Align') + .onClick(() => { + AlertDialog.show({ + title: 'showDialogT1', + message: "ok,我是Test AlertDialog", + showInSubWindow: false, + autoCancel:true, + alignment: this.ansyAlign(item)[1] + }) + + }) + } + .margin(2) + }) + } + .columnsTemplate('1fr 1fr 1fr') + + } + .id('button2') + .width('100%').height('100%') + } + + ansyAlign(item: Record): [string, DialogAlignment] { + const name = Object.keys(item)[0]; // 获取第一个(也是唯一一个)键 + const value = item[name]; // 获取对应的值 + return [name, value]; + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..09b51012b6f67f5db44d1e9c6804a4a9d54ee037 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0040.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0040 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0040', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..49e3c37b75bde4621d09b68828129a05e988dad9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0120.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0120 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0120', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..32cad3e8e0757d199196e39fba5360099b5be793 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0130.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0130 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0130', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..d375cab19bfb9110a8130eb9a46a16b991a183cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0230.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0230 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0230', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..3021e38a96c3f205c2b251a0594c8260fb842178 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0240.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0240 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0240', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a6fc5cac09e4d31685aaff173b99c74ba26486e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0250.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0250 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0250', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec4e76c03f7bf864e77c13ef6998fe6ea66f910d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0260.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0260 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0260', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4ab32945cda68fcc2a19e996da8a5587a4b7619 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0270.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0270 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0250', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d3957bc4603510210fc0bea6438c1c0114904a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0280.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0280 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0280', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac995e1cf639d1b70d77ba8fa05f63297662b0e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0300.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0300 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0300', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..b821248457e5b5b15c75be95d35eed85baa239e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0310.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0310 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0310', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a99ebf26d6bbd5ae2f7a094a46557b7698171e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0320.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 { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0320 { + @State message: string = 'Message: '; + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri: 'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0320', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({ space: 3 }) { + Text(this.message).fontSize(30) + + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(() => { + this.message = 'UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..da2b4c50e30811358b615f50f73906b59a758da8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0330.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '@kit.AbilityKit' +import { promptAction } from '@kit.ArkUI'; + +@Component +@Entry +struct UIComponentPopupboxSpecificationsAlignment0330 { + @State message: string = 'Message: '; + + private want: Want = { + bundleName: "com.example.uicompare", + abilityName: "UIComponentPopupboxSpecificationsAlignmentAbility", + uri:'testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0330', + parameters: { + "ability.want.params.uiExtensionType": "sys/commonUI", + } + }; + + build() { + Column({space:3}) { + Text(this.message).fontSize(30) + + UIExtensionComponent(this.want) + .id('EmbeddedComponentID') + .height('50%') + .width('90%') + .backgroundColor(Color.Orange) + .onFocus(()=>{ + this.message='UIExtensionComponent 事件触发' + }) + .onTerminated((info) => { + this.message = 'Termination: code = ' + info.code + ', want = ' + JSON.stringify(info.want); + }) + .onError((error) => { + this.message = 'Error: code = ' + error.code; + }) + } + .width('100%') + .height('100%') + } + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetComponentUtils0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetComponentUtils0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb4ddbc33c27c8df03d0d5d5a7eeb7b44f9b9b73 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetComponentUtils0010.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, typeNode } from '@ohos.arkui.node'; +import { componentUtils } from '@kit.ArkUI'; + +class MyNodeController4 extends NodeController { + @Track text: string = "change size"; + @Track widthSize: number = 250 + @Track heightSize: number = 100 + @Track flag: boolean = true + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width('100%') + .height('100%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + + let col1 = typeNode.createNode(uiContext, 'Column'); + col1.initialize({ space: 10 }) + .width('100%') + .height('95%') + .alignItems(HorizontalAlign.Center) + .margin(20); + node.appendChild(col1); + let button1 = typeNode.createNode(uiContext, 'Button') + + + button1.initialize("getComponentUtils") + .id('button1') + .margin(20) + .onClick(async () => { + + }) + col1.appendChild(button1); + return node; + } +} + +@Entry +@Component +struct UIComponentUIContextGetComponentUtils0010 { + + private myNodeController: MyNodeController4 = new MyNodeController4(); + @State text: string = ''; + + build() { + Column({space:20}) { + Column() { + NodeContainer(this.myNodeController); + } + .width('100%') + .height('40%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + .margin({ top: 5 }); + + Text(this.text).fontSize(24).fontColor(Color.Brown) + + Button('getRectangleById') + .onClick(() => { + this.text = JSON.stringify(componentUtils.getRectangleById("button1")) // 建议使用this.getUIContext().getComponentUtils()接口 + }).margin(10).id('btn') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetFocusControl0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetFocusControl0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..71ee525ab2eeb4469647add9f6dec98c6b4fcdb9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetFocusControl0010.ets @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + NodeController, + BuilderNode, + Size, + FrameNode, + UIContext, + promptAction, + LengthMetrics, + ColorMetrics +} from '@kit.ArkUI'; + +class Params { + text: string = "getPromptAction" +} + +@Builder +function buttonBuilder(params: Params) { + Column({ space: 20 }) { + Button('button2') + .id('btn') + .fontSize(20) + .borderRadius(8) + .borderWidth(2) + .defaultFocus(true) + .focusBox({ + margin: LengthMetrics.px(20), + strokeColor: ColorMetrics.rgba(255, 0, 0), + strokeWidth: LengthMetrics.px(5) + }) + .backgroundColor(Color.Pink) + } +} + +class MyNodeController extends NodeController { + private buttonNode: BuilderNode<[Params]> | null = null; + private wrapBuilder: WrappedBuilder<[Params]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode { + if (this.buttonNode == null) { + this.buttonNode = new BuilderNode(uiContext); + this.buttonNode.build(this.wrapBuilder, { text: "This is a Button" }) + } + return this.buttonNode!.getFrameNode()!; + } + + aboutToResize(size: Size) { + console.log("aboutToResize width : " + size.width + " height : " + size.height) + } + + aboutToAppear() { + console.log("aboutToAppear") + } + + aboutToDisappear() { + console.log("aboutToDisappear"); + } + + onTouchEvent(event: TouchEvent) { + console.log("onTouchEvent"); + } +} + +@Entry +@Component +struct UIComponentUIContextGetFocusControl0010 { + private myNodeController: MyNodeController = new MyNodeController(); + buttonNode: FrameNode |null = null; + + build() { + Column({ space: 10 }) { + Column() { + NodeContainer(this.myNodeController) + } + .padding({ left: 35, right: 35, top: 35 }).width("100%") + .height("60%") + + Button('clearFocus') + .id('clearFocusBtn') + .fontSize(20) + .borderRadius(8) + .borderWidth(2) + .backgroundColor(Color.Orange) + .onClick(() => { + this.getUIContext().getFocusController().clearFocus(); + }) + } + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetMediaQuery0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetMediaQuery0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..eda691dad00811b5a7e4f015591be1af5e8e8563 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetMediaQuery0010.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, typeNode } from '@ohos.arkui.node'; +import { mediaquery } from '@kit.ArkUI'; +import Settings from '../../../test/model/Settings'; +import Utils from '../../../test/model/Utils'; + +let para: Record = { 'onWillInsert': '' }; + +class MyNodeController4 extends NodeController { + @Track text: string = "change size"; + @Track widthSize: number = 250 + @Track heightSize: number = 100 + @Track flag: boolean = true + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width('100%') + .height('100%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + + let col1 = typeNode.createNode(uiContext, 'Column'); + col1.initialize({ space: 10 }) + .width('100%') + .height('95%') + .alignItems(HorizontalAlign.Center) + .margin(20); + node.appendChild(col1); + let button1 = typeNode.createNode(uiContext, 'Button') + + + button1.initialize("getMediaQuery") + .id('button1') + .margin(20) + .onClick(async () => { + // await Utils.sleep(1000); + // await Settings.changeOrientation(); + // await Utils.sleep(1000); + }) + col1.appendChild(button1); + return node; + } +} + +@Entry +@Component +struct UIComponentUIContextGetMediaQuery0010 { + @State color: string = '#DB7093' + @State text: string = 'Portrait' + listener = mediaquery.matchMediaSync('(orientation: landscape)') // 建议使用 this.getUIContext().getMediaQuery().matchMediaSync()接口 + + onPortrait(mediaQueryResult:mediaquery.MediaQueryResult) { + + if (mediaQueryResult.matches) { + this.color = '#FFD700' + this.text += 'change_orientation Landscape' + } else { + this.color = '#DB7093' + this.text += 'change_orientation Portrait' + } + } + + aboutToAppear() { + let portraitFunc = (mediaQueryResult: mediaquery.MediaQueryResult): void => this.onPortrait(mediaQueryResult) + // 绑定回调函数 + this.listener.on('change', portraitFunc); + } + aboutToDisappear() { + // 解绑listener中注册的回调函数 + this.listener.off('change'); + } + + private myNodeController: MyNodeController4 = new MyNodeController4(); + @State changeAppear: string = '点我' + @State text1: string = ''; + + build() { + Column({space:20}) { + Column() { + NodeContainer(this.myNodeController); + } + .width('100%') + .height('40%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + .margin({ top: 5 }); + + Text(this.text).fontSize(24).fontColor(this.color) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetPromptAction0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetPromptAction0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..94ede5437c44e9e37d944a47f59f8073e215ef29 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetPromptAction0010.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 { NodeController, BuilderNode, Size, FrameNode, UIContext, promptAction, LengthMetrics, + ColorMetrics } from '@kit.ArkUI'; + +class Params { + text: string = "getPromptAction" +} + +@Builder +function buttonBuilder(params: Params) { + Column() { + Button(params.text).id('btn1') + .fontSize(25) + .borderRadius(8) + .borderWidth(2) + .focusBox({ + margin: LengthMetrics.px(20), + strokeColor: ColorMetrics.rgba(255, 0, 0), + strokeWidth: LengthMetrics.px(10) + }) + .backgroundColor(Color.Blue) + .onClick(() => { + promptAction.showToast({ + message: 'Hello Sally', + duration: 2000 + }); + }) + } +} + +class MyNodeController extends NodeController { + private buttonNode: BuilderNode<[Params]> | null = null; + private wrapBuilder: WrappedBuilder<[Params]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode { + if (this.buttonNode == null) { + this.buttonNode = new BuilderNode(uiContext); + this.buttonNode.build(this.wrapBuilder, { text: "This is a Button" }) + } + return this.buttonNode!.getFrameNode()!; + } + + aboutToResize(size: Size) { + console.log("aboutToResize width : " + size.width + " height : " + size.height) + } + + aboutToAppear() { + console.log("aboutToAppear") + } + + aboutToDisappear() { + console.log("aboutToDisappear"); + } + + onTouchEvent(event: TouchEvent) { + console.log("onTouchEvent"); + } +} + +@Entry +@Component +struct UIComponentUIContextGetPromptActionr0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + } + .padding({ left: 35, right: 35, top: 35 }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetUIObserver0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetUIObserver0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e953a3d8be68c6a17f5ee25861abf755930b31ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUIContext/UIComponentUIContextGetUIObserver0010.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, typeNode } from '@ohos.arkui.node'; + +let para: Record = { 'onWillInsert': '' }; +let storage: LocalStorage = new LocalStorage(para); + +class MyNodeController4 extends NodeController { + @Track text: string = "change size"; + @Track widthSize: number = 250 + @Track heightSize: number = 100 + @Track flag: boolean = true + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width('100%') + .height('100%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + + let col1 = typeNode.createNode(uiContext, 'Column'); + col1.initialize({ space: 10 }) + .width('100%') + .height('95%') + .alignItems(HorizontalAlign.Center) + .margin(20); + node.appendChild(col1); + let button1 = typeNode.createNode(uiContext, 'Button') + + + button1.initialize("button") + .id('button1') + .margin(20) + + col1.appendChild(button1); + return node; + } +} + +@Entry +@Component +struct UIComponentUIContextGetUIObserver0010 { + @State observerRes: string = 'UIObserver结果:\n' + + private myNodeController: MyNodeController4 = new MyNodeController4(); + + build() { + Column() { + Column() { + NodeContainer(this.myNodeController); + } + .width('100%') + .height('40%') + .backgroundColor(Color.Pink) + .borderColor(Color.Gray) + .borderWidth(1) + .margin({ top: 5 }); + + Text(this.observerRes) + .fontSize(20) + .fontColor(Color.Brown) + .width('90%') + .height(200) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(6) + .borderWidth(2) + .margin({ top: 10 }) + Row({ space: 10 }) { + Button('注册绘制指令下发监听').id('btn1') + .onClick(() => { + this.getUIContext().getUIObserver().on('willDraw', (info) => { + console.log('>>>'+JSON.stringify(info)) + this.observerRes += 'UIObserver willDraw'; + }) + }) + Button('解除注册绘制指令下发监听').id('btn2') + .onClick(() => { + this.getUIContext().getUIObserver().off('willDraw'); + this.observerRes += 'UIObserver willDraw 关闭'; + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextRunScopedTaskCalendarPickerDialog0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextRunScopedTaskCalendarPickerDialog0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..0763155c5e79285f3c0c5c660507561a826b3635 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextRunScopedTaskCalendarPickerDialog0010.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, ComponentContent, typeNode } from '@kit.ArkUI'; + +let context: UIContext; + +@Builder +function buildText() { + Column() { + Button('runScopedTask CalendarPickerDialog') + .id('show') + .onClick(() => { + context.runScopedTask( + () => { + CalendarPickerDialog.show({ + selected: new Date('2025-01-01') + }) + } + ); + }) + } +} + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext) + node.commonAttribute.width(300).height(300) + let col = typeNode.createNode(uiContext, "Column") + col.initialize({ space: 10 }) + node.appendChild(col) + let row4 = typeNode.createNode(uiContext, "Row") + row4.attribute.width(200) + .height(200) + let component = new ComponentContent(uiContext, wrapBuilder(buildText)) + if (row4.isModifiable()) { + row4.addComponentContent(component) + col.appendChild(row4) + } + return node + } +} + +@Entry +@Component +struct UIComponentUicontextRunScopedTaskCalendarPickerDialog0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + onPageShow(): void { + context = this.getUIContext(); + } + + build() { + Column() { + NodeContainer(this.myNodeController); + } + .padding({ left: 35, right: 35, top: 35 }) + .width("100%") + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowActionSheet0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowActionSheet0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..15c6edfa2ba733eda8a0b409c39dc9fbff3d30f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowActionSheet0010.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BuilderNode, NodeController } from '@kit.ArkUI'; +let context: UIContext; +@Builder +function buttonBuilder() { + Column() { + Button('showActionSheet') + .id('show') + .onClick(() => { + context.showActionSheet({ + title: 'title', + message: 'message', + alignment: DialogAlignment.Bottom, + confirm: { + defaultFocus: true, + value: 'ConfirmButton', + action: () => { + } + }, + sheets: [ + { + title: 'apple', + icon: 'cat.jpg', + action: () => { + } + } + ] + }) + }) + } +} + +class MyNodeController extends NodeController { + private buttonNode: BuilderNode<[]> | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode { + if (this.buttonNode == null) { + this.buttonNode = new BuilderNode(uiContext); + this.buttonNode.build(this.wrapBuilder) + } + return this.buttonNode!.getFrameNode()!; + } +} + +@Entry +@Component +struct UIComponentUicontextShowActionSheet0010 { + private myNodeController: MyNodeController = new MyNodeController(); + onPageShow(): void { + context = this.getUIContext(); + } + build() { + Column() { + NodeContainer(this.myNodeController) + } + .padding({ left: 35, right: 35, top: 35 }) + .width("100%") + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowAlertDialog0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowAlertDialog0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa6c8b7a3b91715d055081cddee7eda73e6e111e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowAlertDialog0010.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 { BuilderNode, NodeController } from '@kit.ArkUI'; +let context: UIContext; +@Builder +function buttonBuilder() { + Column() { + Button('showAlertDialog') + .id('show') + .onClick(() => { + context.showAlertDialog( + { + title: 'title', + message: 'text', + autoCancel: true, + alignment: DialogAlignment.CenterStart, + confirm: { + value: 'confirmButton', + action: () => { + } + }, + } + ) + }).backgroundColor(0x317aff) + } +} + +class MyNodeController extends NodeController { + private buttonNode: BuilderNode<[]> | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode { + if (this.buttonNode == null) { + this.buttonNode = new BuilderNode(uiContext); + this.buttonNode.build(this.wrapBuilder) + } + return this.buttonNode!.getFrameNode()!; + } +} + +@Entry +@Component +struct UIComponentUicontextShowAlertDialog0010 { + private myNodeController: MyNodeController = new MyNodeController(); + onPageShow(): void { + context = this.getUIContext(); + } + build() { + Column() { + NodeContainer(this.myNodeController) + } + .padding({ left: 35, right: 35, top: 35 }) + .width("100%") + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowDatePickerDialog0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowDatePickerDialog0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c6dd65dd7ba70dfb3a0f341221ebd7d4259ac34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowDatePickerDialog0010.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 { BuilderNode, NodeController } from '@kit.ArkUI'; +let context: UIContext; +@Builder +function buttonBuilder() { + + Column() { + Button('showDatePickerDialog') + .id('show') + .onClick(() => { + context.showDatePickerDialog({ + start: new Date("2024-12-25"), + end: new Date("2025-12-25"), + selected: new Date("2025-1-1"), + showTime: true, + useMilitaryTime: false, + disappearTextStyle: { color: Color.Pink, font: { size: '22fp', weight: FontWeight.Bold } }, + textStyle: { color: '#ff00ff00', font: { size: '18fp', weight: FontWeight.Normal } }, + selectedTextStyle: { color: '#ff182431', font: { size: '14fp', weight: FontWeight.Regular } }, + }) + }).backgroundColor(0x317aff) + } +} + +class MyNodeController extends NodeController { + private buttonNode: BuilderNode<[]> | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode { + if (this.buttonNode == null) { + this.buttonNode = new BuilderNode(uiContext); + this.buttonNode.build(this.wrapBuilder) + } + return this.buttonNode!.getFrameNode()!; + } +} + +@Entry +@Component +struct UIComponentUicontextShowDatePickerDialog0010 { + private myNodeController: MyNodeController = new MyNodeController(); + onPageShow(): void { + context = this.getUIContext(); + } + build() { + Column() { + NodeContainer(this.myNodeController) + } + .padding({ left: 35, right: 35, top: 35 }) + .width("100%") + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTextPickerDialog0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTextPickerDialog0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..2138f90bb3df5f9e83efe5ecb7fabb2cda9a2569 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTextPickerDialog0010.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 { BuilderNode, NodeController } from '@kit.ArkUI'; +let context: UIContext; +@Builder +function buttonBuilder() { + Column() { + Button('showTextPickerDialog') + .id('show') + .onClick(() => { + context.showTextPickerDialog({ + range: ['apple1', 'orange2', 'peach3', 'grape4', 'banana5'], + selected: 1, + disappearTextStyle: { color: Color.Red, font: { size: 15, weight: FontWeight.Lighter } }, + textStyle: { color: Color.Black, font: { size: 20, weight: FontWeight.Normal } }, + selectedTextStyle: { color: Color.Blue, font: { size: 30, weight: FontWeight.Bolder } } + }) + }).backgroundColor(0x317aff) + } +} + +class MyNodeController extends NodeController { + private buttonNode: BuilderNode<[]> | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode { + if (this.buttonNode == null) { + this.buttonNode = new BuilderNode(uiContext); + this.buttonNode.build(this.wrapBuilder) + } + return this.buttonNode!.getFrameNode()!; + } +} + +@Entry +@Component +struct UIComponentUicontextShowTextPickerDialog0010 { + private myNodeController: MyNodeController = new MyNodeController(); + onPageShow(): void { + context = this.getUIContext(); + } + build() { + Column() { + NodeContainer(this.myNodeController) + } + .padding({ left: 35, right: 35, top: 35 }) + .width("100%") + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTimePickerDialog0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTimePickerDialog0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..82fea45e0e3ad6551d6c89e22d01e188af46c4fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTimePickerDialog0010.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BuilderNode, NodeController, UIContext } from '@kit.ArkUI'; + +let context: UIContext; + +@Builder +function buttonBuilder() { + Column() { + Button('showTimePickerDialog') + .id('show') + .onClick(() => { + context.showTimePickerDialog({ + selected: new Date('2028-12-25T08:30:00'), + disappearTextStyle: { color: Color.Red, font: { size: 15, weight: FontWeight.Lighter } }, + textStyle: { color: Color.Black, font: { size: 20, weight: FontWeight.Normal } }, + selectedTextStyle: { color: Color.Blue, font: { size: 30, weight: FontWeight.Bolder } } + }) + }).backgroundColor(0x317aff) + } +} + +class MyNodeController extends NodeController { + private buttonNode: BuilderNode<[]> | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode { + if (this.buttonNode == null) { + this.buttonNode = new BuilderNode(uiContext); + this.buttonNode.build(this.wrapBuilder) + } + return this.buttonNode!.getFrameNode()!; + } +} + +@Entry +@Component +struct UIComponentUicontextShowTimePickerDialog0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + onPageShow(): void { + context = this.getUIContext(); + } + + build() { + Column() { + NodeContainer(this.myNodeController) + } + .padding({ left: 35, right: 35, top: 35 }) + .width("100%") + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..62ef6df5c7c537d4d9a48f82fe9afca2cfb6dc36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0010.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0010 { + @State message: string = 'Hello World'; + private matrix1 = matrix4.identity().translate({ x: 100 }); //x轴移动100 + private matrix2 = this.matrix1.copy(); + + build() { + Column({ space: 3 }) { + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + Image("/testability/image/background.png") + .width("40%") + .height(100) + .transform(this.matrix1) + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + .margin({ top: 50 }) + .transform(this.matrix2) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..90ac4d548705a350bc43ca6d604b78ccce268ed5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0020.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0020 { + @State message: string = 'Hello World'; + private matrix = matrix4.init([ + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + ]); + private matrix2 = matrix4.identity(); + + + build() { + Column({space:3}) { + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + Image("/testability/image/background.png") + .width("40%") + .height(100) + .transform(this.matrix) + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + .margin({ top: 50 }) + .transform(this.matrix2) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..81566e2706bd80064608bc7ba14000c4ee32f485 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0030.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0030 { + @State message: string = 'Hello World'; + private matrix0 = matrix4.init([ + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + ]) + private matrix1 = matrix4.identity(); + + build() { + Column({ space: 3 }) { + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + Image("/testability/image/background.png") + .width("40%") + .height(100) + .transform(this.matrix0) + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + .margin({ top: 50 }) + .transform(this.matrix1) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..72c203ce731c9a19bf1834dcc1823c9ac8a2ba38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0040.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0040 { + private matrix1 = matrix4.identity() + .rotate({ + x: -10, + y: 20, + z: 4, + angle: 10, + centerX: -50, + centerY: 50 + }); + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..c5fbafbbe6c75e6687157be1d6b9d3d94e1bafbc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0050.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0050 { + private matrix1 = matrix4.identity().translate({}); + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a8fa30e09eb6b6337a193831e809aba299dd421 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0060.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0060 { + private matrix1 = matrix4.identity().translate({ x: 100, y: -200, z: 30 }); + @State log: string = ''; + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin({ bottom: 20 }) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}`; + }) + + Text(this.log) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..01ec7ce1e297c4a0f876521643cbc472b00251b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0070.ets @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0070 { + private matrix1 = matrix4.identity().scale({}); + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0659922f26c3bab8f7fc8aa95c0346b0b6075f7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0080.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0080 { + private matrix1 = matrix4.identity().scale({ x: 2, y: 0, z: 4 }); + @State log: string = ''; + + build() { + Column({ space: 3 }) { + Image("/testability/image/background.png") + .width("40%") + .height(100) + .transform(this.matrix1) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin(10) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}`; + }) + + Text(this.log) + .fontSize(15) + .margin(10) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..5cad6555512f884c0b9a4eefe4567b5e67abecfd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0090.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0090 { + private matrix1 = matrix4.identity().scale({ x: 2, y: 1, z: 1 }); + @State log: string = ''; + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin({ bottom: 20 }) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}`; + }) + + Text(this.log) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..675d663783106b50ee16e20dae96995a60e6c194 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0100.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0100 { + private matrix1 = matrix4.identity().scale({ x: 2, y: 3, z: 4 }); + @State log: string = ''; + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin({ bottom: 20 }) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}`; + }) + + Text(this.log) + .fontSize(15) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0a58b160dc87090bc5ca2040d9350da4dbd6c85 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0110.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0110 { + private matrix1 = matrix4.identity().scale({ x: 2, y: -3, z: 4 }); + @State log: string = ''; + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin({ bottom: 20 }) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}`; + }) + + Text(this.log) + .fontSize(15) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6969b3c66b7081583b7c5bc9e6f6dd08fc0800e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0120.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0120 { + private matrix1 = matrix4.identity() + .rotate({ + x: -10, + y: 20, + z: 0, + angle: 30 + }) + + build() { + Column({ space: 3 }) { + + Image("/testability/image/background.png") + .width("40%") + .height(100) + .transform(this.matrix1) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..1cb0fd1898d78dbd8d3e5662fe03eb0e0a773314 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0130.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0130 { + private matrix1 = matrix4.identity() + .rotate({ + x: -10, + y: 20, + z: 0, + angle: -30 + }) + + build() { + Column({ space: 3 }) { + + Image("/testability/image/background.png") + .width("40%") + .height(100) + .transform(this.matrix1) + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3bf51c1501776bd9347ef213701e516f58ea10e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0140.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 { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0140 { + @State log: string = ''; + private matrix1 = matrix4.identity() + .scale({ + x: 2, + y: 1, + z: 1, + centerX: -50, + centerY: 50 + }); + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin({ bottom: 20 }) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}`; + }) + + Text(this.log) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8c5f0a6a761a60046a402a54f21be97e338da3c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0150.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 { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0150 { + private matrix1 = matrix4.identity().translate({ x: 100 }); + private matrix2 = matrix4.identity().scale({ x: 2 }); + @State log: string = ''; + + build() { + Column({ space: 3 }) { + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + Image($r("app.media.background")) + .width("40%") + .height(100) + .transform(this.matrix1) + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + .margin({ top: 50 }) + .transform(this.matrix2) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin(10) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1) + "matrix2:" + JSON.stringify(this.matrix2)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}, matrix2: ${JSON.stringify(this.matrix2)}`; + }) + + Text(this.log) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..c5c1e1a5e22d5f4a80b21751365a67c14747bd52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0160.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0160 { + private matrix1 = matrix4.identity().translate({ x: 100 }); //x轴移动100 + private matrix2 = matrix4.identity().translate({ x: 100 }).invert(); + @State log:string = ''; + + build() { + Column({ space: 3 }) { + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + Image($r("app.media.background")) + .width("40%") + .height(100) + .transform(this.matrix1) + Image("/testability/image/startIcon.png") + .width("40%") + .height(100) + .margin({ top: 50 }) + .transform(this.matrix2) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin(10) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1) + "matrix2:" + JSON.stringify(this.matrix2)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}, matrix2: ${JSON.stringify(this.matrix2)}`; + }) + + Text(this.log) + .fontSize(15) + .margin(10) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b388daf0eae6871d7c566602c3bf6e185b77e87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0170.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIMotionFoundationMatrix4Interface0170 { + private matrix1 = matrix4.identity().transformPoint([100, 10]); + @State log: string = ''; + + build() { + Column({ space: 5 }) { + Image("/testability/image/background.png") + .width("40%") + .margin(20) + .height(100) + .transform(this.matrix1) + + Text('print matrix4 Log') + .id('textlog') + .fontSize(15) + .margin({ bottom: 20 }) + .onClick(() => { + console.info("matrix1:" + JSON.stringify(this.matrix1)); + this.log = `matrix1: ${JSON.stringify(this.matrix1)}`; + }) + + Text(this.log) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png new file mode 100644 index 0000000000000000000000000000000000000000..476223a2cbaa029e0ccc67660eb768effb766501 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_click_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png new file mode 100644 index 0000000000000000000000000000000000000000..0d16a9f5d39efc178484b2bfcbe3372cb3c16a7e Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_height_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png new file mode 100644 index 0000000000000000000000000000000000000000..eaae1996c7bcdeafd8a6287b9d5d44cfda56a934 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/containerspan_width_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png new file mode 100644 index 0000000000000000000000000000000000000000..846adf54057902753c7ad575ea11769db6c5eec8 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/resources/span_null_param_error.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 index e58bd507f3ecff51931c351ebcabf6603cd5c40c..e80c0ed7a8b4306a8cb24237449fda12327910e8 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" }, @@ -49,6 +67,26 @@ } ] } + ], + "extensionAbilities": [ + { + "name": "UIComponentPopupboxPromptactionUiextensionAbility", + "srcEntry": "./ets/testability/entryembeddeduiextability/UIComponentPopupboxPromptactionUiextensionAbility.ets", + "exported": true, + "type": "sys/commonUI" + }, + { + "name": "UIComponentPopupboxSpecificationsAlignmentAbility", + "srcEntry": "./ets/testability/entryembeddeduiextability/UIComponentPopupboxSpecificationsAlignmentAbility.ets", + "exported": true, + "type": "sys/commonUI" + }, + { + "name": "ExampleUIExtAbility", + "srcEntry": "./ets/testability/pages/ExampleUIExtAbility/ExampleUIExtAbility.ets", + "exported": true, + "type": "sys/commonUI" + } ] } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/background.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..7a32b59293c29076b7ff37af37dc09318aa26462 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/background.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/startIcon.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..c59a90fb37dd9cea9724d9e1b953767416981efc Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/startIcon.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 5cc05ce92cff61b76d701a3fe495c11c73638078..6ac56de9662efa3c61d8e744f743c76c253f5326 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,226 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/ThemeComponentStylesSwitch/ThemeComponentStylesSwitch0350", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0010", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0020", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0030", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0040", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0050", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0060", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0070", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0080", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0090", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0100", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0110", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0120", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0130", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0140", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0150", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0160", + "testability/pages/UIMotionFoundationMatrix4Interface/UIMotionFoundationMatrix4Interface0170", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0080", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0110", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0100", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0010", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0020", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0140", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0050", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0120", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0060", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0130", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0070", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuArrowblur/ArkUIComponentFunctionCommomattributesMenuArrowblur0030", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0120", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0080", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0090", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0100", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0130", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0140", + "testability/pages/ArkUIComponentFunctionCommomattributesMenuEffectenhancement/ArkUIComponentFunctionCommomattributesMenuEffectenhancement0110", + "testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0001", + "testability/pages/UIComponentPopupboxPromptactionUiextension/Extension0000", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0040", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0100", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0060", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0010", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0070", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0050", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0080", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0020", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0030", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0090", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0130", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0140", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0110", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0160", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0120", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0170", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0190", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0180", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0200", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0210", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0230", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0220", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0280", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0250", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0270", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0260", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0290", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0300", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0240", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0310", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0330", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0350", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0340", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0320", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0360", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0370", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0410", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0380", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0400", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0390", + "testability/pages/UIComponentPopupboxPromptactionUiextension/UIComponentPopupboxPromptactionUiextension0150", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0040", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0040", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0120", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0120", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0130", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0130", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0250", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0250", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0270", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0270", + "testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0110", + "testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0100", + "testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0040", + "testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0180", + "testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0120", + "testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0150", + "testability/pages/ActionEventCommoneventEventInterface/ActionEventCommoneventEventInterface0060", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0460", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0470", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0480", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0490", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0500", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0890", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0900", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0910", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0920", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0930", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0940", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0950", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0960", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0970", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget0980", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1000", + "testability/pages/UIComponentPopupboxPopupFollowtransformoftarget/UIComponentPopupboxPopupFollowtransformoftarget1130", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0100", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0010", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0130", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0140", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0150", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0240", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0280", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0290", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0310", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0330", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0380", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0450", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/Extension0470", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0100", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0010", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0020", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0030", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0050", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0130", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0140", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0150", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0160", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0170", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0190", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0240", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0270", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0280", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0290", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0300", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0310", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0330", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0380", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0410", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0420", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0430", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0440", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0450", + "testability/pages/UIComponentPopupBoxPopupInUiExtension/UIComponentPopupBoxPopupInUiExtension0470", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0540", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0560", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0600", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0630", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0660", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0690", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0740", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0710", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0750", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0800", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0790", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0820", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0380", + "testability/pages/UIComponentPopupboxPromptSupportcustomizationstyle/UIComponentPopupboxPromptSupportcustomizationstyle0460", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0300", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0300", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0330", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0330", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0230", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0230", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0280", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0280", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0310", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0310", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0240", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0240", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0320", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0320", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/Extension0260", + "testability/pages/UIComponentPopupboxSpecificationsAlignment/UIComponentPopupboxSpecificationsAlignment0260", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0020", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0080", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200_1", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0060", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0120", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0160", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0130", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0200", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0150", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0100", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0040", + "testability/pages/SubAceActionWindowCustomIzation/SubAceActionWindowCustomIzation0190", + "testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0020", + "testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0030", + "testability/pages/UIAttributesBackgroundSeriable/UIAttributesBackgroundSeriable0050", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0080", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0090", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0310", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0320", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0350", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0340", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0330", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0370", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0530", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0600", + "testability/pages/SubAceActionWindowWindowCustom/SubAceActionWindowWindowCustom0610", + + "testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowActionSheet0010", + "testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowAlertDialog0010", + "testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowDatePickerDialog0010", + "testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTextPickerDialog0010", + "testability/pages/UIComponentUicontextReplacement/UIComponentUicontextShowTimePickerDialog0010", + "testability/pages/UIComponentUicontextReplacement/UIComponentUicontextRunScopedTaskCalendarPickerDialog0010", + "testability/pages/UIComponentUIContext/UIComponentUIContextGetUIObserver0010", + "testability/pages/UIComponentUIContext/UIComponentUIContextGetFocusControl0010", + "testability/pages/UIComponentUIContext/UIComponentUIContextGetPromptAction0010", + "testability/pages/UIComponentUIContext/UIComponentUIContextGetMediaQuery0010", + "testability/pages/UIComponentUIContext/UIComponentUIContextGetComponentUtils0010" ] }