diff --git a/OAT.xml b/OAT.xml index e6b5b947bba36fe1ac1eb390307a3738babad273..e70b7a624f21be3bb7ad3a3dc125f6843bc1377d 100644 --- a/OAT.xml +++ b/OAT.xml @@ -115,6 +115,7 @@ Note:If the text contains special characters, please escape them according to th + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommonEventFrameNodeOnDrawTest/ActionEventCommonEventFrameNodeOnDraw.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommonEventFrameNodeOnDrawTest/ActionEventCommonEventFrameNodeOnDraw.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d82d7a870c50f1ea706073077c69789e3e1d12f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommonEventFrameNodeOnDrawTest/ActionEventCommonEventFrameNodeOnDraw.test.ets @@ -0,0 +1,687 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 } from "@ohos/hypium" +import Settings from "../model/Settings" +import windowSnap from "../model/snapShot" +import Logger from "../model/Logger" +import Utils from "../model/Utils" +import { Driver, ON, Component } from "@kit.TestKit" +import { KeyCode } from "@kit.InputKit" + +/* + * ActionEventCommonEventFrameNodeOnDraw + * + * 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 ActionEventCommonEventFrameNodeOnDraw() { + + describe("ActionEventCommonEventFrameNodeOnDraw", () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error("TEST", "Failed to destroy the window. Cause : ${JSON.stringify(err)}"); + return; + } + Logger.info("TEST", "Succeeded in destroy the window."); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0100 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0100 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0100", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0100 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0100" + ); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0100_btn1")); + await btn1.click(); + await Utils.sleep(2000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0100 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0110 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0110 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0110", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0110 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0110" + ); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0110_btn1")); + await btn1.click(); + await Utils.sleep(2000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0110 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0120 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0120 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0120", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0120 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0120" + ); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0120_btn1")); + await btn1.click(); + await Utils.sleep(2000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0120 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0010 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0010 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0010", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0010 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0010" + ); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0010 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0020 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0020 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0020", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0020 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0020" + ); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0020 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0030 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0030 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0030", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0030 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0030" + ); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0030 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0080 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0080 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0080", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0080 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0080" + ); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0080_btn1")); + await btn1.click(); + await Utils.sleep(2000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0080 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0090 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0090 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0090", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0090 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0090" + ); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0090_btn1")); + await btn1.click(); + await Utils.sleep(2000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0090 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0130 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0130 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0130", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0130 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0130" + ); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0130_btn1")); + await btn1.click(); + await Utils.sleep(2000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0130 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0150 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0150 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0150", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0150 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0150" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + + let btn2 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0150_btn2")); + await btn2.click(); + await Utils.sleep(2000) + + let btn3 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0150_btn3")); + await btn3.click(); + await Utils.sleep(2000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0150 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_NODECONTAINER_0230 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_NODECONTAINER_0230 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_NODECONTAINER_0230", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_NODECONTAINER_0230 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/UIComponentGraphicNodeContainer0230" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await homeAndBack(driver); + await Utils.sleep(3000); + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_NODECONTAINER_0230 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0160 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0160 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0160", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0150 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0160" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0160_btn1")); + await btn1.click(); + await Utils.sleep(1000) + + let btn2 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0160_btn2")); + let point1 = await btn2.getBoundsCenter(); + await driver.mouseMoveTo(point1); + await Utils.sleep(1000) + + let btn3 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0160_btn3")); + point1 = await btn3.getBoundsCenter(); + await driver.mouseMoveTo(point1); + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE-ONDRAW_0160 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0140 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0140 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0140_1", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0140_1 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0140" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0140_btn1")); + await btn1.click(); + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0140_1 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0140 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0140 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0140_2", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0140_2 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0140" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0140_btn1")); + await btn1.click(); + await Utils.sleep(1000) + + await btn1.click(); + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0140_2 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0180 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0180 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0180", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0180 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0180" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0180_btn1")); + await btn1.click(); + await Utils.sleep(1000) + + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_1); + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0180 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0170 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0170 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0170_1", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0170_1 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0170" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0170_btn1")); + await btn1.click(); + await Utils.sleep(1000) + + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000) + + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0170_1 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0170 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0170 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0170_2", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0170_2 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0170" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + + let btn1 = await driver.findComponent(ON.id("ActionEventCommonEventFrameNodeOnDraw0170_btn1")); + await btn1.click(); + await Utils.sleep(1000) + + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000) + + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(1000) + + await driver.triggerKey(KeyCode.KEYCODE_TAB); + await Utils.sleep(1000) + + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0170_2 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0190 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0190 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0190_1", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0190_1 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let button_in_node: Component = await driver.findComponent(ON.id('button_in_node')); + await button_in_node.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0190_1 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0190 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0190 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0190_2", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0190_2 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let button_in_node: Component = await driver.findComponent(ON.id('button_in_node')); + await button_in_node.click(); + await Utils.sleep(1000); + await text_clear.click(); + await Utils.sleep(1000); + let text_1: Component = await driver.findComponent(ON.id('text_1')); + await text_1.click(); + await Utils.sleep(1000); + await button_in_node.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await text_1.click(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0190_2 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0200 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0200 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0200_1", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0200_1 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let button_in_node: Component = await driver.findComponent(ON.id('button_in_node')); + await button_in_node.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0200_1 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0200 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0200 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0200_2", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0200_2 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let button_in_node: Component = await driver.findComponent(ON.id('button_in_node')); + await button_in_node.click(); + await Utils.sleep(1000); + await text_clear.click(); + await Utils.sleep(1000); + let text_2: Component = await driver.findComponent(ON.id('text_2')); + await text_2.click(); + await Utils.sleep(1000); + await button_in_node.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await text_2.click(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0200_2 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0220 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0220 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0220_1", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0220_1 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let rootNode: Component = await driver.findComponent(ON.id('rootNode')); + await rootNode.longClick(); + await Utils.sleep(1000); + let test_text: Component = await driver.findComponent(ON.id('test_text')); + await test_text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0220_1 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0220 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0220 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0220_2", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0220_2 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let rootNode: Component = await driver.findComponent(ON.id('rootNode')); + let test_text: Component = await driver.findComponent(ON.id('test_text')); + let text_4: Component = await driver.findComponent(ON.id('text_4')); + await text_4.click(); + await Utils.sleep(1000); + await rootNode.longClick(); + await Utils.sleep(1000); + await test_text.longClick(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await text_4.click(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0220_2 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0210 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0210 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0210_1", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0210_1 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let rootNode: Component = await driver.findComponent(ON.id('rootNode')); + await rootNode.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0210_1 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0210 + * @tc.name SUB_ACE_ACTION_EVENT_00MMONEVENT_FRAMENODE-ONDRAW_0210 + */ + it("SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0210_2", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0210_2 start."); + Settings.createWindow( + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190" + ); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let text_clear: Component = await driver.findComponent(ON.id('text_clear')); + await text_clear.click(); + await Utils.sleep(1000); + let rootNode: Component = await driver.findComponent(ON.id('rootNode')); + await rootNode.click(); + await Utils.sleep(1000); + await text_clear.click(); + await Utils.sleep(1000); + let text_3: Component = await driver.findComponent(ON.id('text_3')); + await text_3.click(); + await Utils.sleep(1000); + await rootNode.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await text_3.click(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_ONDRAW_0210_2 finish."); + done(); + }); + + }) +} + +/** + * The application switches to the desktop and back to the application + * + * @param driver + */ +async function homeAndBack(driver: Driver) { + let currentWindow = Settings.windowClass; + if (currentWindow) { + await currentWindow.hide(); + await driver.triggerKey(KeyCode.KEYCODE_HOME); + await Utils.sleep(3000); + await currentWindow.showWindow(); + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommonEventFrameNodeTest/ActionEventCommonEventFrameNode.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommonEventFrameNodeTest/ActionEventCommonEventFrameNode.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8db0d9c6e36f4b61f6f017c0a8e14cddebd1e7fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommonEventFrameNodeTest/ActionEventCommonEventFrameNode.test.ets @@ -0,0 +1,1845 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +import { Component, Driver, ON } from '@ohos.UiTest' + +/* + * + * 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 ActionEventCommonEventFrameNode() { + + describe('ActionEventCommonEventFrameNode', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0300 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0300 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0300 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0300"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0300')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0310 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0310 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0310 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0310"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0310')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0320 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0320 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0320 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0320"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0320')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0180 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0180 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0180 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0180')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0210 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0210 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0210 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0210')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0200 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0200 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0200 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0200')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0060 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0060 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0060 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0060"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0060')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0220 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0220 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0220 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0220"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0220')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0080 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0080 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0080 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0080"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0080')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0230 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0230 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0230 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0230"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0230')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0090 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0090 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0090 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0090"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0090')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0250 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0250 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0250 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0250"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0250')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0100 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0100 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0100 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0100')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(100); + await Utils.sleep(600); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0070 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0070 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0070 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0070"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0070')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0240 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0240 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0240 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0240"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0240')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0110 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0110 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0110 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0110"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0110')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0190 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0190 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0190 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0190')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4000 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4000 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4000 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4000"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4000')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4000 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4010 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4010 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4010 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4010"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4010')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4020 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4020 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4020 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4020')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4030 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4030 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4030 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4030"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4030')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4040 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4040 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4040 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4040"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4040')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4050 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4050 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4050 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4050"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4050')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4060 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4060 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4060 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4060"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4060')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4070 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4070 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4070 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4070"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4070')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4100 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4100 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4100 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4100')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4110 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4110 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4110 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4110"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4110')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4120 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4120 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4120 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4120"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4120')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4130 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4130 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4130 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4130')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4140 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4140 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4140 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4140')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4150 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4150 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4150 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4150')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4170 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4170 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4170 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4170')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4180 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4180 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4180 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4180')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4190 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4190 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4190 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4190')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4200 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4200 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4200 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('Test_Button')); + await driver.delayMs(100); + await buttonDatePickerDialog.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0360 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0360 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0360 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0360"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0360')); + await driver.delayMs(100); + await buttonDatePickerDialog.doubleClick(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0360 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0290 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0290 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0290', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0290") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0290')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0370 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0370 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0370', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0370") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0370')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0380 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0380 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0380', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0380") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0380')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0390 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0390 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0390', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0390") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0390')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4090 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4090 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4090 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4090"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4090')); + await driver.delayMs(100); + await buttonDatePickerDialog.doubleClick(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4080 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4080 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4080 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4080"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.swipe(0, 0, 2, 2) + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode4080')); + await driver.delayMs(100); + await buttonDatePickerDialog.doubleClick(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0050 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0050 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0050 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0050"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let buttonDatePickerDialog: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0050')); + await driver.delayMs(100); + await buttonDatePickerDialog.doubleClick(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0050 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4000 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4000"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreatTextTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4000 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4010 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4010"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateColumnTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4010 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4020 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateRowTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4020 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4030 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4030"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateStackTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4030 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4040 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4040"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateGridRowTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4040 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4050 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4050"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateGridColTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4050 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4060 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4060"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateFlexTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4060 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4070 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4070"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateSwiperTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4070 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4080 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4080"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateProgressTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4080 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4090 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4090"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateScrollTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4090 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4100 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateRelativeContainerTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4100 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4110 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4110"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateDividerTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4110 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4120 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4120"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateLoadingProgressTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4120 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4130 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateSearchTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4130 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4140 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4140"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateBlankTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4140 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4150 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4150"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateImageTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4150 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4160 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4160"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateBlankTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4160 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4170 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4170"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateListItemTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4170 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4180 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4180"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateTextInputNodeTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4180 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4190 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateButtonNodeTypeNode')) + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4190 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4200 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateListItemGroupNodeTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4200 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4210 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4210"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateWaterFlowNodeTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4210 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4230 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4230"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('idBtCreateXComponentNodeTypeNode')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_TYPENODE_CREATE_FRAMENODE_4230 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SSUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0130 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0130"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0130')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0130 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SSUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0260 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0260"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0260')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0260 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0270 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0270"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0270')); + await driver.delayMs(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0270 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0280 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0280"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0280')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0280 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0400 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0400"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0400')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0400 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0010 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0010"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0010')); + await driver.delayMs(100); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0010 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0020 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0020')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0020 finish.`); + done(); + }) + + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0030 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0030"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await driver.delayMs(100); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('ActionEventCommonEventFrameNode0030')); + await driver.delayMs(100); + await button.click(); + await driver.delayMs(1000); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0030 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4210 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4210 + * @tc.desc : Navigation组件,创建new FrameNode,监听节点进行测量时onMeasure被调用 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4210 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4210"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4210 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4220 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4220 + * @tc.desc : 创建new FrameNode,监听节点进行布局时onLayout被调用 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4220 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4210"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4220 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4230 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4230 + * @tc.desc : 创建new FrameNode,设置FrameNode的测量后的尺寸setMeasuredSize + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4230 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4230"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let setMeasuredSize1: Component = await driver.findComponent(ON.id('setMeasuredSize1')); + await setMeasuredSize1.click(); + await Utils.sleep(1000); + let setMeasuredSize2: Component = await driver.findComponent(ON.id('setMeasuredSize2')); + await setMeasuredSize2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4230 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4240 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4240 + * @tc.desc : 创建new FrameNode,设置FrameNode的布局后的位置setLayoutPosition + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4240 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4240"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let setLayoutPosition1: Component = await driver.findComponent(ON.id('setLayoutPosition1')); + await setLayoutPosition1.click(); + await Utils.sleep(1000); + let setLayoutPosition2: Component = await driver.findComponent(ON.id('setLayoutPosition2')); + await setLayoutPosition2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4240 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4250 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4250 + * @tc.desc : 创建new FrameNode,measure根据父容器的布局约束,对FrameNode进行测量,计算出尺寸 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4250 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4250"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('measure')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4250 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4260 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4260 + * @tc.desc : 创建new FrameNode,layout为FrameNode及其子节点指定布局位置 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4260 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4260"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('layout')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4260 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4270 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4270 + * @tc.desc : 创建new FrameNode,setNeedsLayout将FrameNode标记为需要布局的状态 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4270 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4270"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('setNeedsLayout')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4270 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4280 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4280 + * @tc.desc : 创建new FrameNode,invalidate触发FrameNode自绘制内容的重新渲染 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4280 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4280"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let invalidate: Component = await driver.findComponent(ON.id('invalidate')); + await invalidate.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4280 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4290 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4290 + * @tc.desc : 创建new FrameNode,支持添加ComponentContent类型的组件内容addComponentContent + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4290 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4290"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('addComponentContent')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4290 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4300 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4300 + * @tc.desc : 创建new FrameNodeFrameNode下树并递归释放当前节点为根的子树disposeTree + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4300 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4300"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('disposeTree')); + await Utils.sleep(200); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4300 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4310 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4310 + * @tc.desc : 创建new FrameNodeFrameNode在设置尺寸时构造LayoutConstrain对象 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4310 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4310"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('LayoutConstrain')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_4310 finish.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0120 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0120 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0120', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0120") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ButtonTest1')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0140 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0140 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0140', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0140") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ButtonTest1')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0150 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0150 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0150', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0150") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ButtonTest1')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0160 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0160 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0160', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0160") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ButtonTest1')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0170 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0170 + * @tc.desc : + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_0170', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ButtonTest1')); + await button.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommoneventFramenodeClipTest/ActionEventCommoneventFramenodeClip.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommoneventFramenodeClipTest/ActionEventCommoneventFramenodeClip.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b1e09f30aad3ff2b758cab8ea5fc954062fa452 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ActionEventCommoneventFramenodeClipTest/ActionEventCommoneventFramenodeClip.test.ets @@ -0,0 +1,855 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, 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' + +/* + * ActionEventCommoneventFramenodeClip + * + * 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 ActionEventCommoneventFramenodeClip() { + + describe('ActionEventCommoneventFramenodeClip', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0100 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0100 + * @tc.desc 显示裁剪以左上角(0,0),右下角为(150,150)的矩形,无圆角效果 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0100', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip01")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0020 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0020 + * @tc.desc 显示裁剪以左上角(0,0),右下角为(150,150)的矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0020', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip02")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0090 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0090 + * @tc.desc 显示裁剪以左上角(50,50),右下角为(200,400)且四角边框为(32,32)的圆角矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0090', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip03")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_D1AMENODE_CLIP_0010 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_D1AMENODE_CLIP_0010 + * @tc.desc 显示裁剪以左上角(50,50),右下角为(200,400)的矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_D1AMENODE_CLIP_0010', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip04")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVEAMENODE_CLIP_0030 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVEAMENODE_CLIP_0030 + * @tc.desc 显示裁剪以左上角(-10,-10),右下角为(250,250)的矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVEAMENODE_CLIP_0030', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip05")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0080 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0080 + * @tc.desc 显示裁剪以左上角(100,100),右下角为(300,500)的矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0080', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip06")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0140 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0140 + * @tc.desc 无裁剪效果显示 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0140', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip07")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0150 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0150 + * @tc.desc 显示裁剪以左上角(50,50),右下角为(200,400)的矩形,无圆角效果 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0150', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip08")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0130 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0130 + * @tc.desc 显示裁剪以左上角(0,0),右下角为(50,50)且右下边框为(32,32)的圆角矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0130', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip09")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0110 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0110 + * @tc.desc 显示裁剪以左上角(0,0),右下角为(200,200)的矩形,无圆角效果 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0110', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip10")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0120 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0120 + * @tc.desc 显示裁剪以左上角(0,0),右下角为(300,600)的矩形,无圆角效果 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0120', 0, async (done: Function) => { + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("ActionEventCommoneventFramenodeClip11")); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + ////// + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0040 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0040 + * @tc.desc 显示裁剪以左上角(0,0),右下角为(300,600)的矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0040 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0040"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0050 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0050 + * @tc.desc 显示裁剪以左上角(0,0),右下角为(50,50)的矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0050 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0050"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0060 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0060 + * @tc.desc 无裁剪矩形显示 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0060 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0060"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0070 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0070 + * @tc.desc 显示裁剪以左上角(50,50),右下角为(200,200)的矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0070 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0070"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0160 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0160 + * @tc.desc 显示裁剪以左上角(50,50),右下角为(200,400)且四角边框为(100,100)的圆角矩形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0160 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0160"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0170 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0170 + * @tc.desc 显示裁剪以圆心为(150,150)半径为150的圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0170 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0170"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0180 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0180 + * @tc.desc 显示裁剪以圆心为(75,75)半径为75的圆形 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0180 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0180"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0190 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0190 + * @tc.desc 无裁剪效果显示(不在范围内) + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0190 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0190"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0200 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0200 + * @tc.desc 显示裁剪以圆心为(150,0)半径为150的下半圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0200 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0200"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0210 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0210 + * @tc.desc 显示裁剪以圆心为(0,150)半径为150的左半圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0210 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0210"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0220 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0220 + * @tc.desc 半径为0,无裁煎效果显示 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0220 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0220"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0230 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0230 + * @tc.desc 圆心为(75,-150)半径为50的圆未显示在页面内 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0230 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0230"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0240 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0240 + * @tc.desc 显示裁前以圆心为(75,0)半径为150的圆,左边超出范围的区域被截断 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0240 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0240"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0250 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0250 + * @tc.desc 显示裁前以左上角为(50,50)右下角为(200,400)的椭圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0250 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0250"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0260 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0260 + * @tc.desc 显示裁剪以左上角为(0,0)右下角为(150,150)的椭圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0260 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0260"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0270 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0270 + * @tc.desc 显示裁剪以左上角为(0,0)右下角为(200,200)的椭圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0270 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0270"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0280 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0280 + * @tc.desc 显示裁剪以左上角为(0,0)右下角为(300,600)的椭圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0280 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0280"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0290 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0290 + * @tc.desc 显示裁前以左上角为(0,0)右下角为(50,50)的椭圆(不在范围内显示) + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0290 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0290"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0300 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0300 + * @tc.desc 无裁剪效果显示(不在范围内) + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0300 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0300"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0310 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0310 + * @tc.desc 显示裁剪以左上角为(50,50)右下角为(200,200)的椭圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0310 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0310"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0320 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0320 + * @tc.desc 显示裁剪以左上角为(100,100)右下角为(300,500)的椭圆 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0320 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0320"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0330 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0330 + * @tc.desc 显示裁剪以(100,0)-(200,240)-(0,240)形成的闭合三角形区域 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0330 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0330"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0340 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0340 + * @tc.desc 显示裁剪以(0,0)-(200,0)-(200,200)-(0,200)-(0,0)的路径闭合矩形区域 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0340 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0340"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0340 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0350 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0350 + * @tc.desc 显示裁剪以(100,0)-(0,100)-(50,200)-(150,200)-(200,100)的路径闭五边形区域 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0350 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0350"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0350 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0360 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0360 + * @tc.desc 显示裁前以(0,300)到(240,300)绘制三次贝塞尔曲线(曲线终点为(100,0)) + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0360 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0360"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0370 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0370 + * @tc.desc 显示裁剪以(0,100)为起点(200,100)为终点的椭圆弧闭合区域 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0370 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0370"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0380 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0380 + * @tc.desc 裁剪显示伞状闭合区域 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0380 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0380"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0380 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0390 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0390 + * @tc.desc 裁剪测试椭圆弧闭合区域 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0390 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0390"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0390 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0400 + * @tc.name SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0400 + * @tc.desc 无裁剪效果显示(不在范围内) + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0400 start.`); + Settings.createWindow("testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0400"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('showButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_CLIP_0400 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a3abbf825b2ba6b14c6f0cd8e34a9375663dfac1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo.test.ets @@ -0,0 +1,56 @@ +/* + * 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, 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' + +export default function ComponentGtaphicNodecontainerDocDemo() { + + describe('ComponentGtaphicNodecontainerDocDemo', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_DOCDEMO_0070 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_DOCDEMO_0070 + * @tc.desc 各页面示例代码均能正常编译hap正常运行 + */ + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_DOCDEMO_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_DOCDEMO_0070 start.`); + Settings.createWindow("testability/pages/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_DOCDEMO_0070 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..577e57a84260d79d5959f91a64517f03faa57595 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 @@ -141,6 +141,39 @@ import UIComponentPopupBoxPromptToastSequence import UIComponentPopupBoxSpecificationsPopup from './UIComponentPopupBoxSpecificationsPopupTest/UIComponentPopupBoxSpecificationsPopup.test'; +import UiMotionAnimationMaskTest from "./UiMotionAnimationMaskTest/UiMotionAnimationMask.test"; +import ActionEventCommonEventFrameNodeOnDraw + from "./ActionEventCommonEventFrameNodeOnDrawTest/ActionEventCommonEventFrameNodeOnDraw.test"; +import UIComponentPopupBoxPopupFollowTransformOfTargetTest + from "./UIComponentPopupBoxPopupFollowTransformOfTargetTest/UIComponentPopupBoxPopupFollowTransformOfTarget.test"; +import UIComponentSpecialComponentsFrameNodeTextureXportTest + from "./UIComponentSpecialComponentsFrameNodeTextureXportTest/UIComponentSpecialComponentsFrameNodeTextureXport.test"; +import UIFrameNodeMeasureAndLayout + from './UIFrameNodeMeasureAndLayoutTest/UIFrameNodeMeasureAndLayout.test'; +import ActionEventCommoneventFramenodeClip + from "./ActionEventCommoneventFramenodeClipTest/ActionEventCommoneventFramenodeClip.test"; +import UIComponentSpecialComponentsFrameNodeAttributeInterface + from "./UIComponentSpecialComponentsFrameNodeAttributeInterfaceTest/UIComponentSpecialComponentsFrameNodeAttributeInterface.test"; +import UiComponentCmmonattrRenderingTest from "./UiComponentCmmonattrRenderingTest/UiComponentCmmonattrRendering.test"; +import UIFrameNodeRanderNodeMarkNodeGroup + from "./UIFrameNodeRanderNodeMarkNodeGroupTest/UIFrameNodeRanderNodeMarkNodeGroup.test"; +import UiComponentGraphicNodecontainerBuildernodeTest + from "./UiComponentGraphicNodecontainerBuildernodeTest/UiComponentGraphicNodecontainerBuildernode.test"; +import UILcomponeentGraphicNodecontainerToolchains from "./UILcomponeentGraphicNodecontainerToolchainsTest/UILcomponeentGraphicNodecontainerToolchains.test" +import UiFrameNodeRenderNodeMarkNodeAdapterTest + from "./UiFrameNodeRenderNodeMarkNodeAdapterTest/UiFrameNodeRenderNodeMarkNodeAdapter.test"; +import UIComponentCraphicNodeContainerRenderTest + from "./UIComponentCraphicNodeContainerRenderTest/UIComponentCraphicNodeContainerRender.test"; +import UIMotionAnimationImperativeprope from "./UIMotionAnimationImperativepropeTest/UIMotionAnimationImperativeprope.test"; +import UIFrameNodeAcquisitionAbility from "./UIFramenodeAcquisitionAbilityTest/UIFrameNodeAcquisitionAbility.test" +import ActionEventCommonEventFrameNode + from "./ActionEventCommonEventFrameNodeTest/ActionEventCommonEventFrameNode.test"; +import UIComponentGraphicNodeContainerToolChainsTest + from "./UIComponentGraphicNodeContainerToolChainsTest/UIComponentGraphicNodeContainerToolChainsTest"; +import UIComponentSpecialComponentsFrameNodePageInfo + from "./UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo.test"; +import ComponentGtaphicNodecontainerDocDemo from './ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo.test' + import UIComponentPopupBoxPopupInterface001 from './UIComponentPopupBoxPopupInterfaceTest/UIComponentPopupBoxPopupInterface001.test'; import UIComponentPopupPromptInterface001 @@ -239,6 +272,25 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + + UiMotionAnimationMaskTest(); + ActionEventCommonEventFrameNodeOnDraw(); + UIComponentPopupBoxPopupFollowTransformOfTargetTest(); + UIComponentSpecialComponentsFrameNodeTextureXportTest(); + UIFrameNodeMeasureAndLayout(); + UILcomponeentGraphicNodecontainerToolchains(); + ActionEventCommoneventFramenodeClip(); + UIComponentSpecialComponentsFrameNodeAttributeInterface(); + UiComponentCmmonattrRenderingTest(); + UIFrameNodeRanderNodeMarkNodeGroup(); + UiComponentGraphicNodecontainerBuildernodeTest() + UiFrameNodeRenderNodeMarkNodeAdapterTest(); + UIComponentCraphicNodeContainerRenderTest(); + UIMotionAnimationImperativeprope(); + UIFrameNodeAcquisitionAbility(); + ActionEventCommonEventFrameNode(); + UIComponentGraphicNodeContainerToolChainsTest(); + UIComponentSpecialComponentsFrameNodePageInfo(); + ComponentGtaphicNodecontainerDocDemo(); + } - - diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCraphicNodeContainerRenderTest/UIComponentCraphicNodeContainerRender.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCraphicNodeContainerRenderTest/UIComponentCraphicNodeContainerRender.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f9d860aa975f1ce26bb103e950533628074ce59c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentCraphicNodeContainerRenderTest/UIComponentCraphicNodeContainerRender.test.ets @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, afterEach, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + + +import { Component, Driver ,ON } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit' + +/* + * UIComponentCraphicNodeContainerRender + * + * 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 UIComponentCraphicNodeContainerRenderTest() { + + describe('UIComponentCraphicNodeContainerRenderTest', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0010 + * @tc.desc constructor构建正常 + */ + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0010 start.`); + Settings.createWindow("testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0010"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0080 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0080 + * @tc.desc clipToFrame设置为true,超出该RenderNode大小的部分将会被截断 + */ + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0080 start.`); + Settings.createWindow("testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0080"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0260 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0260 + * @tc.desc draw设置绘制方法正常 + */ + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0260 start.`); + Settings.createWindow("testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0260"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0270 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0270 + * @tc.desc invalidate触发RenderNode的重新渲染正常 + */ + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0270 start.`); + Settings.createWindow("testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0270"); + await Utils.sleep(1000); + const driver = Driver.create(); + const button = await driver.findComponent(ON.id('UIComponentCraphicNodeContainerRender0270')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_RENDER_0270 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGraphicNodeContainerToolChainsTest/UIComponentGraphicNodeContainerToolChainsTest.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGraphicNodeContainerToolChainsTest/UIComponentGraphicNodeContainerToolChainsTest.ets new file mode 100644 index 0000000000000000000000000000000000000000..d99202617501514207b8847de780da0c0dad7fc1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGraphicNodeContainerToolChainsTest/UIComponentGraphicNodeContainerToolChainsTest.ets @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, expect, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON } from '@kit.TestKit' + +export default function UIComponentGraphicNodeContainerToolChainsTest() { + + describe('UIComponentGraphicNodeContainerToolChainsTest', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0010 start.`); + Settings.createWindow("testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0010"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0010 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0030 start.`); + Settings.createWindow("testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0030"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0030 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0040 start.`); + Settings.createWindow("testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0040"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0040 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0050 start.`); + Settings.createWindow("testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0050"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0050 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0060 start.`); + Settings.createWindow("testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0060"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('nodeControllerID')); + await modifyButton.click(); + await Utils.sleep(1000); + await modifyButton.longClick(); + await Utils.sleep(1000); + + let clickComponent = await driver.findComponent(ON.text('点击事件执行结果:click event')) + let gestureComponent = await driver.findComponent(ON.text('长按手势执行结果:longPress gesture')) + expect(clickComponent !== null).assertTrue(); + expect(gestureComponent !== null).assertTrue(); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0060 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0070 start.`); + Settings.createWindow("testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0070"); + await Utils.sleep(1000); + + let driver = Driver.create(); + let modifyButton = await driver.findComponent(ON.id('animateButton')); + await modifyButton.click(); + await Utils.sleep(1000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0070 finish.`); + done(); + }) + + }) +} \ No newline at end of file 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..82fa12109dc0a2486624e3a56e67cfa5aee580a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentPopupBoxPopupFollowTransformOfTargetTest/UIComponentPopupBoxPopupFollowTransformOfTarget.test.ets @@ -0,0 +1,562 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 } from "@ohos/hypium" +import Settings from "../model/Settings" +import windowSnap from "../model/snapShot" +import Logger from "../model/Logger" +import Utils from "../model/Utils" +import { Driver, ON, Component } from "@kit.TestKit" + +export default function UIComponentPopupBoxPopupFollowTransformOfTargetTest() { + + describe("UIComponentPopupBoxPopupFollowTransformOfTargetTest", () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error("TEST", "Failed to destroy the window. Cause : ${JSON.stringify(err)}"); + return; + } + Logger.info("TEST", "Succeeded in destroy the window."); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1190 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1190 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1190', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1190") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let animation: Component = await driver.findComponent(ON.id('animation')); + await animation.click(); + await Utils.sleep(1000); + await scale.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0790 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0790 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0790', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0790") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let animation: Component = await driver.findComponent(ON.id('animation')); + await animation.click(); + await Utils.sleep(1000); + await scale.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0760 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0760 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0760', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0760") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let translate: Component = await driver.findComponent(ON.id('translate')); + await translate.click(); + await Utils.sleep(1000); + let translation: Component = await driver.findComponent(ON.id('translation')); + await translation.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0340 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0340 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0340', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0340") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0330 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0330 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0330', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0330") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let rotate: Component = await driver.findComponent(ON.id('rotate')); + await rotate.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1180 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1180 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1180', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1180") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1170 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1170 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1170', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1170") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let rotate: Component = await driver.findComponent(ON.id('rotate')); + await rotate.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0350 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0350 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0350', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0350") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let animation: Component = await driver.findComponent(ON.id('animation')); + await animation.click(); + await Utils.sleep(1000); + await scale.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0370 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0370 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0370', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0370") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let rotate: Component = await driver.findComponent(ON.id('rotate')); + await rotate.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1200 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1200 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_1200', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1200") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let translate: Component = await driver.findComponent(ON.id('translate')); + await translate.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0380 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0380 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0380', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0380") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0390 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0390 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0390', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0390") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let animation: Component = await driver.findComponent(ON.id('animation')); + await animation.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0820 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0820 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0820', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0820") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0410 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0410 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0410', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0410") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let rotate: Component = await driver.findComponent(ON.id('rotate')); + await rotate.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0400 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0400 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0400', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0400") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let translate: Component = await driver.findComponent(ON.id('translate')); + await translate.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0860 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0860 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0860', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0860") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0880 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0880 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0880', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0880") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let translate: Component = await driver.findComponent(ON.id('translate')); + await translate.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0870 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0870 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0870', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0870") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + let animation: Component = await driver.findComponent(ON.id('animation')); + await animation.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0830 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0830 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0830', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0830") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let animation: Component = await driver.findComponent(ON.id('animation')); + await animation.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0840 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0840 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0840', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0840") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let translate: Component = await driver.findComponent(ON.id('translate')); + await translate.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0420 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0420 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0420', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0420") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let scale: Component = await driver.findComponent(ON.id('scale')); + await scale.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0430 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0430 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0430', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0430") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let animation: Component = await driver.findComponent(ON.id('animation')); + await animation.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0440 + * @tc.name SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0440 + */ + it('SUB_ACE_UI_COMPONENT_POPUPBOX_POPUP_FOLLOWTRANSFORMOFTARGET_0440', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0440") + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await driver.pressBack(); + await Utils.sleep(1000); + let translate: Component = await driver.findComponent(ON.id('translate')); + await translate.click(); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodeAttributeInterfaceTest/UIComponentSpecialComponentsFrameNodeAttributeInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodeAttributeInterfaceTest/UIComponentSpecialComponentsFrameNodeAttributeInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..49d4df846aaa47d6c4fed134281e569d2cb709e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodeAttributeInterfaceTest/UIComponentSpecialComponentsFrameNodeAttributeInterface.test.ets @@ -0,0 +1,3085 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + + +import { Component, Driver ,ON } from '@ohos.UiTest' +import { KeyCode } from '@kit.InputKit' + +/* + * UIAttributesBackgroundSelfDrawing + * + * 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 UIComponentSpecialComponentsFrameNodeAttributeInterface() { + + describe('UIComponentSpecialComponentsFrameNodeAttributeInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0130") + await Utils.sleep(1000); + const driver = Driver.create(); + const click0130 = await driver.findComponent(ON.id('click0130')); + await Utils.sleep(5000); + await click0130.click(); + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2030 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2030 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置borderRadius + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2030 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2030"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2040 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2040 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置opacity + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2040 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2040"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0980 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0980 + * @tc.desc FrameNode支持设置borderRadius + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0980 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0980"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0980 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1800 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1800 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置borderStyle + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1800 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1800"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1800 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0750 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0750 + * @tc.desc FrameNode支持设置borderStyle + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0750 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0750"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0750 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0740 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0740 + * @tc.desc FrameNode支持设置borderWidth + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0740 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0740"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0740 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1790 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1790 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置borderWidth + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1790 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1790"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1790 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0630 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0630 + * @tc.desc FrameNode支持设置brightness + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0630 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0630"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0630 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1680 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1680 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置brightness + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1680 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1680"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1680 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0340 + * @tc.desc FrameNode支持设置clickEffect + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0340 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0340"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0340 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1390 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1390 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置clickEffect + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1390 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1390"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1390 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1310 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1310 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置clip + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1310 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1310"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0260 + * @tc.desc FrameNode支持设置clip + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0260 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0260"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0600 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0600 + * @tc.desc FrameNode支持设置colorBlend + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0600 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0600"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0600 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1650 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1650 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置colorBlend + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1650 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1650"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1650 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0140 + * @tc.desc FrameNode支持设置CommonAttribute + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0140"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1190 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1190 + * @tc.desc FrameNode支持设置CommonAttribute + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1190 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1190"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1890 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1890 + * @tc.desc FrameNode支持设置CommonAttribute + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1890 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1890"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1890 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0840 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0840 + * @tc.desc FrameNode支持设置CommonAttribute + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0840', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0840 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0840"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0840 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1670 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1670 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置contrast + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1670 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1670"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1670 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0620 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0620 + * @tc.desc FrameNode支持设置contrast + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0620 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0620"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0620 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0670 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0670 + * @tc.desc FrameNode支持设置defaultFocus + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0670 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0670"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0670 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1720 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1720 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置defaultFocus + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1720 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1720"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1720 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0420 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0420 + * @tc.desc FrameNode支持设置direction + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0420 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0420"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0420 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1470 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1470 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置direction + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1470 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1470"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1470 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0450 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0450 + * @tc.desc FrameNode支持设置displayPriority + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0450 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0450"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0450 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1500 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1500 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置displayPriority + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1500 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1500"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1500 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1370 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1370 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置draggable + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1370 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1370"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0320 + * @tc.desc FrameNode支持设置draggable + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0320"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0080 + * @tc.desc FrameNode支持设置dragPreviewOptions + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0080"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1130 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1130 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置dragPreviewOptions + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1130 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1130"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1420 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1420 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置enabled + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1420 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1420"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1420 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0370 + * @tc.desc FrameNode支持设置enabled + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0370"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1920 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1920 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置expandSafeArea + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1920 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1920"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1920 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0870 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0870 + * @tc.desc FrameNode支持设置expandSafeArea + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0870', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0870 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0870"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0870 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0470 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0470 + * @tc.desc FrameNode支持设置flexBasis + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0470 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0470"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0470 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1520 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1520 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置flexBasis + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1520 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1520"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1520 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1540 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1540 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置flexGrow + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1540 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1540"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1540 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0490 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0490 + * @tc.desc FrameNode支持设置flexGrow + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0490 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0490"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0490 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0480 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0480 + * @tc.desc FrameNode支持设置flexShrink + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0480 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0480"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0480 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1530 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1530 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置flexShrink + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1530 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1530"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1530 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0690 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0690 + * @tc.desc FrameNode支持设置focusable + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0690 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0690"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0690 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1740 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1740 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置focusable + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1740 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1740"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1740 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0650 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0650 + * @tc.desc FrameNode支持设置focusOnTouch + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0650 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0650"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0650 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1700 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1700 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置focusOnTouch + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1700 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1700"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1700 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0770 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0770 + * @tc.desc FrameNode支持设置foregroundBlurStyle + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0770 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0770"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0770 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1820 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1820 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置foregroundBlurStyle + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1820 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1820"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1820 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0710 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0710 + * @tc.desc FrameNode支持设置foregroundColor + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0710 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0710"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0710 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1760 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1760 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置foregroundColor + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1760 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1760"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1760 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0230 + * @tc.desc FrameNode支持设置geometryTransition + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0230 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0230"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1280 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1280 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置geometryTransition + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1280 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1280"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1660 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1660 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置grayscale + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1660 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1660"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1660 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0610 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0610 + * @tc.desc FrameNode支持设置grayscale + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0610 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0610"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0610 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0520 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0520 + * @tc.desc FrameNode支持设置gridOffset + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0520 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0520"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0520 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1570 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1570 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置gridOffset + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1570 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1570"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1570 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1580 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1580 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置gridSpan + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1580 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1580"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1580 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0530 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0530 + * @tc.desc FrameNode支持设置gridSpan + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0530 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0530"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0530 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0660 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0660 + * @tc.desc FrameNode支持设置groupDefaultFocus + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0660 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0660"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0660 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1710 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1710 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置groupDefaultFocus + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1710 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1710"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1710 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1930 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1930 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置height + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1930 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1930"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1930 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0880 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0880 + * @tc.desc FrameNode支持设置height + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0880', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0880 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0880"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0880 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1880 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1880 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置hitTestBehavior + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1880', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1880 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1880"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentSpecialComponentsFrameNodeAttributeInterface1880_001')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1880 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0830 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0830 + * @tc.desc FrameNode支持设置hitTestBehavior + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0830', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0830 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0830"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentSpecialComponentsFrameNodeAttributeInterface0830_001')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0830 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0700 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0700 + * @tc.desc FrameNode支持设置hoverEffect + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0700 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0700"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentSpecialComponentsFrameNodeAttributeInterface0700_001')); + const point = await button.getBoundsCenter(); + await driver.mouseMoveTo(point) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0700 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1750 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1750 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置hoverEffect + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1750 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1750"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentSpecialComponentsFrameNodeAttributeInterface1750_001')); + const point = await button.getBoundsCenter(); + await driver.mouseMoveTo(point) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1750 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0570 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0570 + * @tc.desc FrameNode支持设置hueRotate + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0570 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0570"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0570 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1620 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1620 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置hueRotate + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1620 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1620"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1620 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1290 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1290 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置id + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1290 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1290"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0240 + * @tc.desc FrameNode支持设置id + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0240 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0240"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1170 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1170 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置invert + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1170 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1170"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0120 + * @tc.desc FrameNode支持设置invert + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0120"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2090 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2090 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置key + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2090 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2090"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1040 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1040 + * @tc.desc FrameNode支持设置key + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1040 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1040"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1870 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1870 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置layoutWeight + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1870', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1870 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1870"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1870 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0820 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0820 + * @tc.desc FrameNode支持设置layoutWeight + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0820 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0820"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0820 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1010 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface101") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0540 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface054") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0540 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0850', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0850 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface085") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0850 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1590 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface159") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1590 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1900 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface190") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1900 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1440 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface144") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1440 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0390 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface039") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0390 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1330 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface133") + await Utils.sleep(1000); + const driver = Driver.create(); + const button133 = await driver.findComponent(ON.id('button133')); + await Utils.sleep(500); + await button133.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1330 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0280 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface028") + await Utils.sleep(1000); + const driver = Driver.create(); + const button028 = await driver.findComponent(ON.id('button028')); + await Utils.sleep(500); + await button028.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0280 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1480 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface148") + await Utils.sleep(1000); + const driver = Driver.create(); + const click148 = await driver.findComponent(ON.id('click148')); + await Utils.sleep(500); + await click148.click(); + await Utils.sleep(4000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1480 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0430 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface043") + await Utils.sleep(1000); + const driver = Driver.create(); + const click043 = await driver.findComponent(ON.id('click043')); + await Utils.sleep(1000); + await click043.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0430 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface006") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0060 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1110 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface111") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1110 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1080 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface108") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1080 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface003") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0300 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface030") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0300 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1350 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface135") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1350 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface005") + await Utils.sleep(500) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1100 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface110") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1100 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface001") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1060 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface106") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1060 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0440 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface044") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0440 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1490 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface149") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1490 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0970', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0970 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface097") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0970 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2020 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface202") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2020 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1450 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface145") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1450 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1210 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface121") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1210 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface016") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0160 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0400 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface040") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0400 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1730 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface173") + await Utils.sleep(1000); + const driver = Driver.create(); + driver.triggerKey(2049) + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1730 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0680 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface068") + await Utils.sleep(1000); + const driver = Driver.create(); + driver.triggerKey(2049) + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0680 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1180 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface118") + await Utils.sleep(1000); + const driver = Driver.create(); + const click118 = await driver.findComponent(ON.id('click118')); + await Utils.sleep(1000); + await click118.click(); + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1180 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1610 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface161") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1610 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0560 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface056") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0560 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1910', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1910 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface191") + await Utils.sleep(1000) + const driver = Driver.create(); + let tabsCenter:Component = await driver.findComponent(ON.id('click191')); + let pos = await tabsCenter.getBoundsCenter() + await driver.click(pos.x-100,pos.y); + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1910 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0990', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0990 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface099") + await Utils.sleep(1000) + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0990 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1260 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1260") + let driver = Driver.create(); + await Utils.sleep(1000); + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_W); //绑定 CTRL+W 快捷键 + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1260 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0210 + * @tc.desc 创建命令式节点FrameNode,绑定keyboardShortcut属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0210 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0210"); + let driver = Driver.create(); + await Utils.sleep(1000); + console.log("zxx triggerCombineKeys CTRL+W ") + await driver.triggerCombineKeys(KeyCode.KEYCODE_CTRL_LEFT, KeyCode.KEYCODE_W); //绑定 CTRL+W 快捷键 + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0210 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0590 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0590 + * @tc.desc 创建FrameNode,绑定saturate属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0590 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface059"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0590 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1640 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1640 + * @tc.desc 创建FrameNode,绑定节点设置saturate属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1640 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface164"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1640 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0410 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0410 + * @tc.desc 创建FrameNode,绑定align属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0410 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface041"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0410 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1460 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1460 + * @tc.desc 创建FrameNode,绑定节点设置align属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1460 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface146"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1460 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1410 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1410 + * @tc.desc 创建FrameNode,绑定节点设置alignRules属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1410 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface141"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1410 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0360 + * @tc.desc 创建FrameNode,设置alignRules属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0360 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface036"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0360 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0460 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0460 + * @tc.desc 创建FrameNode,设置alignSelf属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0460 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface046"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0460 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1510 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1510 + * @tc.desc 创建FrameNode,绑定节点设置alignSelf属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1510 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface151"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1400 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1400 + * @tc.desc 创建FrameNode,绑定节点设置aspectRatio属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1400 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface140"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1400 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0350 + * @tc.desc 创建FrameNode,设置aspectRatio属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface035"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0350 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0090 + * @tc.desc 创建FrameNode,设置backdropBlur属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0090 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface009"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1140 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1140 + * @tc.desc 创建FrameNode,绑定节点设置backdropBlur属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1140 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface114"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1830 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1830 + * @tc.desc 创建FrameNode,绑定节点设置backgroundBlurStyle属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1830', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1830 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface183"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1830 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0780 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0780 + * @tc.desc 创建FrameNode,设置backgroundBlurStyle属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0780', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0780 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface078"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0780 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0070 + * @tc.desc 创建FrameNode,设置backgroundBrightness属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface007"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1120 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1120 + * @tc.desc 创建FrameNode,绑定节点设置backgroundBrightness属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1120 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface112"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2050 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2050 + * @tc.desc 创建FrameNode,绑定节点设置backgroundColor属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2050 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface205"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1000 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1000 + * @tc.desc 创建FrameNode,设置backgroundColor属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1000 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface100"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1000 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0110 + * @tc.desc 创建FrameNode,设置backgroundEffect属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface011"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1160 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1160 + * @tc.desc 创建FrameNode,绑定节点设置backgroundEffect属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1160 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface116"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1860 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1860 + * @tc.desc 创建FrameNode,绑定节点设置backgroundImage属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1860', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1860 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface186"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1860 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0810 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0810 + * @tc.desc 创建FrameNode,设置backgroundImage属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0810 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface081"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0810 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0790 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0790 + * @tc.desc 创建FrameNode,设置backgroundImagePosition属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0790 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface079"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0790 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1840 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1840 + * @tc.desc 创建FrameNode,绑定节点设置backgroundImagePosition属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1840', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1840 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface184"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1840 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0800 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0800 + * @tc.desc 创建FrameNode,设置backgroundImageSize属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0800 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface080"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0800 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1850 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1850 + * @tc.desc 创建FrameNode,绑定节点设置backgroundImageSize属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1850', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1850 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface185"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1850 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2080 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2080 + * @tc.desc 创建FrameNode,绑定节点设置blendMode属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2080 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface208"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1030 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1030 + * @tc.desc 创建FrameNode,设置blendMode属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1030 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface103"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1150 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1150 + * @tc.desc 创建FrameNode,绑定节点设置blur属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1150 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface115"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0100 + * @tc.desc 创建FrameNode,设置blur属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface010"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0760 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0760 + * @tc.desc 创建FrameNode,设置border属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0760 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface076"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0760 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1810 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1810 + * @tc.desc 创建FrameNode,绑定节点设置border属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1810 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface181"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1810 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1780 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1780 + * @tc.desc 创建FrameNode,绑定节点设置borderColor属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1780', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1780 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface178"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1780 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0730 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0730 + * @tc.desc 创建FrameNode,设置borderColor属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0730 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface073"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0730 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1770 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1770 + * @tc.desc 创建FrameNode,绑定节点设置borderImage属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1770 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface177"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1770 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0720 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0720 + * @tc.desc 创建FrameNode,设置borderImage属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0720 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface072"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0720 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1380 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1380 + * @tc.desc 创建FrameNode,绑定节点设置allowDrop属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1380 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface138"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let component = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface138_001")); + let textArea = await driver.findComponent(ON.id('UIComponentSpecialComponentsFrameNodeAttributeInterface138_002')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + await component.dragTo(textArea) + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1380 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0330 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0330 + * @tc.desc 创建FrameNode,设置allowDrop属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0330 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface033"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(500); + let component = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface033_001")); + let textArea = await driver.findComponent(ON.id('UIComponentSpecialComponentsFrameNodeAttributeInterface033_002')); + await Utils.sleep(1000); + await component.longClick(); + await Utils.sleep(1000); + await component.dragTo(textArea) + await Utils.sleep(500); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0330 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1230 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1230 + * @tc.desc 创建FrameNode,绑定节点设置accessibilityDescription属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1230 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface123"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface123_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityDescription is: " + JSON.parse(strJson).$attrs.accessibilityDescription); + expect(JSON.parse(strJson).$attrs.accessibilityDescription).assertEqual('accessibilityDescription'); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1230 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0180 + * @tc.desc 创建FrameNode,设置accessibilityDescription属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface018"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface018_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityDescription is: " + JSON.parse(strJson).$attrs.accessibilityDescription); + expect(JSON.parse(strJson).$attrs.accessibilityDescription).assertEqual('accessibilityDescription'); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0180 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0200 + * @tc.desc 创建FrameNode,设置accessibilityGroup属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0200 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface020"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface020_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityGroup is: " + JSON.parse(strJson).$attrs.accessibilityGroup); + expect(JSON.parse(strJson).$attrs.accessibilityGroup).assertEqual(true); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0200 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1250 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1250 + * @tc.desc 创建FrameNode,绑定节点设置accessibilityGroup属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1250 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface125"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface125_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityGroup is: " + JSON.parse(strJson).$attrs.accessibilityGroup); + expect(JSON.parse(strJson).$attrs.accessibilityGroup).assertEqual(true); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1250 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0170 + * @tc.desc 创建FrameNode,设置accessibilityLevel属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface017"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface017_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityLevel is: " + JSON.parse(strJson).$attrs.accessibilityLevel); + expect(JSON.parse(strJson).$attrs.accessibilityLevel).assertEqual('yes'); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0170 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1220 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1220 + * @tc.desc 创建FrameNode,绑定节点设置accessibilityLevel属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1220 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface122"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface122_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityLevel is: " + JSON.parse(strJson).$attrs.accessibilityLevel); + expect(JSON.parse(strJson).$attrs.accessibilityLevel).assertEqual('yes'); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1220 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0190 + * @tc.desc 创建FrameNode,设置accessibilityText属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0190 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface019"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface019_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityText is: " + JSON.parse(strJson).$attrs.accessibilityText); + expect(JSON.parse(strJson).$attrs.accessibilityText).assertEqual('accessibilityText'); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1240 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1240 + * @tc.desc 创建FrameNode,绑定节点设置accessibilityText属性 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1240 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface124"); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + let strJson = getInspectorByKey('UIComponentSpecialComponentsFrameNodeAttributeInterface124_001') + Logger.info('TEST', "JSON.parse(strJson).$attrs.accessibilityText is: " + JSON.parse(strJson).$attrs.accessibilityText); + expect(JSON.parse(strJson).$attrs.accessibilityText).assertEqual('accessibilityText'); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1240 finish.`); + done() + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0860 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0860 + * @tc.desc FrameNode支持设置responseRegion + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0860', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0860 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0860"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface0860")); + await SliderCom.click(); + await driver.delayMs(600); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0860 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0550 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0550 + * @tc.desc FrameNode支持设置translate + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0550 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0550"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface0550")); + await SliderCom.click(); + await driver.delayMs(600); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1600 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1600 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置translate + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1600 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1600"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface1600")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1600 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0150 + * @tc.desc FrameNode支持设置renderFit + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0150"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface0150")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0150 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1200 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1200 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置renderFit + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1200 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface1200")); + await SliderCom.click(); + await driver.delayMs(600); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1560 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1560 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置rotate + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1560 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1560"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface1560")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1560 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0510 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0510 + * @tc.desc FrameNode支持设置rotate + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0510 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0510"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface0510")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0510 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1430 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1430 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置offset + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1430 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1430"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface1430")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1430 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0380 + * @tc.desc FrameNode支持设置offset + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0380 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0380"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface0380")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0940 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0940 + * @tc.desc FrameNode支持设置inearGradientBlur + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0940 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0940"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIComponentSpecialComponentsFrameNodeAttributeInterface0940")); + await SliderCom.click(); + await driver.delayMs(600); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0940 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1990 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1990 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置linearGradientBlur + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1990', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1990 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1990"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1990 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1320 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1320 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置shadow + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1320 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1320"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0960 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0960 + * @tc.desc FrameNode支持设置linearGradient + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UILCOMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0960 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0960"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UILCOMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0960 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2010 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2010 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置linearGradient + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2010 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2010"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0270 + * @tc.desc FrameNode支持设置shadow + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0270"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1690 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1690 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置transition + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1690 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1690"); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1690 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0640 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0640 + * @tc.desc FrameNode支持设置transition + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0640 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0640"); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0640 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0930 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0930 + * @tc.desc FrameNode支持设置pixelStretchEffect + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0930 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0930"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0930 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1980 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1980 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置pixelStretchEffect + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1980 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1980"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1980 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1550 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1550 + * @tc.desc FrameNode通过查询获得的声明式节点支持设置transform + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1550 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1550"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0500 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0500 + * @tc.desc FrameNode支持设置translate + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0500 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0500"); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0500 finish.`); + done(); + }) + + + ////// + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0020 + * @tc.desc 设置的outlineRadius属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0020"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0040 + * @tc.desc 设置的outlineWidth属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0040"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0250 + * @tc.desc 设置的mask属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0250 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0250"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0250 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0290 + * @tc.desc 设置的radialGradient属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0290"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0290 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0310 + * @tc.desc 设置的overlay属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0310 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0310"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0310 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0580 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0580 + * @tc.desc 设置的sepia属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0580 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0580"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0580 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0890 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0890 + * @tc.desc 设置的width属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0890 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0890"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0890 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0910 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0910 + * @tc.desc 设置的sphericalEffect属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0910', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0910 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0910"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0910 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0920 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0920 + * @tc.desc 设置的lightUpEffect属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0920 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0920"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_0920 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1020 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1020 + * @tc.desc 设置的padding属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1020 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1020"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1070 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1070 + * @tc.desc 设置的outlineRadius属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1070 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1070"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1090 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1090 + * @tc.desc 设置的outlineWidth属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1090 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1090"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1300 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1300 + * @tc.desc 设置的mask属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1300 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1300"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1300 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1340 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1340 + * @tc.desc 设置的radialGradient属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1340 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1340"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1340 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1360 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1360 + * @tc.desc 设置的overlay属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1360 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1360"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1360 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1630 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1630 + * @tc.desc 设置的sepia属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1630 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1630"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1630 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1940 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1940 + * @tc.desc 设置的width属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1940 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1940"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1940 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1950 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1950 + * @tc.desc 设置的useEffect属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1950 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1950"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1950 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1960 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1960 + * @tc.desc 设置的sphericalEffect属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1960 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1960"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1960 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1970 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1970 + * @tc.desc 设置的lightUpEffect属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1970', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1970 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1970"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_1970 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2000 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2000 + * @tc.desc 设置的useSizeType属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2000 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2000"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2000 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2060 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2060 + * @tc.desc 设置的margin属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2060 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2060"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2070 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2070 + * @tc.desc 设置的padding属性生效 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2070 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2070"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_ATTRIBUTE_INTERFACE_2070 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca9e36ee8e78fb81d56cb0a4344d7aa2fd5f9843 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo.test.ets @@ -0,0 +1,234 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +import { Component, Driver, ON } from '@ohos.UiTest' + +/* + * UIAttributesBackgroundSelfDrawing + * + * 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 UIComponentSpecialComponentsFrameNodePageInfo() { + + describe('UIComponentSpecialComponentsFrameNodePageInfo', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0010 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0010 + * @tc.desc : 获取未在Navigation和NavDestination内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0010 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0010"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0010 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0020 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0020 + * @tc.desc : 获取在Navigation内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0020 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0020"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0020 finish.`); + done(); + }) + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0030 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0030 + * @tc.desc : 带取在Navigation和NavDestination内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0030 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0030"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0030 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0040 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0040 + * @tc.desc : 获取在CustomDialog内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0040 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0040"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.text('click')); + await button.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0040 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0050 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0050 + * @tc.desc : 获取在bindSheet内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0050 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0050"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.text('bindSheet')); + await button.click() + await Utils.sleep(1500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0050 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0060 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0060 + * @tc.desc : 获取在bindContentCover内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0060 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0060"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let bindContentCover: Component = await driver.findComponent(ON.text('bindContentCover')); + await bindContentCover.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0070 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0070 + * @tc.desc : 获取在模态弹窗的Navigation和NavDestination内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0070 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0070"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let bindContentCover: Component = await driver.findComponent(ON.text('CustomDialog')); + await bindContentCover.click() + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0070 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0080 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0080 + * @tc.desc : 获取在Navigation嵌套的子Navigation内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0080 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0080"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0080 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0090 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0090 + * @tc.desc : 获取在Navigation嵌套的子Navigation中的NavDestination内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0090 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0090"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0090 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0100 + * @tc.name : SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0100 + * @tc.desc : 获取在Navigation与Router混用后跳转页面的内部的节点的Router和Navigation页面信息 + */ + it('SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0100 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0100"); + await Utils.sleep(1000); + + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let router: Component = await driver.findComponent(ON.id('Router')); + await router.click() + await Utils.sleep(2000); + + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_ACTION_EVENT_COMMONEVENT_FRAMENODE_PAGEINFO_0100 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodeTextureXportTest/UIComponentSpecialComponentsFrameNodeTextureXport.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodeTextureXportTest/UIComponentSpecialComponentsFrameNodeTextureXport.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8b365b41874d5d3d321711ca315c773af66c9ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSpecialComponentsFrameNodeTextureXportTest/UIComponentSpecialComponentsFrameNodeTextureXport.test.ets @@ -0,0 +1,1279 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 } from "@ohos/hypium" +import Settings from "../model/Settings" +import windowSnap from "../model/snapShot" +import Logger from "../model/Logger" +import Utils from "../model/Utils" +import { Driver, ON, Component } from "@kit.TestKit" + +export default function UIComponentSpecialComponentsFrameNodeTextureXportTest() { + + describe("UIComponentSpecialComponentsFrameNodeTextureXportTest", () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error("TEST", "Failed to destroy the window. Cause : ${JSON.stringify(err)}"); + return; + } + Logger.info("TEST", "Succeeded in destroy the window."); + }) + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0160 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0160', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0160") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0020 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0020', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0020") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0180 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0180', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0180") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0140 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0140', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0140") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0170 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0170', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0010 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0010', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0010") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0200 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0200 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0200', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0200") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0210 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0210', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0210") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0240 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0240', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0240") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0260 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0260', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0260") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0280 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0280', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0280") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0290 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0290', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0290") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0300 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0300 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0300', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0300") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0320 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0320 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0320', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0320") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0330 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0330 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0330', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0330") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0340 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0340 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0340', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0340") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0400 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0400 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0400', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0400") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0410 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0410 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0410', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0410") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0420 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0420 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0420', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0420") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0450 + * @tc.name SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0450 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0450', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0450") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let render_type_display: Component = await driver.findComponent(ON.id('render_type_display')); + await render_type_display.click(); + await Utils.sleep(1000); + await driver.swipe(200, 700, 200, 550, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 + * @tc.desc : CanvasRenderingContext2D组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0060"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0110 + * @tc.desc : ColumnSplit组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0110"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0120 + * @tc.desc : Column组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0120"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0130 + * @tc.desc : ContainerSpan组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0130"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0150 + * @tc.desc : DataPanel组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0150"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0220 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0220 + * @tc.desc : ImageData组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0220"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0230 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0230 + * @tc.desc : Image组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0230"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0250 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0250 + * @tc.desc : LoadingProgress组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0250"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await button.click(); + await Utils.sleep(500); + await windowSnap.snapShot(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + let btn1 = await driver.findComponent(ON.id('UIComponentSpecialComponentsFrameNodeTexetureExport0250_btn1')); + await btn1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0270 + * @tc.desc : Matrix2D组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0270"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0310 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0310 + * @tc.desc : Path组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0310"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0360 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0360 + * @tc.desc : QRCode组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0360 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0360"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0380 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0380 + * @tc.desc : Rating组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0380 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0380"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0390 + * @tc.name : SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0390 + * @tc.desc : Rect组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0390 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0390"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(200); + let button: Component = await driver.findComponent(ON.id('render_type_display')); + await Utils.sleep(500); + await button.click(); + await Utils.sleep(1000); + let scroller1 = await driver.findComponent(ON.id('scroller1')); + await Utils.sleep(200); + await scroller1.scrollToBottom(1500); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0060 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0350 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0350 + * @tc.desc: Progress组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0350"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export035_button')); + let scroll: Component = await driver.findComponent(ON.id('export035_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0350 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0370 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0370 + * @tc.desc: Radio组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0370 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0370"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export037_button')); + let scroll: Component = await driver.findComponent(ON.id('export037_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0370 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0440 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0440 + * @tc.desc: Slider组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0440 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0440"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export044_button')); + let scroll: Component = await driver.findComponent(ON.id('export044_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0440 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0520 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0520 + * @tc.desc: Toggle组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0520 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0520"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export052_button')); + let scroll: Component = await driver.findComponent(ON.id('export052_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0520 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0490 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0490 + * @tc.desc: TextInput组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0490 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0490"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export049_button')); + let scroll: Component = await driver.findComponent(ON.id('export049_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0490 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0460 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0460 + * @tc.desc: Stack组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0460 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0460"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export046_button')); + let scroll: Component = await driver.findComponent(ON.id('export046_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0460 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0470 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0470 + * @tc.desc: TextArea组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0470 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0470"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export047_button')); + let scroll: Component = await driver.findComponent(ON.id('export047_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0470 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0430 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0430 + * @tc.desc: Shape组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0430 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0430"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export043_button')); + let scroll: Component = await driver.findComponent(ON.id('export043_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0430 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0510 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0510 + * @tc.desc: Text组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0510 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0510"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export051_button')); + let scroll: Component = await driver.findComponent(ON.id('export051_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0510 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0090 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0090 + * @tc.desc: CheckBox组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0090 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0090"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export009_button')); + let scroll: Component = await driver.findComponent(ON.id('export009_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0090 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0480 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0480 + * @tc.desc: TextClock组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0480 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0480"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export048_button')); + let scroll: Component = await driver.findComponent(ON.id('export048_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0480 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0080 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0080 + * @tc.desc: CheckboxGroup组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0080"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export008_button')); + let scroll: Component = await driver.findComponent(ON.id('export008_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0080 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0500 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0500 + * @tc.desc: TextTimer组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0500 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0500"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export050_button')); + let scroll: Component = await driver.findComponent(ON.id('export050_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0500 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0030 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0030 + * @tc.desc: Button组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0030"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export003_button')); + let scroll: Component = await driver.findComponent(ON.id('export003_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0030 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0530 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0530 + * @tc.desc: Video组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0530 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0530"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export053_button')); + let scroll: Component = await driver.findComponent(ON.id('export053_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0530 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0070 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0070 + * @tc.desc: Canvas组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0070"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export007_button')); + let scroll: Component = await driver.findComponent(ON.id('export007_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0070 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0540 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0540 + * @tc.desc: Web组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0540 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0540"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export054_button')); + let scroll: Component = await driver.findComponent(ON.id('export054_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0540 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0040 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0040 + * @tc.desc: CanvasGradient组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0040"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export004_button')); + let scroll: Component = await driver.findComponent(ON.id('export004_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0040 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0190 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0190 + * @tc.desc: Gauge组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0190"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export019_button')); + let scroll: Component = await driver.findComponent(ON.id('export019_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0190 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0100 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0100 + * @tc.desc: Circle组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0100"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export010_button')); + let scroll: Component = await driver.findComponent(ON.id('export010_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0100 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0560 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0560 + * @tc.desc: 自定义组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0560 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0560"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export056_button')); + let scroll: Component = await driver.findComponent(ON.id('export056_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0560 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0050 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0050 + * @tc.desc: CanvasPattern组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0050"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export005_button')); + let scroll: Component = await driver.findComponent(ON.id('export005_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0050 finish.`); + done(); + }) + + /** + * @tc.number: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0550 + * @tc.name: SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0550 + * @tc.desc: XComponent组件Framenode纹理导出界面规格确认 + */ + it('SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0550 start.`); + Settings.createWindow("testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0550"); + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let btn: Component = await driver.findComponent(ON.id('export055_button')); + let scroll: Component = await driver.findComponent(ON.id('export055_scroll')); + await Utils.sleep(1000) + await btn.click() + await Utils.sleep(1000); + await scroll.scrollToBottom(1000); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SPECIALCOMPONENTS_FRAMENODE_TEXETUREEXPORT_0550 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFrameNodeMeasureAndLayoutTest/UIFrameNodeMeasureAndLayout.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFrameNodeMeasureAndLayoutTest/UIFrameNodeMeasureAndLayout.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c98b855146a1e8fb1c579fadfe66b20c21cbded7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFrameNodeMeasureAndLayoutTest/UIFrameNodeMeasureAndLayout.test.ets @@ -0,0 +1,434 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, Component} from '@kit.TestKit' + +/* + * UIFrameNodeMeasureAndLayout + * + * 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 UIFrameNodeMeasureAndLayout() { + + describe('UIFrameNodeMeasureAndLayout', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0030 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0030 + * @tc.desc FrameNode节点重写onMeasure方法可以对子节点进行设置 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0030', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0030"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0010 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0010 + * @tc.desc 组件布局为重写onMeasure后调用setMeasureSize修改的测量信息 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0010 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0010") + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0020 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0020 + * @tc.desc FrameNode节点重写onMeasure方法可以通过修改constraint参数,调用measure方法修改测量信息 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0020 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0020") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0020')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0040 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0040 + * @tc.desc FrameNode节点未重写onMeasure方法可以用measure方法对原生布局进行测量 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0040 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0040") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0040')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0040 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0110 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0110 + * @tc.desc FrameNode节点重写onLayout方法可以通过调用setLayoutPosition修改测量信息 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0110 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0110") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0110')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0110 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130 + * @tc.desc FrameNode节点重写onLayout方法可以对子节点进行设置 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0130") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0130')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0120 + * @tc.name SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0120 + * @tc.desc FrameNode节点重写onLayout方法,调用 layout 方法修改布局信息 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0120 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0120") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0120')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0120 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0140 + * @tc.name SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0140 + * @tc.desc FrameNode节点未重写onLayout方法可以用measure方法对原生布局进行测量 + */ + it('SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0140 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0140") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0140')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0050 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0050 + * @tc.desc FrameNode节点重写onMeasure方法可以用setMeasuredSize方法将size宽高的值设置为undefined + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0050 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0050") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0050')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060 + * @tc.desc FrameNode节点重写onMeasure方法可以用setMeasuredSize方法将size宽高的值设置为null + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0060") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0060')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0070 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0070 + * @tc.desc FrameNode节点重写onMeasure方法可以用setMeasuredSize方法将size宽高的值设置为165 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0070 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0070") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0070')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0080 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0080 + * @tc.desc FrameNode节点重写onMeasure方法可以用setMeasuredSize方法将size宽高的值设置为0 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0080 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0080") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0060')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0090 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0090 + * @tc.desc FrameNode节点重写onMeasure方法可以用setMeasuredSize方法将size宽高的值设置为0 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0090 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0090") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0090')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0100 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0100 + * @tc.desc FrameNode节点重写onMeasure方法可以用setMeasuredSize方法将size宽高的值设置为325.99 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0100 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0100") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0100')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0150 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0150 + * @tc.desc FrameNode节点重写onLayout方法可以用setLayoutPosition方法将Position宽高的值设置为undefined + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0150 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0150") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0150')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0150 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0160 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0160 + * @tc.desc FrameNode节点重写onLayout方法可以用setLayoutPosition方法将Position宽高的值设置为null + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0160 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0160") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0160')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0170 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0170 + * @tc.desc FrameNode节点重写onLayout方法可以用setLayoutPosition方法将Position宽高的值设置为165 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0170 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0170") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0170')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0180 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0180 + * @tc.desc FrameNode节点重写onLayout方法可以用setLayoutPosition方法将Position宽高的值设置为null + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0180 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0180") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0180')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0180 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0190 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0190 + * @tc.desc FrameNode节点重写onLayout方法可以用setLayoutPosition方法将Position宽高的值设置为null + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0190 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0190") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0190')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0190 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0200 + * @tc.name SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0200 + * @tc.desc FrameNode节点重写onLayout方法可以用setLayoutPosition方法将Position宽高的值设置为325.99 + */ + it('SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0200 start.`); + Settings.createWindow("testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0200") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('click0200')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_FRAMENODE_GET_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_GET_0180 start.`); + Settings.createWindow("testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4000"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('idBtCreatTextTypeNode')); + await Utils.sleep(1000); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_GET_0180 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFrameNodeRanderNodeMarkNodeGroupTest/UIFrameNodeRanderNodeMarkNodeGroup.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFrameNodeRanderNodeMarkNodeGroupTest/UIFrameNodeRanderNodeMarkNodeGroup.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..77877c43859fc659a81d568a86f97d2370f270b8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFrameNodeRanderNodeMarkNodeGroupTest/UIFrameNodeRanderNodeMarkNodeGroup.test.ets @@ -0,0 +1,262 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, Component, ON } from '@kit.TestKit' + +/* + * UIFrameNodeRanderNodeMarkNodeGroup + * + * 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 UIFrameNodeRanderNodeMarkNodeGroup() { + + describe('UIFrameNodeRanderNodeMarkNodeGroup', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0150 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0150 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制多个有叠加区域的不同颜色的正方形, + * 设置opacity为0.5,设置markNodeGroup为ture + */ + it('SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0150', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0150"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0170 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0170 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形, + * 设置alpha为100,设置opacity为0.5,设置markNodeGroup为false + */ + it('SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0170', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0170"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0180 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0180 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载两个RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形, + * 设置opacity的值为0.5,设置其中一个markNodeGroup为false,另一个为true。 + */ + it('SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0180', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0180"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0210 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0210 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载两个RenderNode,两个节点位置重叠,在节点上绘制两个正方形图像, + * 设置opacity为0.2,设置上方节点markNodeGroup的值为true,下方节点markNodeGroup的值为false + */ + it('SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0210', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0210"); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0010 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0010 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形,设置opacity为0.5,设置markNodeGroup为ture + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0010", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0010 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0010"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0010 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0020 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0020 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形,设置opacity为0.5,设置markNodeGroup为false + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0020", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0020 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0020"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0020 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0030 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0030 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形,设置opacity为0.5,不设置markNodeGroup + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0030", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0030 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0030"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0030 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0060 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0060 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形,不设置opacity,不设置markNodeGroup + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0060", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0060 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0060"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0060 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0070 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0070 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形,不设置opacity,设置markNodeGroup为false + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0070", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0070 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0070"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0070 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0080 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0080 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形,不设置opacity,设置markNodeGroup为true + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0080", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0080 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0080"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0080 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0160 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0160 + * @tc.desc 使用NodeContainer加载一个FrameNode,并挂载RenderNode,在节点上绘制两个有叠加区域的不同颜色的正方形,设置alpha为100,设置opacity为0.5,设置markNodeGroup为ture + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0160", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0160 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0160"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0160 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0190 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0190 + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0190", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0190 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0190"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btn1')); + await btn1.click(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('btn5')); + await btn5.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0190 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0200 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0200 + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0200", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0200 start."); + Settings.createWindow("testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(100); + let btn1: Component = await driver.findComponent(ON.id('btn1')); + await btn1.click(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('btn5')); + await btn5.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_MARKNODEGROUP_0200 finish."); + done(); + }); + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFramenodeAcquisitionAbilityTest/UIFrameNodeAcquisitionAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFramenodeAcquisitionAbilityTest/UIFrameNodeAcquisitionAbility.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..15245de1d6036d141e14cbf9a019b65aa163ec76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIFramenodeAcquisitionAbilityTest/UIFrameNodeAcquisitionAbility.test.ets @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, Component} from '@kit.TestKit' + +/* + * UIFrameNodeMeasureAndLayout + * + * 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 UIFrameNodeAcquisitionAbility() { + + describe('UIFrameNodeAcquisitionAbility', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0020 + * @tc.name SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0020 + * @tc.desc 获取自定义组件的Uniqueld + */ + it('SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0020', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0020"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0030 + * @tc.name SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0030 + * @tc.desc 无渲染属性的自定义组件的Uniqueld获取FrameNode + */ + it('SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0030', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0030"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0050 + * @tc.name SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0050 + * @tc.desc 不存在的Uniqueld获取FrameNode + */ + it('SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0050', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0050"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0060 + * @tc.name SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0060 + * @tc.desc 遍历数字获取FrameNode + */ + it('SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0060', 0, async (done: Function) => { + Settings.createWindow("testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0060"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('button')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + /** + * @tc.number SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0070 + * @tc.name SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0070 + * @tc.desc 未构建状态获取Uniqueld + */ + it('SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0070 start.`); + Settings.createWindow("testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0070"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + 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_FRAMENODE_ACQUISITION_ABILITY_0070 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0040 + * @tc.name SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0040 + * @tc.desc 有渲染属性的自定义组件的Uniqueld获取FrameNode + */ + it('SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0070 start.`); + Settings.createWindow("testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0040"); + await Utils.sleep(1000); + let driver: Driver = Driver.create() + 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_FRAMENODE_ACQUISITION_ABILITY_0040 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UILcomponeentGraphicNodecontainerToolchainsTest/UILcomponeentGraphicNodecontainerToolchains.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UILcomponeentGraphicNodecontainerToolchainsTest/UILcomponeentGraphicNodecontainerToolchains.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ea7c5e743eb719e88d7fa0fea8420d2dadd14f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UILcomponeentGraphicNodecontainerToolchainsTest/UILcomponeentGraphicNodecontainerToolchains.test.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, afterEach, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@kit.TestKit' +import { KeyCode } from '@kit.InputKit' + + +/* + * + * 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 UILcomponeentGraphicNodecontainerToolchains() { + + describe('UILcomponeentGraphicNodecontainerToolchains', () => { + + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + it('SUB_ACE_UILCOMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UILCOMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0020 start.`); + Settings.createWindow("testability/pages/UILcomponeentGraphicNodecontainerToolchains/UILcomponeentGraphicNodecontainerToolchains0020") + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UILCOMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0020 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIMotionAnimationImperativepropeTest/UIMotionAnimationImperativeprope.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIMotionAnimationImperativepropeTest/UIMotionAnimationImperativeprope.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..fbfeac8c0f1b25427d61256dc0f86bcd570efa17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIMotionAnimationImperativepropeTest/UIMotionAnimationImperativeprope.test.ets @@ -0,0 +1,941 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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 } 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' + + +/* + * + * 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 UIMotionAnimationImperativeprope() { + + describe('UIMotionAnimationImperativeprope', () => { + + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0010 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0010 + * @tc.desc 横向放大2倍 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0010 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0010") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0010 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0020 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0020 + * @tc.desc 竖向缩小一半 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0020 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0020") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0030 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0030 + * @tc.desc 不缩放 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0030 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0030") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0040 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0040 + * @tc.desc 横向放大2倍,竖向缩小一半 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0040 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0040") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0050 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0050 + * @tc.desc 横向放大2倍,左右翻转 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0050 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0050") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0430 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0430 + * @tc.desc 不透明度为-0.5 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0430 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0430") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0430 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0450 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0450 + * @tc.desc 不透明度为0.5 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0450 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0450") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0450 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0440 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0440 + * @tc.desc 不透明度为0 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0440 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0440") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0440 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0460 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0460 + * @tc.desc 不透明度为1 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0460 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0460") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0460 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0470 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0470 + * @tc.desc 不透明度为1.5 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0470 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0470") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0470 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0510 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0510 + * @tc.desc position设为x:50y:30 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0510 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0510") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0510 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0520 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0520 + * @tc.desc position设为x:-50 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0520 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0520") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0520 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0530 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0530 + * @tc.desc position设为x:adhg + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0530 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0530") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0530 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0540 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0540 + * @tc.desc position设为x:adhg + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0540 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0540") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0540 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0500 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0500 + * @tc.desc position不设置 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0500 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0500") + await Utils.sleep(1000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('buttton')); + await button.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(1500) + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0500 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0150 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0150 + * @tc.desc 设置backgroundColor为0XFF00FF00 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0150", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0150 start."); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope015"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope015")); + await button.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0150 finish."); + done(); + }); + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0130 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0130 + * @tc.desc 设置backgroundColor为Color.Red + */ + it("SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0130", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0130 start."); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope013"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope013")); + await button.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0130 finish."); + done(); + }); + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0140 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0140 + * @tc.desc backgroundColor为原值 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0140", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0140 start."); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope014"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope014")); + await button.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0140 finish."); + done(); + }); + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0550 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0550 + * @tc.desc 设置偏移量为{x:0,y:0} + */ + it("SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0550", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0550 start."); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope055"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIMotionAnimationImperativeprope055_button")); + await button.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0550 finish."); + done(); + }); + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0560 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0560 + * @tc.desc 设置偏移量为{x:50,y:30} + */ + it("SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0560", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0560 start."); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope056"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button = await driver.findComponent(ON.id("UIMotionAnimationImperativeprope056_button")); + await button.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0560 finish."); + done(); + }); + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0080 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0080 + * @tc.desc rotation的x:10,y:5,z:20 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0080 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0080"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0080")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0090 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0090 + * @tc.desc rotation不设置 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0090 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0090"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0090")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0100 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0100 + * @tc.desc rotation的x-5 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0100 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0100"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0100")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0100 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0160 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0160 + * @tc.desc shadowColor设置为red + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0160 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0160"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0160")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0160 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0170 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0170 + * @tc.desc shadowColor不设置 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0170 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0170"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0170")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0180 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0180 + * @tc.desc shadowColor设置为0XFF00FF00 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0180 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0180"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0180")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0180 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0190 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0190 + * @tc.desc shadowOffset设为x:10,y10 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0190 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0190"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0190")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0190 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0200 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0200 + * @tc.desc shadowOffset不设置 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0200 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0200"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0200")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0210 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0210 + * @tc.desc shadowOffset设为x:-10 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0210 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0210"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0210")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0210 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0240 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0240 + * @tc.desc shadowElevation设为-10 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0240 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0240"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0240")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0240 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0250 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0250 + * @tc.desc shadowElevation设为0 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0250 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0250"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0250")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0250 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0260 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0260 + * @tc.desc shadowElevation设为10 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0260 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0260"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0260")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0260 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0270 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0270 + * @tc.desc shadowElevation设为10.5 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0270 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0270"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0270")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0280 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0280 + * @tc.desc shadowElevation不设置 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0280 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0280"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0280")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0280 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0310 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0310 + * @tc.desc shadowAlpha设为-0.4 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0310 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0310"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0310")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0310 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0320 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0320 + * @tc.desc shadowAlpha设为0 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0320 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0320"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0320")); + await SliderCom.click(); + await Utils.sleep(3000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0330 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0330 + * @tc.desc shadowAlpha设为0.5 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0330 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0330"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0330")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0330 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0340 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0340 + * @tc.desc shadowAlpha设为1.5 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0340 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0340"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0340")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0340 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0370 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0370 + * @tc.desc shadowRadius设为-30 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0370 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0370"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0370")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0370 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0380 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0380 + * @tc.desc shadowRadius设为0 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0380 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0380"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0380")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0390 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0390 + * @tc.desc shadowRadius设为30 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0390 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0390"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0390")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0390 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0400 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0400 + * @tc.desc shadowRadius不设置 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0400 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0400"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0400")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0400 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0570 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0570 + * @tc.desc translation设为x-50 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0570 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0570"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0570")); + await SliderCom.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0570 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0610 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0610 + * @tc.desc transform不设置 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0610 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0610"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0610")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0610 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0620 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0620 + * @tc.desc transform设为[1,0,45,0,0,1,0,00,0,1,00,0,0,1] + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0620 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0620"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0620")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0620 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0630 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0630 + * @tc.desc shadowRadius和shadowElevation同时使用1 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0630 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0630"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0630")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0630 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0640 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0640 + * @tc.desc shadowRadius和shadowElevation同时使用2 + */ + it('SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0640 start.`); + Settings.createWindow("testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0640"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let SliderCom = await driver.findComponent(ON.id("UIMotionAnimationImperativePrope0640")); + await SliderCom.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_MOTION_ANIMATION_IMPERATIVEPROPE_0640 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCmmonattrRenderingTest/UiComponentCmmonattrRendering.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCmmonattrRenderingTest/UiComponentCmmonattrRendering.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0841fc503e46daa59088408e7d6e59f8e331d8ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCmmonattrRenderingTest/UiComponentCmmonattrRendering.test.ets @@ -0,0 +1,343 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 } from "@ohos/hypium" +import Settings from "../model/Settings" +import windowSnap from "../model/snapShot" +import Logger from "../model/Logger" +import Utils from "../model/Utils" +import { Driver, ON,MouseButton } from "@kit.TestKit" + +/* + * UiComponentCmmonattrRenderingTest + * + * 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 UiComponentCmmonattrRenderingTest() { + + describe("UiComponentCmmonattrRenderingTest", () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error("TEST", "Failed to destroy the window. Cause : ${JSON.stringify(err)}"); + return; + } + Logger.info("TEST", "Succeeded in destroy the window."); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0030 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0030 + * @tc.desc 验证在导出的自定义组件中创建DatePicker组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0030", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0030 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0030"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0030 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0040 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0040 + * @tc.desc 验证在导出的自定义组件中创建TimePicker组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0040", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0040 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0040"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0040 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0050 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0050 + * @tc.desc 验证在导出的自定义组件中创建Video组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0050", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0050 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0050"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0050 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0060 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0060 + * @tc.desc 验证在导出的自定义组件中创建Xcomponent组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0060", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0060 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0060"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0060 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0070 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0070 + * @tc.desc 验证在导出的自定义组件中创建List组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0070", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0070 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0070"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0070 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0080 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0080 + * @tc.desc 验证在导出的自定义组件中创建Scroll组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0080", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0080 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0080"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0080 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0090 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0090 + * @tc.desc 验证在导出的自定义组件中创建TextArea组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0090", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0090 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0090"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0090 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0100 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0100 + * @tc.desc 验证在导出的自定义组件中创建TextInput组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0100", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0100 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0100"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0100 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0110 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0110 + * @tc.desc 验证在导出的自定义组件中创建Toggle组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0110", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0110 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0110"); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0110 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0120 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0120 + * @tc.desc 验证在导出的自定义组件中创建web组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0120", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0120 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0120"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0120 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0130 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0130 + * @tc.desc 验证在导出的自定义组件中创建Web组件和Video组件 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0130", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0130 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0130"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0130 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0140 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0140 + * @tc.desc 验证没有指定surfaceld + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0140", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0140 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0140"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0140 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0150 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0150 + * @tc.desc 验证自定义组件上树后内容更新 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0150", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0150 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0150"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0150 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0160 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0160 + * @tc.desc 验证同层渲染,list滑动测试 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0160", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0160 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0160"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let web002 = await driver.findComponent(ON.id("web002")); + await web002.scrollToTop(); + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000); + await web002.scrollToBottom(); + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0160 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0180 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0180 + * @tc.desc 验证同层渲染,双指缩放测试 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0180", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0180 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0180"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let web002 = await driver.findComponent(ON.id("web002")); + await web002.pinchOut(1.5); + await Utils.sleep(2000) + await web002.pinchIn(0); + await Utils.sleep(4000) + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0180 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0190 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0190 + * @tc.desc 验证同层渲染,双击测试 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0190", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0190 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0190"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await driver.mouseDoubleClick({x:300, y:800}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + await Utils.sleep(3000) + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0190 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0200 + * @tc.name SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0200 + * @tc.desc 验证同层渲染,双击测试 + */ + it("SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0200", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0200 start."); + Settings.createWindow("testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0200"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let btn1 = await driver.findComponent(ON.id('UiComponentCmmonattrRendering0200_btn1')); + await btn1.click(); + await Utils.sleep(10000); + await Utils.homeAndBack(driver); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_CMMONATTR_RENDERING_0200 finish."); + done(); + }); + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentGraphicNodecontainerBuildernodeTest/UiComponentGraphicNodecontainerBuildernode.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentGraphicNodecontainerBuildernodeTest/UiComponentGraphicNodecontainerBuildernode.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0026c96fedf4f0bdea0ecdf7ed8924f5fb08aab0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentGraphicNodecontainerBuildernodeTest/UiComponentGraphicNodecontainerBuildernode.test.ets @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 } from "@ohos/hypium" +import Settings from "../model/Settings" +import windowSnap from "../model/snapShot" +import Logger from "../model/Logger" +import Utils from "../model/Utils" +import { Driver, ON,MouseButton } from "@kit.TestKit" + +/* + * UiComponentCmmonattrRenderingTest + * + * 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 UiComponentGraphicNodecontainerBuildernodeTest() { + + describe("UiComponentGraphicNodecontainerBuildernodeTest", () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error("TEST", "Failed to destroy the window. Cause : ${JSON.stringify(err)}"); + return; + } + Logger.info("TEST", "Succeeded in destroy the window."); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0010 + * @tc.desc BuilderNode设置NodeRenderType为RENDER_TYPE_DISPLAY,该节点将被显示到屏幕上 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0010", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0010 start."); + Settings.createWindow("testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0010"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0010 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0020 + * @tc.desc BuilderNode设置NodeRenderType为RENDER_TYPE_TEXTURE,该节点将被导出为纹理 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0020", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0020 start."); + Settings.createWindow("testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0020"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0020 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0030 + * @tc.desc RenderOptions设置selfldealSize,正常生效 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0030", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0030 start."); + Settings.createWindow("testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0030"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0030 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0040 + * @tc.desc RenderOptions设置surfaceld,正常生效 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0040", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0040 start."); + Settings.createWindow("testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0040"); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0040 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0060 + * @tc.desc build创建组件树正常 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0060", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0060 start."); + Settings.createWindow("testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0060"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0060 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0080 + * @tc.desc update更新BuilderNode正常 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0080", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0080 start."); + Settings.createWindow("testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0080"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0080 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0090 + * @tc.desc postTouchEvent派发事件正常 + */ + it("SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0090", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0090 start."); + Settings.createWindow("testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0090"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await driver.fling({x: 500, y: 480},{x: 450, y: 480},5,600); + windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info("TEST", "SUB_ACE_UI_COMPONENT_GRAPHIC_NODECONTAINER_BUILDERNODE_0090 finish."); + done(); + }); + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiFrameNodeRenderNodeMarkNodeAdapterTest/UiFrameNodeRenderNodeMarkNodeAdapter.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiFrameNodeRenderNodeMarkNodeAdapterTest/UiFrameNodeRenderNodeMarkNodeAdapter.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ac22feafafbe00786b3a6c4f468a6cc119e9d0b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiFrameNodeRenderNodeMarkNodeAdapterTest/UiFrameNodeRenderNodeMarkNodeAdapter.test.ets @@ -0,0 +1,203 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, afterEach, 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" + +/* + * UiFrameNodeRenderNodeMarkNodeAdapterTest + * + * 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 UiFrameNodeRenderNodeMarkNodeAdapterTest() { + + describe("UiFrameNodeRenderNodeMarkNodeAdapterTest", () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error("TEST", "Failed to destroy the window. Cause : ${JSON.stringify(err)}"); + return; + } + Logger.info("TEST", "Succeeded in destroy the window."); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0010 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0010 + * @tc.desc 使用Adapter关联FrameNode,设置totalNodeCount + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0010", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0010 start."); + Settings.createWindow("testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0010"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button1 = await driver.findComponent(ON.id("button1")); + await button1.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button2 = await driver.findComponent(ON.id("button2")); + await button2.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button3 = await driver.findComponent(ON.id("button3")); + await button3.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button4 = await driver.findComponent(ON.id("button4")); + await button4.click(); + await Utils.sleep(1000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0010 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0040 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0040 + * @tc.desc 使用Adapter关联FrameNode,调用reloadltem + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0040", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0040 start."); + Settings.createWindow("testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0040"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button00 = await driver.findComponent(ON.id("button-reload-0-0")); + await button00.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button01 = await driver.findComponent(ON.id("button-reload-0-1")); + await button01.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button05 = await driver.findComponent(ON.id("button-reload-0-5")); + await button05.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0040 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0050 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0050 + * @tc.desc 使用Adapter关联FrameNode,调用removeltem + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0050", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0050 start."); + Settings.createWindow("testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0050"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button1 = await driver.findComponent(ON.id("button1")); + await button1.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button2 = await driver.findComponent(ON.id("button2")); + await button2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button3 = await driver.findComponent(ON.id("button3")); + await button3.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0050 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0070 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0070 + * @tc.desc 使用Adapter关联FrameNode,moveItem + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0070", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0070 start."); + Settings.createWindow("testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0070"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button1 = await driver.findComponent(ON.id("button1")); + await button1.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button2 = await driver.findComponent(ON.id("button2")); + await button2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0070 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0060 + * @tc.name SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0060 + * @tc.desc 使用Adapter关联FrameNode,调用insertItem + */ + it("SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0060", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0060 start."); + Settings.createWindow("testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0060"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button1 = await driver.findComponent(ON.id("button1")); + await button1.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button2 = await driver.findComponent(ON.id("button2")); + await button2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + let button3 = await driver.findComponent(ON.id("button3")); + await button3.click(); + await Utils.sleep(1000); + await button2.click(); + await Utils.sleep(2000); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_FRAMENODE_RANDERNODE_markNodeAdapter_0060 finish."); + done(); + }); + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiMotionAnimationMaskTest/UiMotionAnimationMask.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiMotionAnimationMaskTest/UiMotionAnimationMask.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..cef134e0c3a4e70637f28af27c9421fad2a26bc1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiMotionAnimationMaskTest/UiMotionAnimationMask.test.ets @@ -0,0 +1,892 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 } 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" + +/* + * UiMotionAnimationMaskTest + * + * 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 UiMotionAnimationMaskTest() { + + describe("UiMotionAnimationMaskTest", () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error("TEST", "Failed to destroy the window. Cause : ${JSON.stringify(err)}"); + return; + } + Logger.info("TEST", "Succeeded in destroy the window."); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK + * @tc.desc 验证4个边框的圆角弧度为0 + */ + it("MOTION_ANIMATION_MASK", 0, async (done: Function) => { + Logger.info("TEST", "MOTION_ANIMATION_MASK start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "MOTION_ANIMATION_MASK finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0010 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0010 + * @tc.desc 验证四个边框的宽度分别为8,16,24,32 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0010", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0010 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0010"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0010 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0020 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0020 + * @tc.desc 验证4个边框的宽度为8 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0020", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0020 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0020"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0020 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0030 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0030 + * @tc.desc 验证没有边框 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0030", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0030 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0030"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0030 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0040 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0040 + * @tc.desc 验证没有边框 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0040", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0040 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0040"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0040 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0050 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0050 + * @tc.desc 验证四个边框的颜色分别为红色、蓝色、黄色、黑色 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0050", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0050 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0050"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0050 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0060 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0060 + * @tc.desc 验证4个边框的颜色为红色 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0060", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0060 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0060"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0060 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0070 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0070 + * @tc.desc 验证4个边框的颜色为红色 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0070", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0070 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0070"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0070 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0080 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0080 + * @tc.desc 验证四个边框的圆角弧度分别为8,16,24,32 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0080", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0080 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0080"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0080 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0090 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0090 + * @tc.desc 验证4个边框的圆角弧度为16 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0090", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0090 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0090"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0090 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0110 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0110 + * @tc.desc 验证无圆角弧度 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0110", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0110 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0110"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0110 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0120 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0120 + * @tc.desc 验证边框样式显示为一系列圆点,圆点半径为borderWidth的一半 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0120", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0120 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0120"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0120 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0130 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0130 + * @tc.desc 验证边框样式显示为一系列短的方形虚线 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0130", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0130 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0130"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0130 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0140 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0140 + * @tc.desc 验证边框样式显示为一条实线 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0140", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0140 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0140"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0140 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0150 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0150 + * @tc.desc 验证边框样式显示为一条实线 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0150", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0150 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0150"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0150 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0170 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0170 + * @tc.desc 验证对长方形设置遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0170", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0170 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0170"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0170 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0180 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0180 + * @tc.desc 验证不设置遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0180", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0180 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0180"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0180 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0190 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0190 + * @tc.desc 验证设置矩形遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0190", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0190 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0190"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0190 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0200 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0200 + * @tc.desc 验证RenderNode被遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0200", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0200 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0200"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0200 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0210 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0210 + * @tc.desc 验证遮罩与RenderNode重合部分被遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0210", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0210 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0210"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0210 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0220 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0220 + * @tc.desc 验证长方形的遮罩为圆角矩形 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0220", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0220 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0220"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0220 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0230 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0230 + * @tc.desc 验证圆角矩形遮罩超出RenderNode的大小 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0230", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0230 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0230"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0230 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0240 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0240 + * @tc.desc 验证圆角矩形遮罩小于RenderNode的 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0240", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0240 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0240"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0240 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0250 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0250 + * @tc.desc 验证设置圆形遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0250", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0250 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0250"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0250 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0260 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0260 + * @tc.desc 验证圆形遮罩超出RenderNode的大小 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0260", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0260 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0260"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0260 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0270 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0270 + * @tc.desc 验证圆形遮罩小于RenderNode的大小 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0270", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0270 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0270"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0270 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0280 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0280 + * @tc.desc 验证左侧边为75vp,顶部为0,右侧为250vp,底部为100vp的椭回形遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0280", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0280 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0280"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0280 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0290 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0290 + * @tc.desc 验证椭圆形遮罩超RenderNode的大小 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0290", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0290 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0290"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0290 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0300 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0300 + * @tc.desc 验证椭圆形遮罩小于RenderNode的大 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0300", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0300 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0300"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0300 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0310 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0310 + * @tc.desc 验证设置自定义遮罩 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0310", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0310 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0310"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0310 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0320 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0320 + * @tc.desc 验证自定义遮罩超出RenderNode的大小 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0320", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0320 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0320"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0320 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0330 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0330 + * @tc.desc 验证自定义遮罩小于RenderNode的大小 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0330", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0330 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0330"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0330 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0340 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0340 + * @tc.desc 验证设置遮罩颜色(ARGB格式) + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0340", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0340 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0340"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0340 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0350 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0350 + * @tc.desc 验证RenderNode完全消失(red为异常值,相当于设置一个不显示颜色的遮罩) + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0350", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0350 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0350"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0350 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0360 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0360 + * @tc.desc 验证设置遮罩边框颜色(ARGB格式) + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0360", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0360 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0360"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0360 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0370 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0370 + * @tc.desc 验证遮罩边框下面的RenderNode完全消失()red为异常值,相当于设置一个不显示颜色的遮罩边框) + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0370", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0370 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0370"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0370 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0380 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0380 + * @tc.desc 验证遮罩边框宽度设为24 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0380", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0380 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0380"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0380 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0390 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0390 + * @tc.desc 验证遮罩的边框宽度为0,即无边框 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0390", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0390 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0390"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0390 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0400 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0400 + * @tc.desc 验证遮罩的边框宽度为-10,即无边框 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0400", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0400 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0400"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0400 finish."); + done(); + }); + + /* + * @tc.number SUB_ACE_UI_MOTION_ANIMATION_MASK_0410 + * @tc.name SUB_ACE_UI_MOTION_ANIMATION_MASK_0410 + * @tc.desc 验证生成一个矩形遮罩,中间为镂空 + */ + it("SUB_ACE_UI_MOTION_ANIMATION_MASK_0410", 0, async (done: Function) => { + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0410 start."); + Settings.createWindow("testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0410"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button001 = await driver.findComponent(ON.id("Button001")); + await button001.click(); + await Utils.sleep(2000) + let button003 = await driver.findComponent(ON.id("Button003")); + await button003.click(); + await Utils.sleep(2000) + let button002 = await driver.findComponent(ON.id("Button002")); + await button002.click(); + await Utils.sleep(2000) + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info("TEST", "SUB_ACE_UI_MOTION_ANIMATION_MASK_0410 finish."); + done(); + }); + }) +} 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..d50a34c0eacfbdafee0f89058c75a2e74023c75a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -13,9 +13,15 @@ * limitations under the License. */ -import {Driver , ON} from '@ohos.UiTest' +import { Driver, ON } from '@ohos.UiTest' +import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit'; +import { BusinessError, pasteboard } from '@kit.BasicServicesKit'; +import bundleManager from '@ohos.bundle.bundleManager'; +import Settings from './Settings'; +import { KeyCode } from '@kit.InputKit'; export default class Utils { + static permission_state: boolean = true; static async sleep(time : number) :Promise { const result:string = await new Promise((resolve:Function)=>{ @@ -39,7 +45,70 @@ export default class Utils { } + static async checkPermission(callback: (isGranted: boolean) => void) { + const permissions: Array = ['ohos.permission.READ_PASTEBOARD']; + let grantStatus: abilityAccessCtrl.GrantStatus = await Utils.checkAccessToken(permissions[0]); + if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { + callback(true) + } else { + callback(false) + } + } + + static async checkAccessToken(permission: Permissions): Promise { + let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); + let grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED; + // ȡӦó accessTokenID + let tokenId: number = 0; + try { + let bundleInfo: bundleManager.BundleInfo = + await bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); + let appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo; + tokenId = appInfo.accessTokenId; + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`Failed to get bundle info for self. Code is ${err.code}, message is ${err.message}`); + } + // УӦǷȨ + try { + grantStatus = await atManager.checkAccessToken(tokenId, permission); + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`Failed to check access token. Code is ${err.code}, message is ${err.message}`); + } + return grantStatus; + } + static async reqPermissionsFromUser(permissions: Array, context: common.UIAbilityContext, + callback: (isGrant: boolean) => void) { + let atManager = abilityAccessCtrl.createAtManager(); + // requestPermissionsFromUserжȨ޵Ȩ״̬Ƿ𵯴 + atManager.requestPermissionsFromUser(context, permissions).then((data) => { + let grantStatus: Array = data.authResults; + if (grantStatus[0] === 0) { + callback(true) + } else { + // ûܾȨʾûȨܷʵǰҳĹܣûϵͳдӦȨ + callback(false) + } + }).catch((err: String) => { + }) + } + + /** + * 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/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed302166979e8e9932a1b10d5cdc1f914502bc82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0010.ets @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + public childList: Array = new Array(); + private childrenCount: number = 0; + public text1: string = ''; + public text2: string = ''; + public text3: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.uiContext = uiContext; + this.rootNode = new FrameNode(uiContext); + + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize() + .margin(10); + this.rootNode.appendChild(col); + + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize('FrameNode的第二个子节点') + .margin(10) + .fontColor(Color.Pink); + this.rootNode.appendChild(text); + + for (let i = 0; i < 10; i++) { + let t = typeNode.createNode(uiContext, 'Text'); + t.initialize('1') + .margin(5) + .fontColor(Color.Orange) + col.appendChild(t); + } + + return this.rootNode; + } + + searchFrameNode() { + this.text1 = `FrameNode 子节点数量: ${this.rootNode!.getChildrenCount()}`; + } + + searchFrameNodeFirstChild() { + this.text2 = `FrameNode 第一个子节点的子节点数量: ${this.rootNode!.getFirstChild()?.getChildrenCount()}`; + } + + searchFrameNodeLastChild() { + this.text3 = `FrameNode 第二个子节点是: ${this.rootNode!.getChild(1)}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0010 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text1: string = ''; + @State text2: string = ''; + @State text3: string = ''; + + onTextChange() { + this.text1 = this.myNodeController.text1; + this.text2 = this.myNodeController.text2; + this.text3 = this.myNodeController.text3; + } + + build() { + Column() { + Button("getChild") + .id('ActionEventCommonEventFrameNode0010') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.myNodeController.searchFrameNodeFirstChild(); + this.myNodeController.searchFrameNodeLastChild(); + this.onTextChange(); + }) + Text(`${this.text1}`).margin(20).fontSize(30) + Text(`${this.text2}`).margin(20).fontSize(30) + Text(`${this.text3}`).margin(20).fontSize(30) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(500) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bc5ab0c0f505a099ce2a3152924c159d3cc2aa2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0020.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.uiContext = uiContext; + this.rootNode = new FrameNode(uiContext); + return this.rootNode; + } + + appendChildDump(): string { + let childNode = new FrameNode(this.uiContext!); + this.rootNode!.appendChild(childNode); + let inspectorInfo = this.rootNode?.getInspectorInfo(); + return JSON.stringify(inspectorInfo); + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0020 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + build() { + Column() { + Button("appendChild") + .id('ActionEventCommonEventFrameNode0020') + .width(300) + .onClick(() => { + this.text = this.myNodeController.appendChildDump(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..527210767bc7aeea1044b9716137ab338be06933 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0030.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 { NodeController, typeNode, FrameNode, UIContext } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +class MyNodeController extends NodeController { + public rootNode: FrameNode | null = null; + public frameNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.uiContext = uiContext; + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.width("50%").height(600).backgroundColor(Color.Blue) + this.frameNode = new FrameNode(uiContext); + this.frameNode.commonAttribute.width("100%").height(600).backgroundColor(Color.Green) + this.rootNode.appendChild(this.frameNode); + return this.rootNode; + } + + insertChildAfter(): string { + let errorStr: string = ''; + try { + let textNode = typeNode.createNode(this.uiContext, "Text") + textNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.frameNode?.insertChildAfter(textNode, this.frameNode); + } catch (e) { + errorStr = "异常信息: " + (e as BusinessError).code + " : " + (e as BusinessError).message; + } + return errorStr + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0030 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + build() { + Column() { + Button("insertChildAfter") + .id('ActionEventCommonEventFrameNode0030') + .width(300) + .onClick(() => { + this.text = this.myNodeController.insertChildAfter(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..57d713b4b9be8117dd0fa05b43dda07dc380091d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0050.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 2; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.rootNode.insertChildAfter(childNode,this.frameNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.rootNode!.getRenderNode()) { + console.log(`getChildNumber: ${this.rootNode!.getChildrenCount()}`); + this.text = `getChildNumber: ${this.rootNode!.getChildrenCount()}`; + } else { + console.log("can not getChildNumber"); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0050 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0050') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..96de51a1c528050a2925f8e9272661078c443bc9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0060.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.rootNode!.getFirstChild() !== null && this.rootNode!.getFirstChild()!.getParent() === this.rootNode) { + console.log("getFirstChild result:success."); + this.text = "getFirstChild result:success."; + } else { + console.log("getFirstChild result: fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0060 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0060') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd1d10eed6c4aedd4177263b230e2e21fe29d624 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0070.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, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.frameNode?.getChild(5)?.getNextSibling()?.appendChild(childNode); + } + return this.rootNode; + } + + async searchFrameNode() { + if (this.frameNode!.getChild(5)!.getNextSibling()?.getChild(5)) { + console.log(" getChild result: success."); + this.text = " getChild result: success." + } else { + console.log(" getChild result: fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0070 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0070') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..a1dd2acf0d9824fe9e196e50c95e7f6261e370af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0080.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.frameNode!.getChild(5) === this.frameNode!.getChild(4)!.getNextSibling()) { + console.log("getNextSibling result:success."); + this.text = "getNextSibling result:success."; + } else { + console.log("getNextSibling result:fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0080 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0080') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3da8251dcb3c1a681035f780cc521085939afee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0090.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.frameNode!.getChild(3) === this.frameNode!.getChild(4)!.getPreviousSibling()) { + console.log("getPreviousSibling result:success."); + this.text = "getPreviousSibling result:success."; + } else { + console.log("getPreviousSibling result:fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0090 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0090') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0d2e3365abe924885e5e475ad94a0c2d8dbfd49 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0100.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.frameNode!.getFirstChild()!.getParent() === this.frameNode) { + console.log(" getParent result : success ") + this.text = " getParent result : success " + } else { + console.log(" getParent result : fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0100 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0100') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..1808962d1d4e1702532fd1111ac1b04310a480f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0110.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = 'arrive the true rootNode: '+this.rootNode!.getParent()?.getParent()?.getParent()?.getParent(); + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0110 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0110') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..d09f76cd2ee7d61363a1a9652c59c674d8e0fb8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0120.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode, RenderNode, typeNode } from '@kit.ArkUI'; + +class NodeController0120 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + private isModifiable: boolean | undefined = false; + private modifiableString: string ="check getParentwhether is modifiable : "; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let searchedNode = typeNode.createNode(uiContext, "Search"); + this.rootNode.appendChild(searchedNode); + let node = typeNode.createNode(uiContext, "Button"); + node.initialize('getChildNumber') + .fontSize(10) + .margin(30) + .width(200) + .height(50) + .id('ButtonTest1') + .onClick(() => { + this.isModifiable = searchedNode.isModifiable() + let node2 = typeNode.createNode(uiContext, "Text"); + node2.initialize(this.modifiableString + this.isModifiable) + .fontSize(20) + .margin(30) + .id('ButtonTest2') + .position({ x: -10, y: -100 }) + .width(600); + this.rootNode?.appendChild(node2); + }); + this.rootNode.appendChild(node); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommoneventFrameNode0120 { + private mNodeController135: NodeController0120 = new NodeController0120(); + + build() { + Column() { + NodeContainer(this.mNodeController135) + }.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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..602295a42e663a9922a32093fe8c0a810f1da06b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0130.ets @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, FrameNode, UIContext } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.log('aboutToAppear'); + } + + aboutToDisappear() { + console.log('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + getRenderNode(): string { + let resultStr: string = ''; + if (this.rootNode!.getParent()!.getRenderNode() === null) { + resultStr += "cant not get renderNode from ArkTs Node"; + } + if (this.rootNode?.getRenderNode()) { + resultStr += ' can get renderNode from FrameNode'; + } + if (this.builderNode?.getFrameNode()?.getRenderNode()) { + resultStr += ' can get renderNode from BuilderNode'; + } + return resultStr; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0130 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + build() { + Column() { + Button("GetRenderNode") + .id('ActionEventCommonEventFrameNode0130') + .width(300) + .onClick(() => { + this.text = this.myNodeController.getRenderNode(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f3b8a0a4517c044c4af47a531e3c0817916380c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0140.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 { NodeController, FrameNode, BuilderNode, RenderNode, typeNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Search() + .backgroundColor(Color.Pink) + .width(150).height(150) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController0140 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + private isModifiable: boolean | undefined = true; + private modifiableString: string = "check getParentwhether is modifiable : "; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + let node = typeNode.createNode(uiContext, "Button"); + node.initialize('点击') + .fontSize(20) + .margin(30) + .width(200) + .height(100) + .id('ButtonTest1') + .onClick(() => { + this.isModifiable = this.builderNode?.getFrameNode()?.isModifiable() + console.log(this.modifiableString + this.isModifiable); + let node2 = typeNode.createNode(uiContext, "Text"); + node2.initialize(this.modifiableString + this.isModifiable) + .fontSize(20) + .margin(30) + .id('ButtonTest2') + .position({ x: -150, y: -100 }) + .width(600); + this.rootNode?.appendChild(node2); + }); + this.rootNode.appendChild(node); + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommoneventFrameNode0140 { + private mNodeController135: NodeController0140 = new NodeController0140(); + + build() { + Column() { + NodeContainer(this.mNodeController135) + }.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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..4bc4e40013700d2c5738c17ab006ff3331eebbb2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0150.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode, RenderNode, typeNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Search() + .backgroundColor(Color.Pink) + .width(150).height(150) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController0150 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + private isModifiable: boolean | undefined = true; + private modifiableString: string = "check getParentwhether is modifiable : "; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + let node = typeNode.createNode(uiContext, "Button"); + node.initialize('点击') + .fontSize(20) + .margin(30) + .width(200) + .height(100) + .id('ButtonTest1') + .onClick(() => { + try { + let node3 = typeNode.createNode(uiContext, "Button"); + node3.initialize('点击') + this.builderNode?.getFrameNode()?.appendChild(node3); + } catch (e) { + let node2 = typeNode.createNode(uiContext, "Text"); + node2.initialize(e.code+":"+e.message) + .fontSize(20) + .margin(30) + .id('ButtonTest2') + .position({ x: -150, y: -100 }) + .width(600); + this.rootNode?.appendChild(node2); + } + + }); + this.rootNode.appendChild(node); + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommoneventFrameNode0150 { + private mNodeController135: NodeController0150 = new NodeController0150(); + + build() { + Column() { + NodeContainer(this.mNodeController135) + }.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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e2ca8be8e1eb293e54dda55cdba3dfe12043a30 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0160.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode, RenderNode, typeNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Search() + .backgroundColor(Color.Pink) + .width(150).height(150) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController0160 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + private isModifiable: boolean | undefined = true; + private modifiableString: string = "check getParentwhether is modifiable : "; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + let node = typeNode.createNode(uiContext, "Button"); + node.initialize('点击') + .fontSize(20) + .margin(30) + .width(200) + .height(100) + .id('ButtonTest1') + .onClick(() => { + try { + let node3 = typeNode.createNode(uiContext, "Button"); + node3.initialize('点击') + this.builderNode?.getFrameNode()?.insertChildAfter(node3,null); + } catch (e) { + let node2 = typeNode.createNode(uiContext, "Text"); + node2.initialize(e.code+":"+e.message) + .fontSize(20) + .margin(30) + .id('ButtonTest2') + .position({ x: -150, y: -100 }) + .width(600); + this.rootNode?.appendChild(node2); + } + + }); + this.rootNode.appendChild(node); + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommoneventFrameNode0160 { + private mNodeController135: NodeController0160 = new NodeController0160(); + + build() { + Column() { + NodeContainer(this.mNodeController135) + }.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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..35bab11636895986ba18af58a02c734b5e6f9ad8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0170.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode, RenderNode, typeNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Search() + .backgroundColor(Color.Pink) + .width(150).height(150) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController0170 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + private isModifiable: boolean | undefined = true; + private modifiableString: string = "check getParentwhether is modifiable : "; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + let node = typeNode.createNode(uiContext, "Button"); + node.initialize('点击') + .fontSize(20) + .margin(30) + .width(200) + .height(100) + .id('ButtonTest1') + .onClick(() => { + try { + let node3 = typeNode.createNode(uiContext, "Button"); + node3.initialize('点击') + this.builderNode?.getFrameNode()?.removeChild(node3); + } catch (e) { + let node2 = typeNode.createNode(uiContext, "Text"); + node2.initialize(e.code+":"+e.message) + .fontSize(20) + .margin(30) + .id('ButtonTest2') + .position({ x: -150, y: -100 }) + .width(600); + this.rootNode?.appendChild(node2); + } + + }); + this.rootNode.appendChild(node); + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommoneventFrameNode0170 { + private mNodeController135: NodeController0170 = new NodeController0170(); + + build() { + Column() { + NodeContainer(this.mNodeController135) + }.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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ce27a3a71eb184df493be7ecc11ad6320c2c24c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0180.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 400, height: 400 }; + } + return this.rootNode; + } + + throwError() { + try { + this.rootNode!.getParent()!.clearChildren(); + } catch (err) { + console.log("异常信息: "+(err as BusinessError).code + " : " + (err as BusinessError).message); + this.text = "异常信息: "+(err as BusinessError).code + " : " + (err as BusinessError).message; + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0180 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + + Column() { + NodeContainer(this.myNodeController) + Text(`${this.text}`).margin(20) + Button("getChildNumber &&operation about search") + .id('ActionEventCommonEventFrameNode0180') + .width(300) + .onClick(() => { + this.myNodeController.throwError(); + this.onTextChange(); + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..6e6482df86eb5176925846842661f0db036e81dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0190.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.rootNode!.getChildrenCount()) { + console.log(`getChildNumber:${this.rootNode!.getChildrenCount()}`); + this.text = `getChildNumber:${this.rootNode!.getChildrenCount()}`; + } else { + console.log("can not getChildNumber"); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0190 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0190') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ff4c5a1bfda068baff3b7ca336eaf13f6a80282 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0200.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.frameNode!.getFirstChild() !== null) { + console.log("nodeContainerNode getFirstChild result: Success."); + this.text = "nodeContainerNode getFirstChild result: success."; + } else { + console.log("nodeContainerNode getFirstChild result: fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0210 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0200') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..32cccc32d8930052a6b20eb8610e6f9147859a0c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0210.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.frameNode!.getChild(0)) { + console.log("nodeContainerNode getChild result: success."); + this.text = "nodeContainerNode getChild result: success."; + } else { + console.log("nodeContainerNode getChild result: fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0210 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0210') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..944d1cb9646f0373b451d69444e8fd4b80d47208 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0220.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.frameNode!.getChild(0)!.getNextSibling()) { + console.log("nodeContainerNode getNextSibling result:success."); + this.text = "nodeContainerNode getNextSibling result:success."; + } else { + console.log("nodeContainerNode getNextSibling result:fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0220 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0220') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..7fe7fc990e5110232ff7a1a1a62948155659ce4b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0230.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + if (this.frameNode!.getChild(1)!.getPreviousSibling()) { + console.log("nodeContainerNode getPreviousSibling result:success."); + this.text = "nodeContainerNode getPreviousSibling result:success."; + } else { + console.log("nodeContainerNode getPreviousSibling result:fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0230 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0230') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..d99350f91f0e7bacafc5bae904909d5ac0ff2d31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0240.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + async searchFrameNode() { + if (this.rootNode!.getParent()) { + console.log(" nodeContainerNode getParent result: success."); + this.text = " nodeContainerNode getParent result: success." + } else { + console.log(" nodeContainerNode getParent result: fail."); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0240 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0240') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..30095d390b8f124c9e0ef69a4a1335209e7fecec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0250.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = 'arrive the true rootNode: '+this.rootNode!.getParent()?.getParent()?.getParent()?.getParent(); + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0250 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getChildNumber && operation about search") + .id('ActionEventCommonEventFrameNode0250') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..b60270ac5fdf61a3e2693553f3a5724fee89fe35 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0260.ets @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, FrameNode, UIContext } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.log('aboutToAppear'); + } + + aboutToDisappear() { + console.log('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + public rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + searchFrameNode():string { + let resultStr: string = ''; + if (this.rootNode!.getParent()!.getRenderNode() === null) { + resultStr += "cant not get renderNode from ArkTs Node"; + } + if (this.rootNode?.getParent()?.getFirstChild()?.getRenderNode()) { + resultStr += ' can get renderNode from FrameNode'; + } + if (this.rootNode?.getParent()?.getFirstChild()?.getFirstChild()?.getRenderNode()) { + resultStr += ' can get renderNode from BuilderNode'; + } + return resultStr; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0260 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + build() { + Column() { + Button("RenderNode") + .id('ActionEventCommonEventFrameNode0260') + .width(300) + .onClick(() => { + this.text = this.myNodeController.searchFrameNode(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..767fbfae053e26ff6ddc15b8f79452db83ab04dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0270.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 { FrameNode, NodeController, BuilderNode } from "@kit.ArkUI"; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.log('aboutToAppear'); + } + + aboutToDisappear() { + console.log('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + public ChildrenCount: number = 0; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + isRootNodeChildEqualsBuilderNodeFrameNode(): boolean { + let equals: boolean = this.rootNode?.getChild(1) == this.builderNode?.getFrameNode(); + console.log("this rootNode getChild(1)==this.builderNode getFrameNode()" + equals); + return equals + } + + isBuilderNodeFrameNodeModifiable(): boolean | undefined { + let modifiable: boolean | undefined = this.builderNode?.getFrameNode()?.isModifiable(); + console.log("this.builderNode?.getFrameNode()?.isModifiable()" + modifiable); + return modifiable; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0270 { + private myNodeController: MyNodeController = new MyNodeController(); + @State equals: boolean = false; + @State modifiable: boolean|undefined =false; + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Text(`this rootNode getChild(1)==this.builderNode getFrameNode():${this.equals}`) + Text(`this.builderNode?.getFrameNode()?.isModifiable():${this.modifiable}`) + Button('getBuilderNode') + .id('ActionEventCommonEventFrameNode0270') + .onClick(() => { + this.equals = this.myNodeController.isRootNodeChildEqualsBuilderNodeFrameNode(); + this.modifiable = this.myNodeController.isBuilderNodeFrameNodeModifiable(); + }) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..03c2756316d0f749d460ef8874f8e91194389284 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0280.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 { FrameNode, NodeController, BuilderNode } from "@kit.ArkUI"; +import { NodeContent, typeNode } from '@ohos.arkui.node'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.log('aboutToAppear'); + } + + aboutToDisappear() { + console.log('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + public ChildrenCount: number = 0; + private uiContext: UIContext | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.uiContext = uiContext; + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + builderNodeAppendChild(): string { + let errorStr: string = ''; + try { + let textNode = typeNode.createNode(this.uiContext, "Text") + this.builderNode?.getFrameNode()?.appendChild(textNode); + } catch (e) { + errorStr = "异常信息: "+(e as BusinessError).code + " : " + (e as BusinessError).message; + } + return errorStr + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0280 { + private myNodeController: MyNodeController = new MyNodeController(); + @State errorStr: string = ''; + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Text(`${this.errorStr}`) + Button('checkError in BuilderNode') + .id('ActionEventCommonEventFrameNode0280') + .onClick(() => { + this.errorStr = this.myNodeController.builderNodeAppendChild(); + }) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..0835bfbf81b36a5e80aa9bca8d7dbd78f65b2b42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0290.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, NodeController, typeNode, FrameNode, UIContext } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.log('aboutToAppear'); + } + + aboutToDisappear() { + console.log('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + public rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + private uiContext: UIContext | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.uiContext = uiContext; + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + insertChildAfter(): string { + let errorStr: string = ''; + try { + let textInputNode = typeNode.createNode(this.uiContext, "TextInput") + textInputNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.builderNode?.getFrameNode()?.insertChildAfter(textInputNode, this.builderNode.getFrameNode()); + } catch (e) { + errorStr = "异常信息: " + (e as BusinessError).code + " : " + (e as BusinessError).message; + } + return errorStr + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0290 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + build() { + Column() { + Button("checkError in BuilderNode") + .id('ActionEventCommonEventFrameNode0290') + .width(300) + .onClick(() => { + this.text = this.myNodeController.insertChildAfter(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b0c46b0fc9d903b457453301ebab3e031607bc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0300.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from "@kit.ArkUI"; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } + + throwError() { + try { + this.rootNode!.getParent()!.removeChild(this.builderNode!.getFrameNode()); + } catch (err) { + console.log("异常信息: "+(err as BusinessError).code + " : " + (err as BusinessError).message); + this.text = "异常信息: "+(err as BusinessError).code + " : " + (err as BusinessError).message; + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0300 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Text(`${this.text}`).margin(20) + Button('checkError in BuilderNode') + .id('ActionEventCommonEventFrameNode0300') + .onClick(() => { + this.myNodeController.throwError(); + this.onTextChange(); + }) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..148477cf0fa0e1628df97bf0aa2b42fd5d484ece --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0310.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from "@kit.ArkUI"; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } + + throwError() { + try { + this.rootNode!.getParent()!.clearChildren(); + } catch (err) { + console.log("异常信息: "+(err as BusinessError).code + " : " + (err as BusinessError).message); + this.text = "异常信息: "+(err as BusinessError).code + " : " + (err as BusinessError).message; + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0310 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Text(`${this.text}`).margin(20) + Button('checkError in BuilderNode') + .id('ActionEventCommonEventFrameNode0310') + .onClick(() => { + this.myNodeController.throwError(); + this.onTextChange(); + }) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..8ee1b168a658da7f69efee2c5ff1125e0a357b97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0320.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 { FrameNode, NodeController, BuilderNode } from "@kit.ArkUI"; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + public ChildrenCount:number = 0; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } + + getChildNumber() { + this.ChildrenCount = this.rootNode!.getChildrenCount(); + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0320 { + private myNodeController: MyNodeController = new MyNodeController(); + @State count:number = 0; + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Text(`getChildNumber:${this.count}`) + Button('getChildNumber') + .id('ActionEventCommonEventFrameNode0320') + .onClick(() => { + this.myNodeController.getChildNumber(); + this.count = this.myNodeController.ChildrenCount; + }) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..75de5ebdff4a297cb5e166fd37574deae91e0314 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0360.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, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } + + disposeFrameNode() { + if (this.rootNode !== null && this.builderNode !== null) { + this.rootNode.removeChild(this.builderNode.getFrameNode()); + this.builderNode.dispose(); + + this.rootNode.dispose(); + } + } + + removeBuilderNode() { + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null && this.builderNode !== null && this.builderNode.getFrameNode() !== null) { + rootRenderNode.removeChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0360 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Button('FrameNode dispose') + .id('ActionEventCommonEventFrameNode0360') + .onClick(() => { + this.myNodeController.disposeFrameNode(); + }) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..e7cf6a8ce6712c9f381f65fdad631db7646d8e43 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0370.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController , FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + return this.rootNode; + } + + getRenderNode():string { + if (this.rootNode?.getParent()!.getRenderNode()) { + return ''; + } else { + console.log("can not get renderNode from ArkTs Node"); + return "can not get renderNode from ArkTs Node"; + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0370 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("GetRenderNode") + .id('ActionEventCommonEventFrameNode0370') + .width(300) + .onClick(() => { + this.text = this.myNodeController.getRenderNode(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..1238243c233bf828b8a594f3b142c8be310a16ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0380.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + return this.rootNode; + } + + getRenderNode():string { + if (this.rootNode!.getRenderNode()) { + return"can get renderNode from FrameNode"; + } else { + return ""; + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0380 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getRenderNode") + .id('ActionEventCommonEventFrameNode0380') + .width(300) + .onClick(() => { + this.text = this.myNodeController.getRenderNode(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..d71ee50ec88ba88dd15ace7463e32f4d37c7e318 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0390.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 { NodeController, BuilderNode, FrameNode, UIContext } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private builderNode: BuilderNode<[]> | null = null; + private rootNode: FrameNode | null = null; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + return this.rootNode; + } + + getRenderNode(): string { + if (this.builderNode?.getFrameNode()?.getRenderNode()) { + return "can get renderNode from BuilderNode"; + } else { + return ""; + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0390 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("获取RenderNode") + .id('ActionEventCommonEventFrameNode0390') + .width(300) + .onClick(() => { + this.text = this.myNodeController.getRenderNode(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..552b624eb475f0e26074592ef6fbb46c47d6886e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0400.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 { FrameNode, NodeController, BuilderNode } from "@kit.ArkUI"; +import { NodeContent, typeNode } from '@ohos.arkui.node'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.log('aboutToAppear'); + } + + aboutToDisappear() { + console.log('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + public ChildrenCount: number = 0; + private uiContext: UIContext | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.uiContext = uiContext; + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + builderNodeAppendChild(): string { + let errorStr: string = ''; + try { + let textNode = typeNode.createNode(this.uiContext, "Text"); + this.builderNode?.getFrameNode()?.appendChild(textNode); + } catch (e) { + errorStr = "异常信息: "+(e as BusinessError).code + " : " + (e as BusinessError).message; + } + return errorStr + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode0400 { + private myNodeController: MyNodeController = new MyNodeController(); + @State errorStr: string = ''; + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Text(`${this.errorStr}`) + Button('checkError in ArkTsNode') + .id('ActionEventCommonEventFrameNode0400') + .onClick(() => { + this.errorStr = this.myNodeController.builderNodeAppendChild(); + }) + .width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4000.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4000.ets new file mode 100644 index 0000000000000000000000000000000000000000..5934402e409bd7abe4955584b7aab21f7bdb682c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4000.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getPositionToWindow result:${JSON.stringify(this.rootNode!.getPositionToWindow())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4000 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToWindow") + .id('ActionEventCommonEventFrameNode4000') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4010.ets new file mode 100644 index 0000000000000000000000000000000000000000..43a5af57828dd0e738985f1e346499ac3d0215d1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4010.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getPositionToParent result:${JSON.stringify(this.rootNode!.getPositionToParent())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4010 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToParent") + .id('ActionEventCommonEventFrameNode4010') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4020.ets new file mode 100644 index 0000000000000000000000000000000000000000..03281f111c76d44f3d4de8cfc60ff51ce7c3160f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4020.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getPositionToScreen result:${JSON.stringify(this.rootNode!.getPositionToScreen())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4020 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToParent") + .id('ActionEventCommonEventFrameNode4020') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4030.ets new file mode 100644 index 0000000000000000000000000000000000000000..c054b7159001ae77cf91112062203db274cd029b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4030.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getPositionToParentWithTransform result:${JSON.stringify(this.rootNode!.getPositionToParentWithTransform())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4030 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToParentWithTransform") + .id('ActionEventCommonEventFrameNode4030') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4040.ets new file mode 100644 index 0000000000000000000000000000000000000000..81a69f393d62f5040f1c9296e3a0247c9e22a93f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4040.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getPositionToWindowWithTransformresult:${JSON.stringify(this.rootNode!.getPositionToWindowWithTransform())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4040 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToWindowWithTransform") + .id('ActionEventCommonEventFrameNode4040') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4050.ets new file mode 100644 index 0000000000000000000000000000000000000000..7c849a0d079c0d76e993377979f07ab7c9f10167 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4050.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getPositionToScreenWithTransform:${JSON.stringify(this.rootNode!.getPositionToScreenWithTransform())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4050 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToScreenWithTransform") + .id('ActionEventCommonEventFrameNode4050') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4060.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba8b39832ddd6fba3d03a6f9e106d0503a0762c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4060.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getMeasuredSize result:${JSON.stringify(this.rootNode!.getMeasuredSize())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4060 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getMeasuredSize") + .id('ActionEventCommonEventFrameNode4060') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4070.ets new file mode 100644 index 0000000000000000000000000000000000000000..54e17768e3ccf0fb86bca699cb2b4a1c4e9fb75e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4070.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getLayoutPosition result:${JSON.stringify(this.rootNode!.getLayoutPosition())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4070 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToScreenWithTransform") + .id('ActionEventCommonEventFrameNode4070') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4080.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3b18993aeba6b125b094252c2cd8fbf511f56dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4080.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getUserConfigBorderWidth result:${JSON.stringify(this.rootNode!.getUserConfigBorderWidth())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4080 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getUserConfigPadding") + .id('ActionEventCommonEventFrameNode4080') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4090.ets new file mode 100644 index 0000000000000000000000000000000000000000..3cc04642284169a8a910179151e6eeaf698fd3c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4090.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getUserConfigPadding result:${JSON.stringify(this.rootNode!.getUserConfigPadding())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4090 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getUserConfigPadding") + .id('ActionEventCommonEventFrameNode4090') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4100.ets new file mode 100644 index 0000000000000000000000000000000000000000..89d282dca0459283184f9c054482de35dc9ba347 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4100.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getUserConfigMargin result:${JSON.stringify(this.rootNode!.getUserConfigMargin())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4100 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getPositionToScreenWithTransform") + .id('ActionEventCommonEventFrameNode4100') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4110.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d01b266d5a9abe9f0cead3ca8274003d7faaaf4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4110.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getUserConfigSize result:${JSON.stringify(this.rootNode!.getUserConfigSize())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4110 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getUserConfigSize") + .id('ActionEventCommonEventFrameNode4110') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4120.ets new file mode 100644 index 0000000000000000000000000000000000000000..df7049c0e35f403126be069cdd0677febb315ac3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4120.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + this.rootNode.commonAttribute.id('ActionEventCommonEventFrameNode4120') + return this.rootNode; + } + + searchFrameNode() { + this.text = `getId result: ${this.rootNode!.getId()}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4120 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getUserConfigSize") + .id('ActionEventCommonEventFrameNode4120') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4130.ets new file mode 100644 index 0000000000000000000000000000000000000000..175be2f7f89c89168a9caa3966852e3afbf99f97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4130.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getUniqueID result:${JSON.stringify(this.rootNode!.getUniqueId())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4130 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getUserConfigSize") + .id('ActionEventCommonEventFrameNode4130') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4140.ets new file mode 100644 index 0000000000000000000000000000000000000000..2fe0e5fe56b6cba6b7cc511814d920bfc70e42dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4140.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getNodeType result:${JSON.stringify(this.rootNode!.getNodeType())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4140 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getUserConfigSize") + .id('ActionEventCommonEventFrameNode4140') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4150.ets new file mode 100644 index 0000000000000000000000000000000000000000..74edd3e8b93fcf148633179b0b12c1a1d2eab65f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4150.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getOpacity result:${JSON.stringify(this.rootNode!.getOpacity())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4150 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getOpacity") + .id('ActionEventCommonEventFrameNode4150') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4170.ets new file mode 100644 index 0000000000000000000000000000000000000000..6dfb69e62e31bc2a34bbb193281e75f1aa04084f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4170.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `isClipToFrame result:${JSON.stringify(this.rootNode!.isClipToFrame())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4170 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("isClipToFrame") + .id('ActionEventCommonEventFrameNode4170') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4180.ets new file mode 100644 index 0000000000000000000000000000000000000000..7818c46ba61ebd3436e716f170aee66946b17cb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4180.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `isAttached result:${JSON.stringify(this.rootNode!.isAttached())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4180 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("isAttached") + .id('ActionEventCommonEventFrameNode4180') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4190.ets new file mode 100644 index 0000000000000000000000000000000000000000..7503e8eca9886898cafafc1f140ad5b236e8b708 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4190.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + public text: string = ''; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + searchFrameNode() { + this.text = `getInspectorlnfo result:${JSON.stringify(this.rootNode!.getInspectorInfo())}`; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4190 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index: number = 0; + @State text: string = ''; + + onTextChange() { + this.text = this.myNodeController.text; + } + + build() { + Column() { + Button("getInspectorInfo") + .id('ActionEventCommonEventFrameNode4190') + .width(300) + .onClick(() => { + this.myNodeController.searchFrameNode(); + this.onTextChange(); + }) + Text(`${this.text}`).margin(20) + Column() { + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .width('100%') + .fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ + left: 35, + right: 35, + top: 35, + bottom: 35 + }) + .width("100%") + .height("100%") + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4200.ets new file mode 100644 index 0000000000000000000000000000000000000000..79c473c3b2ec2fedbfbc93259d5ee259c4bffb1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4200.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +const TEST_TAG : string = "FrameNode" +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList:Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4200 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text : string = ''; + @State index : number = 0; + + onTextChange(text:string) { + this.text = text + } + build() { + Column() { + Text(this.text).margin(20) + Button("getCustomProperty") + .margin(20) + .width(300) + .onClick(()=>{ + const uiContext: UIContext = this.getUIContext(); + if (uiContext) { + const node: FrameNode | null = uiContext.getFrameNodeById("Test_Button") || null; + if (node) { + const key = 'customProperty' + 1; + const property = node.getCustomProperty(key); + console.log(TEST_TAG + key, JSON.stringify(property)); + this.onTextChange(`${JSON.stringify(property)}`) + } + } + }) + .id('Test_Button') + .customProperty('customProperty1', { + 'number': 10, + 'string': 'this is a string', + 'bool': true, + 'object': { + 'name': 'name', + 'value': 100 + } + }) + .customProperty('customProperty2', {}) + .customProperty('customProperty2', undefined) + Column(){ + Text("This is a NodeContainer.") + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + .width('100%').fontSize(16) + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + } + } + .padding({ left: 35, right: 35, top: 35, bottom: 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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4210.ets new file mode 100644 index 0000000000000000000000000000000000000000..e517ac633f831db72ce77dd9c5166c8f584f34ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4210.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 { NodeController, FrameNode, LayoutConstraint } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + console.info('sally onMeasure result') + AppStorage.setOrCreate('onMeasureLog', 'onMeasure result'); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4210 { + private myNodeController: MyNodeController = new MyNodeController(); + @State log: string = '' + @StorageProp('onMeasureLog') onMeasureLog: string = '' + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + + Text(this.onMeasureLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4220.ets new file mode 100644 index 0000000000000000000000000000000000000000..e600f3ca8dfcb54d1476d7b556f3231359571a8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4220.ets @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + console.info('sally onLayout success') + AppStorage.setOrCreate('onLayoutLog', 'onLayout success'); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachPen(pen); + canvas.drawRect({ left: 0, right: this.width, top: 0, bottom: this.width }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4220 { + private myNodeController: MyNodeController = new MyNodeController(); + @StorageProp('onLayoutLog') onLayoutLog: string = '' + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + + Text(this.onLayoutLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4230.ets new file mode 100644 index 0000000000000000000000000000000000000000..b09a01b46271b168ae09ace57cdd62145dc28b5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4230.ets @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + console.info('sally setMeasuredSize success') + AppStorage.setOrCreate('setMeasuredSizeLog', 'setMeasuredSize success'); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4230 { + private myNodeController: MyNodeController = new MyNodeController(); + @StorageProp('setMeasuredSizeLog') setMeasuredSizeLog: string = '' + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('setMeasuredSize1') + .id('setMeasuredSize1') + .onClick(() => { + const finalSize: Size = { width: 200, height: 300 }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + this.myNodeController?.rootNode?.onMeasure(res); + }) + Button('setMeasuredSize2') + .id('setMeasuredSize2') + .onClick(() => { + const finalSize: Size = { width: 100, height: 200 }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + this.myNodeController?.rootNode?.onMeasure(res); + }) + + Text(this.setMeasuredSizeLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4240.ets new file mode 100644 index 0000000000000000000000000000000000000000..1202c0ab935e9c2e30dc4ec1042357df96906c9e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4240.ets @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, Position, RenderNode } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello RenderNode', + font, + drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 20, + right: 260, + top: 0, + bottom: 60 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, 20, 20); + canvas.detachBrush(); + } +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + console.info('sally setLayoutPosition success') + AppStorage.setOrCreate('setLayoutPositionLog', 'setLayoutPosition success'); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 20, + right: 500, + top: 0, + bottom: 100 + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + const renderNode = new MyRenderNode(); + renderNode.size = { width: 500, height: 500 } + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4240 { + private myNodeController: MyNodeController = new MyNodeController(); + @StorageProp('setLayoutPositionLog') setLayoutPositionLog: string = '' + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + + Button('setLayoutPosition1') + .id('setLayoutPosition1') + .onClick(() => { + this.myNodeController?.rootNode?.onLayout({x:100,y:200}) + }) + Button('setLayoutPosition2') + .id('setLayoutPosition2') + .onClick(() => { + this.myNodeController?.rootNode?.onLayout({x:300,y:100}) + }) + + Text(this.setLayoutPositionLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4250.ets new file mode 100644 index 0000000000000000000000000000000000000000..dee48acbc393c1714d2238438ef9fc7037e95504 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4250.ets @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + console.info('sally measure success') + AppStorage.setOrCreate('measureLog', 'measure result '+JSON.stringify(sizeRes)); + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4250 { + private myNodeController: MyNodeController = new MyNodeController(); + @StorageProp('measureLog') measureLog: string = '' + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('measure') + .id('measure') + .onClick(() => { + const finalSize: Size = { width:200, height:300 }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + this.myNodeController?.rootNode?.measure(res) + }) + + Text(this.measureLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4260.ets new file mode 100644 index 0000000000000000000000000000000000000000..e26ca3776b80735b5370d18bef5b90529002712e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4260.ets @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position, + ComponentContent } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + console.info('sally measure success') + AppStorage.setOrCreate('measureLog', 'measure result ' + JSON.stringify(sizeRes)); + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + console.info('sally layout result ') + AppStorage.setOrCreate('layoutLog', 'layout result '); + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +@Builder +function buildText() { + Column() { + Text('hello word') + .width(50) + .height(50) + .backgroundColor(Color.Yellow) + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + let component = new ComponentContent(context, wrapBuilder(buildText)) + this.rootNode?.addComponentContent(component) + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4260 { + private myNodeController: MyNodeController = new MyNodeController(); + @StorageProp('layoutLog') layoutLog: string = '' + + build() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('layout') + .id('layout') + .onClick(() => { + this.myNodeController?.rootNode?.layout({ + x: 80, + y: 150 + }) + this.myNodeController?.rootNode?.invalidate() + }) + + Text(this.layoutLog) + .width('100%') + .margin({ top: 50, left: 20 }) + .fontSize(16) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4270.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7845b01b7bc08ffed85cee7b90391b7f6134926 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4270.ets @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + setNeedsLayout(): void { + console.info('sally setNeedsLayout success') + AppStorage.setOrCreate('setNeedsLayoutLog', 'setNeedsLayout success'); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4270 { + private myNodeController: MyNodeController = new MyNodeController(); + @StorageProp('setNeedsLayoutLog') setNeedsLayoutLog: string = '' + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + + Button('setNeedsLayout') + .id('setNeedsLayout') + .onClick(() => { + this.myNodeController?.rootNode?.setNeedsLayout(); + }) + + Text(this.setNeedsLayoutLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4280.ets new file mode 100644 index 0000000000000000000000000000000000000000..6701a196bfe8fdfcf5a5e255faf3c2c3962a8944 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4280.ets @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + invalidate(): void { + console.info('sally invalidate success') + AppStorage.setOrCreate('invalidateLog', 'invalidate success'); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4280 { + private myNodeController: MyNodeController = new MyNodeController(); + @StorageProp('invalidateLog') invalidateLog: string = '' + + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + + Button('invalidate') + .id('invalidate') + .onClick(()=>{ + this.myNodeController.rootNode?.invalidate() + }) + + Text(this.invalidateLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4290.ets new file mode 100644 index 0000000000000000000000000000000000000000..eaa03de2271dd769388565e8866e9c7894ec044d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4290.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 { NodeController, FrameNode, UIContext, typeNode, ComponentContent } from '@kit.ArkUI'; + +@Builder +function buildText() { + Column() { + Text('hello') + .width(50) + .height(50) + .backgroundColor(Color.Yellow) + } +} + +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext) + node.commonAttribute.width(300).height(300).backgroundColor(Color.Red) + 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) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(Color.Green) + let component = new ComponentContent(uiContext, wrapBuilder(buildText)) + if (row4.isModifiable()) { + row4.addComponentContent(component) + console.info('sally addComponentContent success') + AppStorage.setOrCreate('addComponentContentLog', 'addComponentContent success'); + col.appendChild(row4) + } + return node + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4200 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = ''; + @State index: number = 0; + @StorageProp('addComponentContentLog') addComponentContentLog: string = '' + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + .width(300) + .height(100) + + Button("addComponentContent") + .margin(20) + .width(300) + .onClick(() => { + this.myNodeController.makeNode(this.getUIContext()) + }) + .id('addComponentContent') + + Text(this.addComponentContentLog) + .width('100%') + .margin({ top: 150, left: 20 }) + .fontSize(16) + + } + .padding(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/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4300.ets new file mode 100644 index 0000000000000000000000000000000000000000..0569a6900115b72ae0636853599537e19a54569a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4300.ets @@ -0,0 +1,187 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + private myNodeController: MyNodeController = new MyNodeController(wrapBuilder(buildComponent2)); + + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + NodeContainer(this.myNodeController) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('BuilderNode aboutToAppear'); + } + + aboutToDisappear() { + console.error('BuilderNode aboutToDisappear'); + } +} + +@Component +struct TestComponent2 { + private myNodeController: MyNodeController = new MyNodeController(wrapBuilder(buildComponent3)); + private myNodeController2: MyNodeController = new MyNodeController(wrapBuilder(buildComponent4)); + + build() { + Column() { + Text('This is a BuilderNode 2.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + NodeContainer(this.myNodeController) + NodeContainer(this.myNodeController2) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('BuilderNode 2 aboutToAppear'); + } + + aboutToDisappear() { + console.error('BuilderNode 2 aboutToDisappear'); + } +} + +@Component +struct TestComponent3 { + build() { + Column() { + Text('This is a BuilderNode 3.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('BuilderNode 3 aboutToAppear'); + } + + aboutToDisappear() { + console.error('BuilderNode 3 aboutToDisappear'); + } +} + +@Component +struct TestComponent4 { + build() { + Column() { + Text('This is a BuilderNode 4.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('BuilderNode 4 aboutToAppear'); + } + + aboutToDisappear() { + console.error('BuilderNode 4 aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +@Builder +function buildComponent2() { + TestComponent2() +} + +@Builder +function buildComponent3() { + TestComponent3() +} + +@Builder +function buildComponent4() { + TestComponent4() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + private wrappedBuilder: WrappedBuilder<[]>; + + constructor(builder: WrappedBuilder<[]>) { + super(); + this.wrappedBuilder = builder; + } + + makeNode(uiContext: UIContext): FrameNode | null { + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(this.wrappedBuilder); + + return this.builderNode.getFrameNode(); + } + + dispose() { + if (this.builderNode !== null) { + this.builderNode.getFrameNode()?.disposeTree() + console.info('sally disposeTree success') + AppStorage.setOrCreate('disposeTreeLog', 'disposeTree success'); + } + } + + removeBuilderNode() { + const rootRenderNode = this.rootNode!.getRenderNode(); + if (rootRenderNode !== null && this.builderNode !== null && this.builderNode.getFrameNode() !== null) { + rootRenderNode.removeChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4300 { + private myNodeController: MyNodeController = new MyNodeController(wrapBuilder(buildComponent)); + @StorageProp('disposeTreeLog') disposeTreeLog: string = '' + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + Button('disposeTree') + .id('disposeTree') + .onClick(() => { + this.myNodeController.dispose(); + }) + .width('100%') + + Text(this.disposeTreeLog) + .width('100%') + .margin({ top: 150, left: 20 }) + .fontSize(16) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4310.ets new file mode 100644 index 0000000000000000000000000000000000000000..27fe8a7ff0cca5be123cf148db1bdb96bac42b46 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4310.ets @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, LayoutConstraint, ComponentContent } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + console.info('sally create LayoutConstrain:success') + AppStorage.setOrCreate('layoutConstrainLog', 'create LayoutConstrain:success'); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +@Builder +function buildText() { + Column() { + Text('hello word') + .width(50) + .height(50) + .backgroundColor(Color.Yellow) + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + let component = new ComponentContent(context, wrapBuilder(buildText)) + this.rootNode?.addComponentContent(component) + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNode4310 { + private myNodeController: MyNodeController = new MyNodeController(); + @State log: string = '' + @StorageProp('layoutConstrainLog') layoutConstrainLog: string = '' + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + + Button('LayoutConstrain') + .id('LayoutConstrain') + .onClick(() => { + const finalSize: Size = { width: 200, height: 300 }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + this.myNodeController.rootNode?.onMeasure(res) + }) + .width('100%') + Text(this.layoutConstrainLog) + .width('100%') + .margin({ top: 10, left: 20 }) + .fontSize(16) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4000.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4000.ets new file mode 100644 index 0000000000000000000000000000000000000000..52136cb4d65c71e5f01952379c1ab738606f9c48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4000.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 { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let textNode = typeNode.createNode(uiContext, "Text") + textNode.attribute.width(250) + .height(250) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(textNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4000 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = ''; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createTextTypeNode").id("idBtCreatTextTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4010.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1069c3884399b4a9bad9a1b905e149a9f371776 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4010.ets @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let columnNode = typeNode.createNode(uiContext, "Column") + columnNode.initialize({ space: 10 }) + this.node.appendChild(columnNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4010 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createColumnTypeNode").id("idBtCreateColumnTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4020.ets new file mode 100644 index 0000000000000000000000000000000000000000..661c676450f157562f1a7b8b2558738d6719d870 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4020.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 { typeNode, NodeController, FrameNode, ComponentContent } from '@ohos.arkui.node'; + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let rowNode = typeNode.createNode(uiContext, "Row") + rowNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(Color.Green) + this.node.appendChild(rowNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4020 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createRowTypeNode").id("idBtCreateRowTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4030.ets new file mode 100644 index 0000000000000000000000000000000000000000..53f733193dade9123991d449602639e6cc5b8a78 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4030.ets @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + + public node: FrameNode | null = null; + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300).height(300).backgroundColor(Color.Red) + let stackNode = typeNode.createNode(uiContext, "Stack") + stackNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(stackNode) + return this.node + } + getNodeType() + { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4030 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column(){ + Row() { + NodeContainer(this.myNodeController); + } + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createStackTypeNode").id("idBtCreateStackTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4040.ets new file mode 100644 index 0000000000000000000000000000000000000000..7189645c6fe1c5c7ef7823c2ac2fd53047288007 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4040.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let gridRowNode = typeNode.createNode(uiContext, "GridRow") + gridRowNode.attribute.width(100) + .height(100) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(Color.Green) + this.node.appendChild(gridRowNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4040 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createGridRowTypeNode").id("idBtCreateGridRowTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4050.ets new file mode 100644 index 0000000000000000000000000000000000000000..c9df64977fe599837bac361b8d1a2c31e24e688f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4050.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 { typeNode, NodeController, FrameNode, ComponentContent } from '@ohos.arkui.node'; + +@Builder +function buildText() { + Column() { + Text('GridCol') + .width(50) + .height(50) + .backgroundColor(Color.Yellow) + } +} + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let gridColumnNode = typeNode.createNode(uiContext, "GridCol") + gridColumnNode.attribute.width(100) + .height(100) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(Color.Green) + let component = new ComponentContent(uiContext, wrapBuilder(buildText)) + gridColumnNode.addComponentContent(component) + this.node.appendChild(gridColumnNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4050 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createGridColTypeNode").id("idBtCreateGridColTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4060.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c72a97d0768a5485686c133a8b662d32b6337c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4060.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 { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let flexNode = typeNode.createNode(uiContext, "Flex") + flexNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(flexNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4060 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createFlexTypeNode").id("idBtCreateFlexTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4070.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b7aa7949b9762b59544ff9e6b3dc08fee1eb4b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4070.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let swiperNode = typeNode.createNode(uiContext, "Swiper") + swiperNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(swiperNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4070 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createSwiperTypeNode").id("idBtCreateSwiperTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4080.ets new file mode 100644 index 0000000000000000000000000000000000000000..e445146376cc48cabbf20fdb1431cb7b8bdc81d3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4080.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let progressNode = typeNode.createNode(uiContext, "Progress") + progressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(progressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4080 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createProgressTypeNode").id("idBtCreateProgressTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4090.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ad4c910e54812c5eea2b3710f118b3708bf9146 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4090.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let progressNode = typeNode.createNode(uiContext, "Scroll") + progressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(progressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4090 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createScrollTypeNode").id("idBtCreateScrollTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4100.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3dee8a4d844391cba743b41a2b8abbbfbaf154c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4100.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let progressNode = typeNode.createNode(uiContext, "RelativeContainer") + progressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(progressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4100 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createRelativeContainerTypeNode").id("idBtCreateRelativeContainerTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4110.ets new file mode 100644 index 0000000000000000000000000000000000000000..3beb61c353234b139c3bf4690a57d46945f4333c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4110.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let progressNode = typeNode.createNode(uiContext, "Divider") + progressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(progressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4110 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createDividerTypeNode").id("idBtCreateDividerTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4120.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c4d86ec672291e19cf068ce76b99b2e0497fb1f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4120.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let LoadingProgressNode = typeNode.createNode(uiContext, "LoadingProgress") + LoadingProgressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(LoadingProgressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4120 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createLoadingProgressTypeNode").id("idBtCreateLoadingProgressTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4130.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5477adfd3b7157d38963a9dfaa5809fd764e6f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4130.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let LoadingProgressNode = typeNode.createNode(uiContext, "Search") + LoadingProgressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(LoadingProgressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4130 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createSearchTypeNode").id("idBtCreateSearchTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4140.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2d3c34c9b34aca78c1ffc453916c4e1f4f04d6b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4140.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let LoadingProgressNode = typeNode.createNode(uiContext, "Blank") + LoadingProgressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(LoadingProgressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4140 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createBlankTypeNode").id("idBtCreateBlankTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4150.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2fbc2d94702356c1e23d0408535b259e2e145a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4150.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let LoadingProgressNode = typeNode.createNode(uiContext, "Image") + LoadingProgressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(LoadingProgressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4150 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createImageTypeNode").id("idBtCreateImageTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4160.ets new file mode 100644 index 0000000000000000000000000000000000000000..3d69e19fa457959b7ced3687ce63e3631e17cbf1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4160.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let LoadingProgressNode = typeNode.createNode(uiContext, "List") + LoadingProgressNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(LoadingProgressNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4160 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createBlankTypeNode").id("idBtCreateBlankTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4170.ets new file mode 100644 index 0000000000000000000000000000000000000000..babde06c911f6c5403f153cfcddc95ebc1ced76e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4170.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let listItemNode = typeNode.createNode(uiContext, "ListItem") + listItemNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(listItemNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4170 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createListItemTypeNode").id("idBtCreateListItemTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4180.ets new file mode 100644 index 0000000000000000000000000000000000000000..f761afc654e06a83472629e29f5eb280b6b674ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4180.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let textInputNode = typeNode.createNode(uiContext, "TextInput") + textInputNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(textInputNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4180 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createTextInputNodeTypeNode").id("idBtCreateTextInputNodeTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4190.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a371687a1c1df3c5130aa01375339fa75d2662f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4190.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let buttonNode = typeNode.createNode(uiContext, "Button") + buttonNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(buttonNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4190 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createButtonNodeTypeNode").id("idBtCreateButtonNodeTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4200.ets new file mode 100644 index 0000000000000000000000000000000000000000..2fd13fc1fd8186bea7988d5d59237bc23c72dd6d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4200.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let listItemGroupNode = typeNode.createNode(uiContext, "ListItemGroup") + listItemGroupNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(listItemGroupNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4200 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createListItemGroupNodeTypeNode").id("idBtCreateListItemGroupNodeTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4210.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce6a28347c16714494f194d38741426d672b2823 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4210.ets @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let waterFlowNode = typeNode.createNode(uiContext, "WaterFlow") + waterFlowNode.attribute.width(200) + .height(200) + .borderWidth(1) + .borderColor(Color.Black) + .backgroundColor(0xAFEEEE) + this.node.appendChild(waterFlowNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4210 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createWaterFlowNodeTypeNode").id("idBtCreateWaterFlowNodeTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4230.ets new file mode 100644 index 0000000000000000000000000000000000000000..e0612493e09d1d6c921215b543771e97293016f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4230.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 { typeNode, NodeController, FrameNode } from '@ohos.arkui.node'; + + +class MyNodeController extends NodeController { + public node: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.node = new FrameNode(uiContext) + this.node.commonAttribute.width(300) + .height(300) + .backgroundColor(Color.Red) + let xComponentNode = typeNode.createNode(uiContext, "XComponent") + xComponentNode.attribute.width(200) + .height(200) + .backgroundColor(0xAFEEEE) + this.node.appendChild(xComponentNode) + return this.node + } + + getNodeType() { + let inspectorInfo = this.node?.getFirstChild()?.getNodeType(); + console.info("typeNode type " + JSON.stringify(inspectorInfo)); + return JSON.stringify(inspectorInfo) + } +} + +@Entry +@Component +struct ActionEventTypeNodeCreateFrameNode4230 { + private myNodeController: MyNodeController = new MyNodeController(); + @State type: string = "" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Row() { + NodeContainer(this.myNodeController); + } + + Text(`NodeType: ${this.type}`).margin(30).id("idTextTypeNode") + Button("createXComponentNodeTypeNode").id("idBtCreateXComponentNodeTypeNode").onClick(() => { + this.type = this.myNodeController?.getNodeType() + }) + } + } + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..7862488ea8031f42611568a089f8406345a76ab6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0010.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, LayoutConstraint } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachPen(pen); + canvas.drawRect({ left: 0, right: this.width, top: 0, bottom: this.width }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..5061bc60ad128fcd411780adf3cb4b57a53b2467 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0020.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 { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachPen(pen); + canvas.drawRect({ left: 0, right: this.width, top: 0, bottom: this.width }); + canvas.detachPen(); + } +} + +class MyNodeController extends NodeController { + private rootNode: MyFrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0020 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column({ space: 4 }) { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7e7c071c2c32511bb163a87968b5eff9bfc7597 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0030.ets @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, Position, RenderNode } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello RenderNode', + font, + drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 20, + right: 260, + top: 0, + bottom: 60 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, 20, 20); + canvas.detachBrush(); + } +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 20, + right: 500, + top: 0, + bottom: 100 + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + const renderNode = new MyRenderNode(); + renderNode.size = { width: 500, height: 500 } + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0030 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..199a5d5d81f286d622d09169d84409ef0fc70c84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0080.ets @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, Position, RenderNode, LayoutConstraint } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello RenderNode', + font, + drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 20, + right: 260, + top: 0, + bottom: 60 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, 20, 20); + canvas.detachBrush(); + } +} + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 500; + public size: number = 500; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 20, + right: this.size, + top: 0, + bottom: 100 + }); + canvas.detachPen(); + } + + changeSize() { + this.size = 300; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + const renderNode = new MyRenderNode(); + renderNode.size = { width: 500, height: 500 } + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0080 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + + Button('changeSize') + .id('ActionEventCommonEventFrameNodeOnDraw0080_btn1') + .onClick(() => { + this.myNodeController?.rootNode?.changeSize(); + this.myNodeController?.rootNode?.invalidate(); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c668cd24d52b46c06dda08a83c63ae9908f5c72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0090.ets @@ -0,0 +1,181 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, Position, RenderNode, LayoutConstraint } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello RenderNode', + font, + drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 20, + right: 260, + top: 0, + bottom: 60 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, 20, 20); + canvas.detachBrush(); + } +} + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 500; + public position: number = 100; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 20, + right: this.width, + top: 0, + bottom: this.position + }); + canvas.detachPen(); + } + + changeWidth() { + this.width = 300; + } + + changePosition() { + this.position = 300; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + const renderNode = new MyRenderNode(); + renderNode.size = { width: 500, height: 500 } + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0090 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + + Button('changePosition') + .id('ActionEventCommonEventFrameNodeOnDraw0090_btn1') + .onClick(() => { + this.myNodeController?.rootNode?.changePosition() + this.myNodeController?.rootNode?.invalidate(); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c237e825a7e58262f74d8f167ac0ebeadd4c484 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0100.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, Position, RenderNode } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello RenderNode', + font, + drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 20, + right: 260, + top: 0, + bottom: 60 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, 20, 20); + canvas.detachBrush(); + } +} + +class MyFrameNode extends FrameNode { + public width: number = 500; + private space: number = 1; + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 20, + right: this.width, + top: 0, + bottom: 100 + }); + canvas.detachPen(); + } + + changeWidth() { + this.width = 300; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + const renderNode = new MyRenderNode(); + renderNode.size = { width: 500, height: 500 } + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0100 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + + Button('invalidate root') + .id('ActionEventCommonEventFrameNodeOnDraw0100_btn1') + .onClick(() => { + this.myNodeController?.rootNode?.changeWidth(); + this.myNodeController?.rootNode?.invalidate(); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..287862b0ec40514efc4978e2b588c93e0a7497dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0110.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 100; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0110 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('Invalidate roots first childs first child') + .id('ActionEventCommonEventFrameNodeOnDraw0110_btn1') + .onClick(() => { + this.myNodeController?.rootNode?.commonAttribute?.backgroundColor(Color.Pink); + this.myNodeController?.rootNode?.invalidate(); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..02736c67ebc463a572ef025d28f3e605f06cf634 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0120.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachPen(pen); + canvas.drawRect({ left: 0, right: this.width, top: 0, bottom: this.width }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0120 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('Invalidate roots first childs first child') + .id('ActionEventCommonEventFrameNodeOnDraw0120_btn1') + .onClick(() => { + this.myNodeController?.rootNode?.invalidate(); + }) + Button('UpdateLayout') + .onClick(() => { + this.myNodeController?.rootNode?.setNeedsLayout(); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4e9093503cdc8430943df09384ea628bee7bb61 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0130.ets @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position, + RenderNode } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + let canvas = context.canvas; + + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 0, + green: 74, + blue: 175 + }); + const font = new drawing.Font(); + font.setSize(25); + const textBlob = drawing.TextBlob.makeFromString('Hello RenderNode', + font, + drawing.TextEncoding.TEXT_ENCODING_UTF8); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 20, + right: 260, + top: 0, + bottom: 60 + }); + + brush.setColor({ + alpha: 255, + red: 23, + green: 169, + blue: 141 + }); + canvas.attachBrush(brush); + canvas.drawTextBlob(textBlob, 20, 20); + canvas.detachBrush(); + } +} + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachPen(pen); + canvas.drawRect({ left: 0, right: this.width, top: 0, bottom: this.width }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + const renderNode = new MyRenderNode(); + renderNode.size = { width: 500, height: 500 } + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0130 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('frameNode getRenderNode invalidate不触发frameNode的重绘') + .id('ActionEventCommonEventFrameNodeOnDraw0130_btn1') + .onClick(() => { + this.myNodeController?.rootNode?.getRenderNode()?.invalidate(); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..2bafa2fdfceb1dd547ea9d3236d53aa35a3e2dee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0140.ets @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FrameNode, NodeController, typeNode } from '@ohos.arkui.node'; + +class MyNodeController extends NodeController { + public rootNode: FrameNode | null = null; + childShow: boolean = false; + text2: string = ''; + + aboutToAppear(): void { + this.text2 = 'MyNodeController setOnAppear'; + } + + aboutToDisappear(): void { + this.text2 = 'MyNodeController setOnDisappear'; + } + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .width('100%') + .height('100%') + .id('ActionEventCommonEventFrameNodeOnDraw0140_rootNode1') + + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 5 }) + .width('100%') + .height('200%') + + this.rootNode.appendChild(col); + + let button = typeNode.createNode(uiContext, 'Button'); + button.initialize('Hello button Node') + .fontColor(Color.Blue) + .fontSize(14) + .backgroundColor(Color.Pink) + .id('ActionEventCommonEventFrameNodeOnDraw0140_buttonNode1') + col.appendChild(button); + + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize('Hello text node') + .fontColor(Color.Blue) + .fontSize(14) + .padding(20) + .backgroundColor(Color.Pink) + .id('ActionEventCommonEventFrameNodeOnDraw0140_textNode1') + col.appendChild(text); + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0140 { + @State childShow: boolean = false; + @State text1: string = ''; + @State text2: string = ''; + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + Button('挂载 卸载') + .margin({ top: 50 }) + .id('ActionEventCommonEventFrameNodeOnDraw0140_btn1') + .onClick(() => { + this.childShow = !this.childShow; + }) + + Column() { + Text(this.text1).fontSize(24) + } + + if(this.childShow) { + ChildOnDraw0140({ + text1: this.text1 + }); + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + } + } + .width('100%') + .height('100%') + } + .height('100%') + } +} + +@Component +struct ChildOnDraw0140 { + @Link text1: string; + + aboutToAppear(): void { + this.text1 = 'setOnAppear'; + } + + aboutToDisappear(): void { + this.text1 = 'setOnDisappear'; + } + + build() { + Column() { + Button('声明式组件') + .id('ActionEventCommonEventFrameNodeOnDraw0140_btn2') + + } + .width('100%') + .height(200) + .backgroundColor(Color.Pink) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..cdf15d4bdcffa740b7dedb84f6f3e2b46d3e1d57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0150.ets @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + UIContext, + DrawContext, + FrameNode, + NodeController, + LayoutConstraint, + Size, + Position, + RenderNode, + BuilderNode +} from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +@Component +struct TestComponent { + @State text2: string = ''; + + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + + Button('灰色矩形frameNode') + .id('ActionEventCommonEventFrameNodeOnDraw0150_btn3') + .onClick(() => { + this.text2 += 'Click FrameNode'; + }) + .onTouch(() => { + this.text2 += 'touch FrameNode'; + }) + + Column() { + Text(this.text2).fontSize(24) + } + } + .width('100%') + .backgroundColor(Color.Gray) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + public builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 600, height: 500 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 500, height: 500 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + this.addCommonEvent(this.rootNode); + return this.rootNode; + } + + addCommonEvent(frameNode: FrameNode) { + frameNode.commonEvent.setOnClick((event: ClickEvent) => { + console.log(`Click FrameNode: ${JSON.stringify(event)}`) + }) + frameNode.commonEvent.setOnTouch((event: TouchEvent) => { + console.log(`touch FrameNode: ${JSON.stringify(event)}`) + }) + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0150 { + private myNodeController: MyNodeController = new MyNodeController(); + @State clearText: string = ''; + @State text1: string = ''; + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('clearMessage') + .margin({ top: 50 }) + .id('ActionEventCommonEventFrameNodeOnDraw0150_btn1') + .onClick(() => { + this.text1 = ''; + }) + Button('声明式组件') + .id('ActionEventCommonEventFrameNodeOnDraw0150_btn2') + .onClick(() => { + this.text1 += 'Click 声明式组件'; + }) + .onTouch(() => { + this.text1 += 'touch 声明式组件'; + }) + + Column() { + Text(this.text1).fontSize(24) + } + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..edff961a66d8d29a7695fb4c378a9ed82f10935b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0160.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + UIContext, + DrawContext, + FrameNode, + NodeController, + LayoutConstraint, + Size, + Position, + RenderNode, + BuilderNode +} from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +@Component +struct TestComponent { + @State text2: string = ''; + @State backgroundColorVal: Color = Color.Gray; + + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + + Button('灰色矩形frameNode') + .id('ActionEventCommonEventFrameNodeOnDraw0160_btn3') + .onHover((isHover: boolean, event: HoverEvent) => { + this.backgroundColorVal = Color.Yellow; + this.text2 = 'event.target' + event.target + ', isHover: ' + isHover; + }) + + Column() { + Text(this.text2).fontSize(24) + } + } + .width('100%') + .backgroundColor(this.backgroundColorVal) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + public builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 600, height: 500 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 500, height: 500 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + this.addCommonEvent(this.rootNode); + return this.rootNode; + } + + addCommonEvent(frameNode: FrameNode) { + frameNode.commonEvent.setOnClick((event: ClickEvent) => { + console.log(`Click FrameNode: ${JSON.stringify(event)}`) + }) + frameNode.commonEvent.setOnTouch((event: TouchEvent) => { + console.log(`touch FrameNode: ${JSON.stringify(event)}`) + }) + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0160 { + private myNodeController: MyNodeController = new MyNodeController(); + @State clearText: string = ''; + @State text1: string = ''; + @State backgroundColorVal: Color = Color.Blue; + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('clearMessage') + .margin({ top: 50 }) + .id('ActionEventCommonEventFrameNodeOnDraw0160_btn1') + .onClick(() => { + this.text1 = ''; + }) + Button('声明式组件') + .backgroundColor(this.backgroundColorVal) + .id('ActionEventCommonEventFrameNodeOnDraw0160_btn2') + .onHover((isHover: boolean, event: HoverEvent) => { + this.backgroundColorVal = Color.Yellow; + this.text1 = 'event.target' + event.target + ', isHover: ' + isHover; + }) + + Column() { + Text(this.text1).fontSize(24) + } + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0f325a7c6f2ce03d9e68c4af934909d77830009 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0170.ets @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + UIContext, + DrawContext, + FrameNode, + NodeController, + LayoutConstraint, + Size, + Position, + RenderNode, + BuilderNode +} from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +@Component +struct TestComponent { + @State message: string = ''; + @State backgroundColorVal: Color = Color.Gray; + + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + + Button('灰色矩形frameNode') + .id('ActionEventCommonEventFrameNodeOnDraw0170_btn3') + .focusable(true) + .onFocus(() => { + this.backgroundColorVal = Color.Pink; + this.message = "灰色矩形frameNode 获焦"; + }) + .onBlur(() => { + this.backgroundColorVal = Color.Gray; + this.message = "灰色矩形frameNode 失焦"; + }) + + Column() { + Text(this.message).fontSize(24) + } + } + .width('100%') + .backgroundColor(this.backgroundColorVal) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + public builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 600, height: 500 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 500, height: 500 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + this.addCommonEvent(this.rootNode); + return this.rootNode; + } + + addCommonEvent(frameNode: FrameNode) { + frameNode.commonEvent.setOnClick((event: ClickEvent) => { + console.log(`Click FrameNode: ${JSON.stringify(event)}`) + }) + frameNode.commonEvent.setOnTouch((event: TouchEvent) => { + console.log(`touch FrameNode: ${JSON.stringify(event)}`) + }) + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0170 { + private myNodeController: MyNodeController = new MyNodeController(); + @State clearText: string = ''; + @State text1: string = ''; + @State backgroundColorVal: Color = Color.Blue; + + build() { + Row() { + Column() { + Column() { + Text(this.text1).fontSize(24) + } + Button('声明式组件') + .backgroundColor(this.backgroundColorVal) + .id('ActionEventCommonEventFrameNodeOnDraw0170_btn2') + .focusable(true) + .onFocus(() => { + this.backgroundColorVal = Color.Pink; + this.text1 = "声明式组件 获焦" + }) + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('clearMessage') + .margin({ top: 50 }) + .id('ActionEventCommonEventFrameNodeOnDraw0170_btn1') + .onClick(() => { + this.text1 = ''; + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..ceb4e1632bfb35fb946393354c945b81607ea1b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0180.ets @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + UIContext, + DrawContext, + FrameNode, + NodeController, + LayoutConstraint, + Size, + Position, + RenderNode, + BuilderNode +} from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +@Component +struct TestComponent { + @State message: string = ''; + @State backgroundColorVal: Color = Color.Gray; + + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + + Button('灰色矩形frameNode') + .id('ActionEventCommonEventFrameNodeOnDraw0180_btn3') + .keyboardShortcut('1', [ModifierKey.CTRL],()=>{ + this.message = "keyboardShortcut Button "; + }) + + Column() { + Text(this.message).fontSize(24) + } + } + .width('100%') + .backgroundColor(this.backgroundColorVal) + } + + aboutToAppear() { + console.error('aboutToAppear'); + } + + aboutToDisappear() { + console.error('aboutToDisappear'); + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachPen(pen); + canvas.drawRect({ + left: 0, + right: this.width, + top: 0, + bottom: this.width + }); + canvas.detachPen(); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + public builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 600, height: 500 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 500, height: 500 }; + rootRenderNode.backgroundColor = 0xff00ff00; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + this.addCommonEvent(this.rootNode); + return this.rootNode; + } + + addCommonEvent(frameNode: FrameNode) { + frameNode.commonEvent.setOnClick((event: ClickEvent) => { + console.log(`Click FrameNode: ${JSON.stringify(event)}`) + }) + frameNode.commonEvent.setOnTouch((event: TouchEvent) => { + console.log(`touch FrameNode: ${JSON.stringify(event)}`) + }) + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0180 { + private myNodeController: MyNodeController = new MyNodeController(); + @State clearText: string = ''; + @State text1: string = ''; + @State backgroundColorVal: Color = Color.Blue; + + build() { + Row() { + Column() { + NodeContainer(this.myNodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('clearMessage') + .margin({ top: 50 }) + .id('ActionEventCommonEventFrameNodeOnDraw0180_btn1') + .onClick(() => { + this.text1 = ''; + }) + Button('声明式组件') + .backgroundColor(this.backgroundColorVal) + .id('ActionEventCommonEventFrameNodeOnDraw0180_btn2') + .onHover((isHover: boolean, event: HoverEvent) => { + this.backgroundColorVal = Color.Yellow; + this.text1 = 'event.target' + event.target + ', isHover: ' + isHover; + }) + + Column() { + Text(this.text1).fontSize(24) + } + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..51bc4c50eee1e33e566ec372b1188ea50760ca3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190.ets @@ -0,0 +1,499 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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, FrameNode, NodeController } from "@ohos.arkui.node" +import { UIContext } from '@ohos.arkui.UIContext'; + +class Params { + text: string = "" + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildButton() { + Button('in_frameNode').width(100).id('button_in_node') +} + +class MyNodeController extends NodeController { + public rootNode: FrameNode | null = null; + public Message_0: string = '' + public button_Message: string = '' + public touchMessage_0: string = '' + public Message_1: string = '' + public touchMessage_1: string = '' + public shortCutMessage: string = '' + public eventType: string = '' + public mouseText: string = ''; + public action: string = ''; + public mouseBtn: string = ''; + public color_0: Color = Color.Gray; + public color_1: Color = Color.Gray + private buttontNode: BuilderNode<[Params]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.rootNode == null) { + this.rootNode = new FrameNode(uiContext); + this.buttontNode = new BuilderNode(uiContext, { selfIdealSize: { width: 100, height: 100 } }) + this.buttontNode.build(wrapBuilder<[Params]>(buildButton)) + this.rootNode.appendChild(this.buttontNode!.getFrameNode()) + this.rootNode.commonAttribute + .id('rootNode') + .backgroundColor(this.color_0) + .width(300) + .height(50) + .focusable(true) + // .keyboardShortcut('1', [ModifierKey.CTRL], () => { + // if (this.shortCutMessage == '') { + // this.shortCutMessage = 'frameNode 触发快捷键事件' + // } + // else { + // this.shortCutMessage = '' + // } + // }) + + this.rootNode.commonEvent.setOnClick(() => { + console.log(this.shortCutMessage = 'frameNode 触发快捷键事件') + }) + + + //button 添加onTouch事件测试hitTestBehavior + this.rootNode!.getChild(0)!.commonEvent.setOnTouch((event: TouchEvent) => { + if (event.type === TouchType.Up) { + if (this.button_Message == '') { + this.button_Message = "button onTouch test" + } else { + this.button_Message = '' + } + } + }) + + this.rootNode!.commonEvent.setOnClick((event: ClickEvent) => { + this.Message_0 = 'Click Point:' + + '\n windowX:' + event.windowX.toFixed(0) + + '\n windowY:' + event.windowY.toFixed(0) + + '\n x:' + event.x.toFixed(0) + ' y:' + event.y.toFixed(0) + + '\ntarget:' + '(' + event.target.area.globalPosition.x?.toString().substring(0, 3) + ',' + + event.target.area.globalPosition.y?.toString().substring(0, 3) + ')' + + '\n width:' + event.target.area.width + ' height:' + event.target.area.height + console.log('mhy frameNode setOnClick timestamp = ' + event.timestamp + ' source = ' + event.source) + } + ) + this.rootNode!.commonEvent.setOnTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.touchMessage_0 = 'frameNode setOnTouch Down' + } + if (event.type === TouchType.Up) { + this.touchMessage_0 = 'frameNode setOnTouch Up' + + } + if (event.type === TouchType.Move) { + this.touchMessage_0 = 'frameNode setOnTouch Move\n' + 'TouchType:' + event.type + + ' Distance between touch point and touch element: x: ' + + event.touches[0].x.toFixed(0) + ' ' + 'y: ' + event.touches[0].y.toFixed(0) + ' Component globalPos:(' + + event.target.area.globalPosition.x?.toString().substring(0, 3) + ',' + + event.target.area.globalPosition.y?.toString().substring(0, 3) + ') width:' + + event.target.area.width + ' height:' + event.target.area.height + } + }) + this.rootNode!.commonEvent.setOnAppear(() => { + this.Message_0 = 'FrameNode setOnAppear' + }) + this.rootNode!.commonEvent.setOnDisappear(() => { + this.Message_0 = 'FrameNode setOnDisappear' + }) + + + this.rootNode!.commonEvent.setOnKeyEvent(((event: KeyEvent) => { + console.log("mhy setOnKeyEvent") + if (event) { + if (event.type === KeyType.Down) { + this.eventType = 'Down' + } + if (event.type === KeyType.Up) { + this.eventType = 'Up' + } + this.Message_0 = 'KeyType:' + this.eventType + + '\nkeyCode:' + event.keyCode + + '\nkeyText:' + event.keyText + + '\nintentionCode:' + event.intentionCode + + '\nmetaKey:' + event.metaKey + console.log('mhy frameNode setOnKeyEvent timestamp = ' + event.timestamp + ' deviceId = ' + event.deviceId + + ' keySource = ' + event.keySource) + } + })) + this.rootNode!.commonEvent.setOnFocus(() => { + this.color_0 = Color.Pink; + this.rootNode!.commonAttribute + .backgroundColor(this.color_0) + }) + this.rootNode!.commonEvent.setOnBlur(() => { + this.color_0 = Color.Gray; + this.rootNode!.commonAttribute + .backgroundColor(this.color_0); + this.shortCutMessage = '' + }) + + this.rootNode!.commonEvent.setOnHover((isHover: boolean, event: HoverEvent) => { + if (isHover) { + this.color_0 = Color.Yellow; + this.rootNode!.commonAttribute + .backgroundColor(this.color_0) + } else { + this.color_0 = Color.Gray; + this.rootNode!.commonAttribute + .backgroundColor(this.color_0) + } + }) + this.rootNode!.commonEvent.setOnMouse((event: MouseEvent) => { + { + if (event) { + switch (event.button) { + case MouseButton.None: + this.mouseBtn = 'None'; + break; + case MouseButton.Left: + this.mouseBtn = 'Left'; + break; + case MouseButton.Right: + this.mouseBtn = 'Right'; + break; + case MouseButton.Back: + this.mouseBtn = 'Back'; + break; + case MouseButton.Forward: + this.mouseBtn = 'Forward'; + break; + case MouseButton.Middle: + this.mouseBtn = 'Middle'; + break; + } + switch (event.action) { + case MouseAction.Hover: + this.action = 'Hover'; + break; + case MouseAction.Press: + this.action = 'Press'; + break; + case MouseAction.Move: + this.action = 'Move'; + break; + case MouseAction.Release: + this.action = 'Release'; + break; + } + this.Message_0 = 'onMouse:\nButton = ' + this.mouseBtn + + '\nXY=(' + event.x.toFixed(0) + ',' + event.y.toFixed(0) + ')' + + '\nbutton = ' + event.button + + '\nAction = ' + event.action + + '\ntarget = ' + event.target + + '\nwindow = x:' + event.windowX.toFixed(0) + 'y:' + event.windowY.toFixed(0) + + '\ndisplay = x:' + event.displayX.toFixed(0) + 'y:' + event.displayY.toFixed(0) + console.log('mhy frameNode setonMouse timestamp = ' + event.timestamp + ' source = ' + event.source) + } + } + }) + } + return this.rootNode; + } + + //给声明式组件添加事件 + addCommonEvents() { + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnClick((event: ClickEvent) => { + this.Message_1 = 'Click Point:' + + '\n windowX:' + event.windowX.toFixed(0) + + '\n windowY:' + event.windowY.toFixed(0) + + '\n x:' + event.x.toFixed(0) + ' y:' + event.y.toFixed(0) + + '\ntarget:' + '(' + event.target.area.globalPosition.x?.toString().substring(0, 3) + ',' + + event.target.area.globalPosition.y?.toString().substring(0, 3) + ')' + + '\n width:' + event.target.area.width + ' height:' + event.target.area.height + console.log('mhy Text setOnClick timestamp = ' + event.timestamp + ' source = ' + event.source) + }) + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.touchMessage_1 = ('setOnTouch Down') + } + if (event.type === TouchType.Up) { + this.touchMessage_1 = ('mhy setOnTouch Up') + + } + if (event.type === TouchType.Move) { + this.touchMessage_1 = ('mhy setOnTouch Move\n') + + ('TouchType:' + event.type + ' Distance between touch point and touch element: x: ' + + event.touches[0].x.toFixed(0) + ' ' + 'y: ' + event.touches[0].y.toFixed(0) + ' Component globalPos:(' + + event.target.area.globalPosition.x?.toString().substring(0, 3) + ',' + + event.target.area.globalPosition.y?.toString().substring(0, 3) + ') width:' + + event.target.area.width + ' height:' + event.target.area.height) + } + }) + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnAppear(() => { + this.Message_1 = "setOnAppear" + }) + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnDisappear(() => { + this.Message_1 = "setOnDisappear" + }) + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnKeyEvent((event: KeyEvent) => { + if (event) { + if (event.type === KeyType.Down) { + this.eventType = 'Down' + } + if (event.type === KeyType.Up) { + this.eventType = 'Up' + } + this.Message_1 = 'KeyType:' + this.eventType + + '\nkeyCode:' + event.keyCode + + '\nkeyText:' + event.keyText + + '\nintentionCode:' + event.intentionCode + + '\nmetaKey:' + event.metaKey + console.log('mhy Text setOnKeyEvent timestamp = ' + event.timestamp + ' deviceId = ' + event.deviceId + + ' keySource = ' + event.keySource) + } + + }) + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnFocus(() => { + this.color_1 = Color.Pink + }) + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnBlur(() => { + this.color_1 = Color.Gray; + this.shortCutMessage = '' + }) + + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnHover((isHover: boolean, + event: HoverEvent) => { + if (isHover) { + this.color_1 = Color.Yellow + } else { + this.color_1 = Color.Gray + } + }) + this.rootNode!.getParent()!.getParent()!.getChild(2)!.commonEvent.setOnMouse((event: MouseEvent) => { + { + if (event) { + switch (event.button) { + case MouseButton.None: + this.mouseBtn = 'None'; + break; + case MouseButton.Left: + this.mouseBtn = 'Left'; + break; + case MouseButton.Right: + this.mouseBtn = 'Right'; + break; + case MouseButton.Back: + this.mouseBtn = 'Back'; + break; + case MouseButton.Forward: + this.mouseBtn = 'Forward'; + break; + case MouseButton.Middle: + this.mouseBtn = 'Middle'; + break; + } + switch (event.action) { + case MouseAction.Hover: + this.action = 'Hover'; + break; + case MouseAction.Press: + this.action = 'Press'; + break; + case MouseAction.Move: + this.action = 'Move'; + break; + case MouseAction.Release: + this.action = 'Release'; + break; + } + this.Message_1 = 'onMouse:\nButton = ' + this.mouseBtn + + '\nXY=(' + event.x.toFixed(0) + ',' + event.y.toFixed(0) + ')' + + '\nbutton = ' + event.button + + '\nAction = ' + event.action + + '\ntarget = ' + event.target + + '\nwindow = x:' + event.windowX.toFixed(0) + 'y:' + event.windowY.toFixed(0) + + '\ndisplay = x:' + event.displayX.toFixed(0) + 'y:' + event.displayY.toFixed(0) + console.log('mhy Text setonMouse timestamp = ' + event.timestamp + ' source = ' + event.source) + } + } + }) + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeOnDraw0190 { + @State myNodeController: MyNodeController = new MyNodeController(); + @State isShow: boolean = true + @State responseRegion_flag: boolean = false + @State hitTestBehavior_flag: boolean = false + @State isMonopolizeEvents: boolean = false + @State isEnabled: boolean = true + + build() { + Column() { + Row() { + Text('挂载/卸载') + .id('text_0') + .onClick(() => { + this.isShow = !this.isShow; + }) + .borderWidth(1) + .backgroundColor(this.isShow ? Color.Green : Color.Pink) + .margin(5) + + // 点击触摸热区按钮,frameNode只有右侧50%响应点击和触摸事件 + Text('触摸热区') + .id('text_1') + .onClick(() => { + this.responseRegion_flag = !this.responseRegion_flag + if (this.responseRegion_flag) { + this.myNodeController.rootNode!.commonAttribute + .responseRegion({ + x: '50%', + y: 0, + width: '50%', + height: '100%' + }) + } else { + this.myNodeController.rootNode!.commonAttribute + .responseRegion({ + x: 0, + y: 0, + width: '100%', + height: '100%' + }) + } + } + ) + .borderWidth(1) + .backgroundColor(this.responseRegion_flag ? Color.Pink : Color.Green) + .margin(5) + // 触摸测试控制 + Text('hitTestBehavior') + .id('text_2') + .onClick(() => { + this.hitTestBehavior_flag = !this.hitTestBehavior_flag + if (this.hitTestBehavior_flag) { + this.myNodeController.rootNode!.commonAttribute + .hitTestBehavior(HitTestMode.Block) + } else { + this.myNodeController.rootNode!.commonAttribute + .hitTestBehavior(HitTestMode.Default) + } + } + ) + .borderWidth(1) + .backgroundColor(this.hitTestBehavior_flag ? Color.Pink : Color.Green) + .margin(5) + // enabled是false时不可响应,text为绿色时为true,粉色为false + Text('enabled') + .id('text_3') + .onClick(() => { + this.isEnabled = !this.isEnabled; + this.myNodeController.rootNode!.commonAttribute.enabled(this.isEnabled) + } + ) + .borderWidth(1) + .backgroundColor(this.isEnabled ? Color.Green : Color.Pink) + .margin(5) + } + + Row() { + Text('clearMessage') + .id('text_clear') + .onClick(() => { + this.myNodeController.Message_0 = ''; + this.myNodeController.touchMessage_0 = ''; + this.myNodeController.button_Message = ''; + this.myNodeController.Message_1 = ''; + this.myNodeController.touchMessage_1 = ''; + this.myNodeController.shortCutMessage = ''; + }) + .borderWidth(1) + .margin(5) + + //事件独占控制monopolizeEvents + Text('事件独占控制') + .id('text_4') + .onClick(() => { + this.isMonopolizeEvents = !this.isMonopolizeEvents; + this.myNodeController.rootNode!.commonAttribute + .monopolizeEvents(this.isMonopolizeEvents) + } + ) + .borderWidth(1) + .backgroundColor(this.isMonopolizeEvents ? Color.Pink : Color.Green) + .margin(5) + } + + if (this.isShow) { + Text("声明式组件") + .id('test_text') + .backgroundColor(this.myNodeController.color_1) + .focusable(true) + .borderWidth(1) + .width(100) + .height(50) + .margin(10) + .keyboardShortcut('2', [ModifierKey.CTRL], () => { + if (this.myNodeController.shortCutMessage == '') { + this.myNodeController.shortCutMessage = 'text 触发快捷键事件' + } else { + this.myNodeController.shortCutMessage = '' + } + } + ) + .onAppear(() => { + this.myNodeController.addCommonEvents() + }) + } + if (this.isShow) { + NodeContainer(this.myNodeController) + .keyboardShortcut('1', [ModifierKey.CTRL], () => { + if (this.myNodeController.shortCutMessage == '') { + this.myNodeController.shortCutMessage = 'frameNode 触发快捷键事件' + } else { + this.myNodeController.shortCutMessage = '' + } + } + ) + .borderWidth(1) + .width(300) + .height(50) + .margin(10) + } + Text('声明式组件事件信息:' + this.myNodeController.Message_1 + '\ntouch信息:' + + this.myNodeController.touchMessage_1) + .borderWidth(1) + .width('95%') + .margin(10) + Text('Node事件信息:' + this.myNodeController.Message_0 + '\ntouch信息:' + this.myNodeController.touchMessage_0) + .borderWidth(1) + .width('95%') + .margin(10) + Text('Node挂载button事件信息:' + this.myNodeController.button_Message) + .borderWidth(1) + .width('95%') + .margin(10) + Text('快捷键信息:' + this.myNodeController.shortCutMessage) + .borderWidth(1) + .width('95%') + .margin(10) + } + .borderWidth(1) + + .width("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/UIComponentGraphicNodeContainer0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/UIComponentGraphicNodeContainer0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..f09ac6357ec018d84113d4ef51f91f574d1eb854 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommonEventFrameNodeOnDraw/UIComponentGraphicNodeContainer0230.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 100, height: 100 }; +renderNode.backgroundColor = 0xffff0000; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentGraphicNodeContainer0230 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5a568e31d73d91d3475d78292e0a3e5d680b424 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0040.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0040 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('rectClip') + .onClick(() => { + shapeClip.setRectShape({ + left: 300, + right: -100, + top: 600, + bottom: -300 + }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fbbc2919dba04f0c3902b5c1b0aa141f88c198b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0050.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0050 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('rectClip') + .onClick(() => { + shapeClip.setRectShape({ + left: 50, + right: -200, + top: 50, + bottom: -400 + }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f4ca79816f9553f320db89c72257659785fee1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0060.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0060 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('rectClip') + .onClick(() => { + shapeClip.setRectShape({ + left: -200, + right: -10, + top: -200, + bottom: -10 + }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..24173cd81057384c484e94643a2dab331b99cde6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0070.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0070 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('rectClip') + .onClick(() => { + shapeClip.setRectShape({ + left: 200, + right: 50, + top: 200, + bottom: 50 + }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..49fd802a41d43cefea5fa1edf71bb70fde56312d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0160.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0160 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('roundRectClip') + .onClick(() => { + shapeClip.setRoundRectShape({ + rect: { + left: 50, + right: 200, + top: 50, + bottom: 400 + }, + corners: { + topLeft: {x: 100, y:100}, + topRight: {x: 100, y:100}, + bottomLeft: {x:100, y:100}, + bottomRight: {x: 100, y: 100} + } + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..275bfb5cbeb318d3ab4a9b8c549d938acacee64a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0170.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0170 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: 150, + centerY: 150, + radius: 150 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..14d60b750a747b6f4fc718e32c4e0948e76be764 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0180.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0180 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: 75, + centerY: 75, + radius: 75 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..8724453b5a2ea2dc3d6b52ac131806f327686773 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0190.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0190 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: -150, + centerY: -150, + radius: -150 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8431505fd99ba7016f8afd130d154637af4397e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0200.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0200 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: 150, + centerY: 0, + radius: 150 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..c109d2719b13c6384ae5238a4cd18f1b6015368d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0210.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0210 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: 0, + centerY: 150, + radius: 150 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..3cf8c039efb6d16459a47522fb19f71a7abdb2ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0220.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0220 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: 150, + centerY: 150, + radius: 0 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..48baa799ad2c1254f3e6df75ce911276cdcf8229 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0230.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0230 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: 75, + centerY: -150, + radius: 50 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f2c47096b0101dfaea1530b917a7e4d9a546186 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0240.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0240 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('circleShape') + .onClick(() => { + shapeClip.setCircleShape({ + centerX: 75, + centerY: 0, + radius: 150 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbad5745b2b4404b591f80a71cce8a7bf910809e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0250.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0250 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: 50, + right: 200, + top: 50, + bottom: 400 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c1b01f02b9abb9943a25ab7d0c4f205b0d2f74c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0260.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0260 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: 50, + right: -200, + top: 50, + bottom: -400 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..227df04677d3d714ae665b2347ef15705b84946a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0270.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0270 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: -10, + right: 200, + top: 10, + bottom: 200 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..dac212de70ee34dfccf0eaf73c7990b737559953 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0280.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0280 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: 300, + right: -100, + top: 600, + bottom: -300 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..ab7202c99e26a3cb4f5b7de7aaeef02b04162f42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0290.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0290 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: 50, + right: -200, + top: 50, + bottom: -400 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..e15a693642ee193c4bc48f9c5bb901445460ce96 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0300.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0300 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: -200, + right: -10, + top: -200, + bottom: -10 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..5aa45f96f70d85aadeba03077d1b58ad955e7076 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0310.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0310 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: 200, + right: 50, + top: 200, + bottom: 50 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..eb9870958bd0485207120f1e72661143bd24c2f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0320.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0320 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('ovalClip') + .onClick(() => { + shapeClip.setOvalShape({ + left: 100, + right: 300, + top: 100, + bottom: 500 + }) + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..b58364768bd6d9ae4375a470957bf768c4ddda32 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0330.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0330 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M100 0 L200 240 L0 240 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..0aefa06fc9418ec2dc0adde098880ea4124bd9f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0340.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0340 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M0,0 H200 V200 H0 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..8414b3120649754648c2e44164a00eb8ab14055b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0350.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} +shapeClip.setCommandPath({ commands: "M100 0 L0 100 L50 200 L150 200 L200 100 Z" }); +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0350 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M100 0 L0 100 L50 200 L150 200 L200 100 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..47cf88a7b00893fe70e4355e96632a87ae23e90c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0360.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0360 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M0 300 S100 0 240 300 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..21dd73848eb2fd78c8d377bdde92c2d510c7c865 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0370.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0370 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M0,100 A100,30 0 0,1 200,100 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..e5dec5951f24b5c4981d142908a79fe8a69cf3e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0380.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0380 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M0 150 C0 100 140 0 200 150 L100 300 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..bbaa2f6a03e3609db7f80fb14ae73619d39cf656 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0390.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0390 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M0,300 Q400,50 600,300 T1000,300 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..75ef0dff96c40ae0686af82f42c2ba26cfb88bb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0400.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 500, + height: 800 +}; +renderNode.backgroundColor = 0XFF00FF00; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommonEventFrameNodeClip0400 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button('commandClip') + .onClick(() => { + shapeClip.setCommandPath({ commands: "M0 -300 S 100 0 240-300 Z" }); + renderNode.shapeClip = shapeClip; + }) + .id('showButton') + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..d70b1977c729b93a3735ca88f1e8cedb152b29f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100.ets @@ -0,0 +1,244 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, RenderNode, ShapeClip } from '@kit.ArkUI'; + +const clip = new ShapeClip(); +clip.setRectShape({ + left: 0, + top: 0, + right: 0, + bottom: 0 +}); + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 480, + height: 480 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.shapeClip = clip; +const shapeClip = renderNode.shapeClip; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct ActionEventCommoneventFramenodeClip0100 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + + Flex({wrap: FlexWrap.Wrap}) { + Button("0100") + .id('ActionEventCommoneventFramenodeClip01') + .onClick(() => { + shapeClip.setRoundRectShape({ + rect: { + left: 0, + top: 0, + right: 150, + bottom: 150 + }, + corners: { + topLeft: { x: 0, y: 0 }, + topRight: { x: 0, y: 0 }, + bottomLeft: { x: 0, y: 0 }, + bottomRight: { x: 0, y: 0 } + } + }); + renderNode.shapeClip = shapeClip; + }) + Button("0020") + .id('ActionEventCommoneventFramenodeClip02') + .onClick(() => { + renderNode.shapeClip.setRectShape({ + left: 0, + top: 0, + right: 150, + bottom: 150 + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0090") + .id('ActionEventCommoneventFramenodeClip03') + .onClick(() => { + renderNode.shapeClip.setRoundRectShape({ + rect: { + left: 50, + right: 200, + top: 50, + bottom: 400 + }, + corners: { + topLeft: { x: 32, y: 32 }, + topRight: { x: 32, y: 32 }, + bottomLeft: { x: 32, y: 32 }, + bottomRight: { x: 32, y: 32 } + } + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0010") + .id('ActionEventCommoneventFramenodeClip04') + .onClick(() => { + renderNode.shapeClip.setRectShape({ + left: 50, + right: 200, + top: 50, + bottom: 400 + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0030") + .id('ActionEventCommoneventFramenodeClip05') + .onClick(() => { + renderNode.shapeClip.setRectShape({ + left: -10, + right: 250, + top: -10, + bottom: 250 + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0080") + .id('ActionEventCommoneventFramenodeClip06') + .onClick(() => { + renderNode.shapeClip.setRectShape({ + left: 100, + right: 300, + top: 100, + bottom: 500 + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0140") + .id('ActionEventCommoneventFramenodeClip07') + .onClick(() => { + renderNode.shapeClip.setRoundRectShape({ + rect: { + left: -200, + right: -10, + top: -200, + bottom: -10 + }, + corners: { + topLeft: { x: 32, y: 32 }, + topRight: { x: 32, y: 32 }, + bottomLeft: { x: 32, y: 32 }, + bottomRight: { x: 32, y: 32 } + } + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0150") + .id('ActionEventCommoneventFramenodeClip08') + .onClick(() => { + renderNode.shapeClip.setRoundRectShape({ + rect: { + left: 50, + right: 200, + top: 50, + bottom: 400 + }, + corners: { + topLeft: { x: -32, y: -32 }, + topRight: { x: -32, y: -32 }, + bottomLeft: { x: -32, y: -32 }, + bottomRight: { x: -32, y: -32 } + } + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0130") + .id('ActionEventCommoneventFramenodeClip09') + .onClick(() => { + renderNode.shapeClip.setRoundRectShape({ + rect: { + left: 50, + right: -200, + top: 50, + bottom: -400 + }, + corners: { + topLeft: { x: 32, y: 32 }, + topRight: { x: 32, y: 32 }, + bottomLeft: { x: 32, y: 32 }, + bottomRight: { x: 32, y: 32 } + } + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0110") + .id('ActionEventCommoneventFramenodeClip10') + .onClick(() => { + renderNode.shapeClip.setRoundRectShape({ + rect: { + left: -10, + right: 200, + top: -10, + bottom: 200 + }, + corners: { + topLeft: { x: 32, y: 0 }, + topRight: { x: 32, y: 0 }, + bottomLeft: { x: 32, y: 0 }, + bottomRight: { x: 32, y: 0 } + } + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + Button("0120") + .id('ActionEventCommoneventFramenodeClip11') + .onClick(() => { + renderNode.shapeClip.setRoundRectShape({ + rect: { + left: 300, + right: -100, + top: 600, + bottom: -300 + }, + corners: { + topLeft: { x: 0, y: 32 }, + topRight: { x: 0, y: 32 }, + bottomLeft: { x: 0, y: 32 }, + bottomRight: { x: 0, y: 32 } + } + }); + renderNode.shapeClip = renderNode.shapeClip; + }) + } + }.width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cffe391dfddbc1dc23acedd043c5f39b0d4d24c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, BuilderNode, FrameNode, UIContext } from '@kit.ArkUI'; + +declare class Params { + text: string +} + +@Builder +function buttonBuilder(params: Params) { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceEvenly }) { + Text(params.text) + .fontSize(12) + Button(`This is a Button`, { type: ButtonType.Normal, stateEffect: true }) + .fontSize(12) + .borderRadius(8) + .backgroundColor(0x317aff) + } + .height(100) + .width(200) +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | null = null; + private wrapBuilder: WrappedBuilder<[Params]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.rootNode === null) { + this.rootNode = new BuilderNode(uiContext); + this.rootNode.build(this.wrapBuilder, { text: "This is a Text" }) + } + return this.rootNode.getFrameNode(); + } +} + + +@Entry +@Component +struct ComponentGtaphicNodecontainerDocDemo { + private baseNode: MyNodeController = new MyNodeController() + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceEvenly }) { + Text("This is a NodeContainer contains a text and a button ") + .fontSize(9) + .fontColor(0xCCCCCC) + NodeContainer(this.baseNode) + .borderWidth(1) + .onClick(() => { + console.log("click event"); + }) + } + .padding({ left: 35, right: 35, top: 35 }) + .height(200) + .width(300) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c7215f217c4bf0762417cdab48562f0522a4bd3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0010.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 100, height: 100 }; +renderNode.backgroundColor = 0xffff0000; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentCraphicNodeContainerRender0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..6937ed60b4b9a79a657da3b10428bc44749dff8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0080.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 100, height: 100 }; +renderNode.backgroundColor = 0xffff0000; +renderNode.clipToFrame = true; +const clipToFrame = renderNode.clipToFrame; + +const childNode = new RenderNode(); +childNode.frame = { x: 10, y: 10, width: 150, height: 50 }; +childNode.backgroundColor = 0xffffff00; +renderNode.appendChild(childNode); + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentCraphicNodeContainerRender0080 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a4082ec4de3de52f21ddb3fed18b2b69aa63bcd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0260.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class TextRenderNode extends RenderNode { + async draw(context: DrawContext) { + const canvas = context.canvas + const brush = new drawing.Brush() + brush.setColor({alpha: 255, red: 255, green: 0, blue: 0}) + const font = new drawing.Font() + font.setSize(50) + const textBlob = drawing.TextBlob.makeFromString("Hello World", font, drawing.TextEncoding.TEXT_ENCODING_UTF8) + canvas.attachBrush(brush) + canvas.drawTextBlob(textBlob, 0, 100) + } +} +// 创建一个TextRenderNode对象 +const textNode = new TextRenderNode() +// 定义textNode的像素格式 +textNode.frame = { x: 0, y: 0, width: 300, height: 200 } +textNode.pivot = { x: 0.5, y: 0.5 } +textNode.scale = { x: 1, y: 1 } +textNode.backgroundColor = 0xffffff00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(textNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentCraphicNodeContainerRender0260 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController).width('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b85b917d4f57ab488de475aa6dfc016a1b04221 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0270.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class TextRenderNode extends RenderNode { + async draw(context: DrawContext) { + const canvas = context.canvas + const brush = new drawing.Brush() + brush.setColor({alpha: 255, red: 255, green: 0, blue: 0}) + const font = new drawing.Font() + font.setSize(50) + const textBlob = drawing.TextBlob.makeFromString("Hello World", font, drawing.TextEncoding.TEXT_ENCODING_UTF8) + canvas.attachBrush(brush) + canvas.drawTextBlob(textBlob, 0, 100) + } +} +// 创建一个TextRenderNode对象 +const textNode = new TextRenderNode() +// 定义textNode的像素格式 +textNode.frame = { x: 0, y: 0, width: 300, height: 200 } +textNode.pivot = { x: 0.5, y: 0.5 } +textNode.scale = { x: 1, y: 1 } +textNode.backgroundColor = 0xffffff00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(textNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentCraphicNodeContainerRender0270 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController).width('100%') + Button('invalidate') + .id('UIComponentCraphicNodeContainerRender0270') + .onClick(() => { + textNode.invalidate() + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd658ad04460e2a9ca4aabadb110b9e32ed70078 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0010.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 { FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + .size({width: 200, height: 200}) + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..72cf309ddeb018f0ddaff3955733377578e6e4a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0030.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 300, height: 500 }; + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ab73818f7faf24b770d9e5bbdc2d8c782cb2e69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0040.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 { FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 100, height: 100 }; + renderNode.backgroundColor = 0XFFFF0000; + } + + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..1dc97e8e0e97b96b17428a00b71a15616822c592 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0050.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TextAndTextInputComponent { + @State text: string = "请输入文字:"; + @State inputValue: string = ""; + controller: TextInputController = new TextInputController() + + build() { + Column() { + Text(this.text) + .fontSize(20) + .margin({ top: 10, bottom: 10 }) + TextInput({ + text: this.inputValue, + placeholder: "输入文字", + controller: this.controller + }) + .fontSize(20) + .padding({ left: 10, right: 10, top: 5, bottom: 5 }) + .borderWidth(1) + .borderColor('#ccc') + .borderRadius(5) + .onChange((value: string) => { + this.inputValue = value; + }) + } + .width('100%') + } +} + +@Builder +function buildComponent() { + TextAndTextInputComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1c43fcb305af0519f68741adfbc56b6ce90ec2d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0060.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 100, height: 100 }; + rootRenderNode.backgroundColor = 0XFF00FF00; + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + @State clickStr: string = ''; + @State doubleStr: string = ''; + + build() { + Column() { + NodeContainer(this.myNodeController) + .id("nodeControllerID") + .borderWidth(1) + .onClick(() => { + this.clickStr = "click event"; + }) + .gesture( + LongPressGesture({ repeat: true }) + .onAction((event: GestureEvent) => { + if (event && event.repeat) { + this.doubleStr = 'longPress gesture' + } + }) + ) + Text('点击事件执行结果:' + this.clickStr) + Text('长按手势执行结果:' + this.doubleStr) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..0645ab23813cc777d4030927f6739dc0edb74cc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0070.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 50, height: 50 }; + renderNode.backgroundColor = 0xffff0000; + + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + @State toggle: boolean = true + build() { + Column() { + NodeContainer(this.myNodeController) + .id("animateButton") + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + .onClick(() => { + animateTo({ duration: 4000, curve: Curve.Linear }, () => { + this.toggle = false + }) + }) + } + .width('100%') + .height('100%') + .alignItems(this.toggle ? HorizontalAlign.Start : HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..010e024e16ecd28db7c82b9348bb4d8b783fb845 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0330.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0330 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('旋转').id('rotate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .margin(50) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d3f795447c7d064ec234fa10661139e1e3194f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0340.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. + */ + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0340 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('缩放').id('scale') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.scaleX = 0.5; + this.scaleY = 2; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .margin(50) + .backgroundColor(Color.Red) + .scale({ x: this.scaleX, y: this.scaleY }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..23a7749ad5555d674d20720003bd1f42c112a4df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0350.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0350 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('scale') + .id('scale') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('动画').id('animation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + this.scaleX = 0.5; + this.scaleY = 2; + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c4ddccf209b7b5724faf722442ea5d81cb1a93e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0370.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0370 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .rotate({ angle: this.ang }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('旋转').id('rotate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..ab3a856aac2d67b9c4547dd5b286bde1a4a865a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0380.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0380 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .scale({ x: this.scaleX, y: this.scaleY }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('缩放').id('scale') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.scaleX = 0.5; + this.scaleY = 2; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..48cdd2fefcb702bb4846e1e1b73eb92765e3230e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0390.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0390 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('动画').id('animation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + this.scaleX = 0.5; + this.scaleY = 2; + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..740d6019b55495310e8666a9df9fdcf9d98075c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0400.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0400 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('平移').id('translate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ebd842f05829689e9311c5b8b0b1faf89b8671c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0410.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0410 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('旋转').id('rotate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1e7caf2d10a0da10fbe0ff6f47ebba46463028c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0420.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0420 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('缩放').id('scale') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.scaleX = 0.5; + this.scaleY = 2; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..e20111657861409133f94b8ef45a5461b844c6ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0430.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0430 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('动画').id('animation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + this.scaleX = 0.5; + this.scaleY = 2; + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..6a97175ca7228a4ea246441f661de1c9b4067e39 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0440.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0440 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: null, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('平移').id('translate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0760.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0760.ets new file mode 100644 index 0000000000000000000000000000000000000000..404c989c8140a413c33b3f29e074267ee2e43a3f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0760.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0760 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('translate') + .id('translate') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .translate({ x: this.tranX, y: this.tranY }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('平移').id('translation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0790.ets new file mode 100644 index 0000000000000000000000000000000000000000..9aa3fbe2d9b3d7638b1f21bdb61d4a665b8042e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0790.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0790 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('scale') + .id('scale') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('动画').id('animation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + this.scaleX = 0.5; + this.scaleY = 2; + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0820.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d814003cc848ff15a650f7e41fde0d135ecc175 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0820.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. + */ + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0820 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('缩放').id('scale') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.scaleX = 0.5; + this.scaleY = 2; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .margin(50) + .backgroundColor(Color.Red) + .scale({ x: this.scaleX, y: this.scaleY }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0830.ets new file mode 100644 index 0000000000000000000000000000000000000000..c12e5876aa4483013ecd2d7a96fd6febf7d83318 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0830.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0830 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('动画').id('animation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + this.scaleX = 0.5; + this.scaleY = 2; + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0840.ets new file mode 100644 index 0000000000000000000000000000000000000000..a03e3c605d269f9ad388da5106eaf49acd697297 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0840.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0840 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('平移').id('translate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0860.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e2d1013661c982d3cf4544d1d50681c2da6d1c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0860.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0860 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .scale({ x: this.scaleX, y: this.scaleY }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('缩放').id('scale') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.scaleX = 0.5; + this.scaleY = 2; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0870.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0870.ets new file mode 100644 index 0000000000000000000000000000000000000000..d76dcf132be09165220315d312abcc70f3fe03e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0870.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 { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0870 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .scale({ x: this.scaleX, y: this.scaleY }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('动画').id('animation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + this.scaleX = 0.5; + this.scaleY = 2; + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0880.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0880.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b72d56416c0e5a0f90797f6d07f88888723e111 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0880.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget0880 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: false, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + .translate({ x: this.tranX, y: this.tranY }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('平移').id('translate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .scale({ x: this.scaleX, y: this.scaleY }) + .rotate({ angle: this.ang }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1170.ets new file mode 100644 index 0000000000000000000000000000000000000000..89cde04e9f212bc8d55c9c5f38b9cfdc13e03176 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1170.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 { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget1170 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: undefined, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('rotate').id('rotate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .margin(50) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1180.ets new file mode 100644 index 0000000000000000000000000000000000000000..c67c294736ef1926b2a00a8e84873340d9d37647 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1180.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget1180 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: undefined, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('scale').id('scale') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.scaleX = 0.5; + this.scaleY = 2; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .margin(50) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1190.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9e47c0e4a844333f3e7e0d95dcb23f12785a170 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1190.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget1190 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('scale') + .id('scale') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: true, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('动画').id('animation') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.ang = 90; + this.scaleX = 0.5; + this.scaleY = 2; + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1200.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f096cd7e74e9cc5a784676cb1fe6c6912e85b15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1200.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { matrix4 } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentPopupBoxPopupFollowTransformOfTarget1200 { + @State handlePopup: boolean = false; + @State autoCancel: boolean = false; + @State tranX: number = 0; + @State tranY: number = 0; + @State scaleX: number = 1; + @State scaleY: number = 1; + @State ang: number = 0; + + build() { + Column() { + Column() { + Button('button') + .id('button') + .onClick(() => { + this.handlePopup = !this.handlePopup; + }) + .bindPopup(this.handlePopup, { + message: 'This is a popup with PopupOptions', + placementOnTop: true, + showInSubWindow: false, + autoCancel: false, + mask: false, + onWillDismiss: true, + followTransformOfTarget: undefined, + popupColor: Color.White, + primaryButton: { + value: 'confirm', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + // 第二个按钮 + secondaryButton: { + value: 'cancel', + action: () => { + this.handlePopup = !this.handlePopup; + } + }, + onStateChange: (e) => { + console.info(JSON.stringify(e.isVisible)) + if (!e.isVisible) { + this.handlePopup = false; + } + } + }) + } + .backgroundColor(Color.Pink) + .justifyContent(FlexAlign.Center) + .width('90%') + .height('40%') + + Column() { + Button('平移').id('translate') + .onClick(() => { + animateTo({ + duration: 1000, + iterations: 1 + }, () => { + this.tranX = 50; + this.tranY = 100; + }) + }) + }.margin({ top: 70 }) + } + .width(300) + .height(200) + .backgroundColor(Color.Red) + .rotate({ angle: this.ang }) + .scale({ x: this.scaleX, y: this.scaleY }) + .translate({ x: this.tranX, y: this.tranY }) + .transform(matrix4.identity()) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface001.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd8f9e5613032b73260b20438469928bb17d22c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface001.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class NodeController001 extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface001 { + private mNodeController001: NodeController001 = new NodeController001(); + + build() { + Column() { + NodeContainer(this.mNodeController001) + .width(150) + .height(150) + .borderRadius(10) + .backgroundColor(0xf56c6c) + .zIndex(2) + .shadow({ + radius: 300, + color: Color.Yellow, + offsetX: 0, + offsetY: 0 + }); + NodeContainer(this.mNodeController001) + .width(150) + .height(150) + .backgroundColor(0x67C23A) + .borderRadius(10) + .translate({ y: -50 }) + .shadow({ + radius: 220, + color: Color.Blue, + offsetX: 0, + offsetY: 0 + }) + .zIndex(1) + }.useShadowBatching(true) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..421c92c8d643021c07c91d7ce8ae66cc00ea2099 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0020.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .size({ + width: 100, + height: 100 + }) + .backgroundColor(Color.Orange) + .outlineWidth(5) + .outlineStyle(OutlineStyle.DASHED) + + this.rootNode.commonAttribute.outlineRadius(10); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface003.ets new file mode 100644 index 0000000000000000000000000000000000000000..a4befd69ebd25be3143047ed162da2fffe48cae9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface003.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController003 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.outlineWidth(5).outlineColor(0x317AF7).outlineRadius(10) + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 200, height: 200 }; + renderNode.backgroundColor = 0xffff0000; + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface003 { + private mNodeController003: NodeController003 = new NodeController003(); + + build() { + Row() { + NodeContainer(this.mNodeController003) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..042f76a265a42f093d60eaac6574a5666d3a8283 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0040.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 { FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .size({ + width: 100, + height: 100 + }) + .backgroundColor(Color.Orange) + .outlineRadius(10) + .outlineStyle(OutlineStyle.DASHED) + this.rootNode.commonAttribute.outlineWidth(5); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface005.ets new file mode 100644 index 0000000000000000000000000000000000000000..07a4c646ddd05d8cc691fa27b1961218ca3abeda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface005.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController005 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.outlineStyle(OutlineStyle.DASHED).outlineWidth(5).outlineColor(0x317AF7).outlineRadius(10) + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 200, height: 200 }; + renderNode.backgroundColor = 0xffff0000; + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface003 { + private mNodeController005: NodeController005 = new NodeController005(); + + build() { + Row() { + NodeContainer(this.mNodeController005) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface006.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c4579995c473668918f40fb82c2a7c12f7a0c13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface006.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController006 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.outline({ width: 5, color: 0x317AF7, radius: 10, style: OutlineStyle.DOTTED }) + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 200, height: 200 }; + renderNode.backgroundColor = 0xffff0000; + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface006 { + private mNodeController006: NodeController006 = new NodeController006(); + + build() { + Row() { + NodeContainer(this.mNodeController006) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..feee1b4ed9119c2fe169d2ab3fd386643fb2f2df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0060.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 300, height: 500 }; + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + @State text: string = "" + @State longTouchText: string = ''; + + build() { + Column() { + NodeContainer(this.myNodeController) + .id('nodeContainerID') + .borderWidth(1) + .onClick(() => { + this.text = "click event"; + }) + .gesture( + LongPressGesture({ repeat: true }) + .onAction((event: GestureEvent) => { + if (event && event.repeat) { + this.longTouchText = 'long gesture'; + } + }) + ) + Text(this.text).id('showText') + Text(this.longTouchText).id('showLongTouchText') + }.width('100%').height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface007.ets new file mode 100644 index 0000000000000000000000000000000000000000..9264fe60c589d14b433a158e18d3a659c5bddec1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface007.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .width(200) + .height(50) + .fontSize(14) + .backgroundImage('cat.jpg'); + flex.appendChild(text); + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("backgroundBrightness") + .fontColor(Color.Black) + .fontSize(14) + .margin({ left: 15 }) + .backgroundBrightness({ rate: 0.5, lightUpDegree: 0.5 }) + .width(200) + .height(50) + .backgroundImage('cat.jpg'); + flex.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface007 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..e27f453c8e4feab718e548b2fd035c37e595f067 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0080.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .draggable(true) + .onDragStart(()=>{}) + .dragPreviewOptions({ mode: [ DragPreviewMode.ENABLE_DEFAULT_SHADOW, DragPreviewMode.ENABLE_DEFAULT_RADIUS ] }) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0080 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface009.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3b44c3e9a5c0675b4ad5d82587ffb59a8890afa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface009.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .width(200) + .height(50) + .fontSize(14) + .backgroundImage('cat.jpg'); + flex.appendChild(text); + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("backdropBlur") + .fontColor(Color.White) + .fontSize(14) + .margin({ left: 15 }) + .backdropBlur(30) + .width(200) + .height(50) + .backgroundImage('cat.jpg'); + flex.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface009 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface010.ets new file mode 100644 index 0000000000000000000000000000000000000000..9543f2e497c9ace06f60c11254b0592650f20476 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface010.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("hello") + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .backgroundImage('cat.jpg') + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("blur") + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .margin({ left: 15 }) + .backgroundImage('cat.jpg') + .blur(5) + flex.appendChild(text); + flex.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface010 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface011.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a2cfc93cc94a23656e04323ddbd697c2af8f3e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface011.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .width(200) + .height(50) + .fontSize(14) + .backgroundImage('cat.jpg') + .backgroundEffect({ radius: 20, brightness: 0.6, saturation: 15 }); + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface011 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3bd4833f597d9c4131673798720c764478cd353 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0120.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .invert(45) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0120 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca5bdaeb415c13ac66be8ee7c57daf40c45bec98 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0130.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 { NodeController, FrameNode, BuilderNode, RenderNode, typeNode } from '@kit.ArkUI'; +@ObservedV2 +class mNodeController0130 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + @Trace message: string = 'set monopolizeEvents true' + @Trace messageOut: string = ' ' + @Trace messageInner: string = ' ' + @Trace monopolize: boolean = true + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(300) + .height(300) + .borderColor(Color.Black) + .margin({left:80,top:30}) + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize() + .backgroundColor(Color.Gray) + .height('100%') + .width('100%') + // 外层column绑定触摸事件 + .onTouch((event)=>{ + if (event.type == TouchType.Down) { + console.log("outside column touch down") + this.messageOut = "外层 inner column touch down" + } + }) + node.appendChild(col); + let col2 = typeNode.createNode(uiContext, 'Column'); + col2.initialize() + .id("click0130") + .monopolizeEvents(this.monopolize) + .width('100%') + .height('40%') + .backgroundColor(Color.Blue) + // 内层column绑定触摸事件 + .onTouch((event:TouchEvent)=>{ + if (event.type == TouchType.Down) { + console.log("inner column touch down") + this.messageInner = "内层 inner column touch down" + } + }) + col.appendChild(col2); + return node; + } +} + +@Entry +@ComponentV2 +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0130 { + private mNodeController0130: mNodeController0130 = new mNodeController0130(); + + build() { + Column() { + Text(this.mNodeController0130.message) + .fontSize(22) + .margin(10) + Text(this.mNodeController0130.messageOut) + .fontSize(22) + .margin(10) + Text(this.mNodeController0130.messageInner) + .fontSize(22) + .margin(10) + + NodeContainer(this.mNodeController0130) + + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..2872d7d827898b3543d1440780e015d1f8e24236 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0140.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0140 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..04fdcdf5d1f5fa7d54f15ce9f380b8d16faddbdd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0150.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private flag: boolean = true; + + makeNode(uiContext: UIContext): FrameNode | null { + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .textAlign(TextAlign.Center) + .fontSize(26) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0150") + .width(150) + .height(30) + .backgroundColor(Color.Red) + .renderFit(RenderFit.CENTER) + .onClick(() => { + animateTo({ curve: Curve.Ease }, () => { + if (this.flag) { + text.commonAttribute.width(250).height(60) + } else { + text.commonAttribute.width(150).height(30) + } + text.invalidate() + this.flag = !this.flag; + }) + }) + return text; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0150 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface016.ets new file mode 100644 index 0000000000000000000000000000000000000000..70f82f6da99b8ffac16aa238c2f9d2bb54a5a251 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface016.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class NodeController016 extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Black) + .borderWidth(1) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 5 }) + .width('100%').height('100%').margin({ top: 5 }); + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello").fontColor(Color.Blue).fontSize(14).obscured([ObscuredReasons.PLACEHOLDER]); + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface016 { + private mNodeController016: NodeController016 = new NodeController016(); + + build() { + Row() { + NodeContainer(this.mNodeController016); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface017.ets new file mode 100644 index 0000000000000000000000000000000000000000..5251942468e27d69956e7ae87c0979809f82dae7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface017.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("accessibilityLevel") + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface017_001') + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .accessibilityLevel('yes') + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface017 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface018.ets new file mode 100644 index 0000000000000000000000000000000000000000..61df42102a3c84e5419e8a538306db57b1a2b11a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface018.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("accessibilityDescription") + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface018_001') + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .accessibilityDescription('accessibilityDescription') + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface018 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface019.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d11f0b307340e7c7cc08c94f71a7751a15e4e3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface019.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("accessibilityText") + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface019_001') + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .accessibilityText('accessibilityText') + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface019 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface020.ets new file mode 100644 index 0000000000000000000000000000000000000000..419ffc2f84266a3a75ce233d0ae1aee52ab1c4c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface020.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("accessibilityGroup") + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface020_001') + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .accessibilityGroup(true) + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface020 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..a96f0eb64f1102c4376523cceb915649966dc043 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0210.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode} from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State message: string = 'Hello World' + build() { + Row() { + Column({ space: 5 }) { + Text(this.message) + Button("keyboardShortcut").onClick((event: ClickEvent) => { + this.message = "I clicked Button 2"; + }).keyboardShortcut("W", [ModifierKey.CTRL],()=>{ + this.message = "keyboardShortcut Button "; + }) + } + .width('100%') + } + .height('100%') + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController0210 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 50, height: 50 }; + renderNode.backgroundColor = 0xffff0000; + + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0210 { + private mNodeController0210: NodeController0210 = new NodeController0210(); + @State message: string = 'Hello World' + build() { + Column() { + Text(this.message) + NodeContainer(this.mNodeController0210).keyboardShortcut("W", [ModifierKey.CTRL],()=>{ + this.message = "keyboardShortcut CTRL+W "; + }) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..fffbcbc1440055e8593e3c5c91d8a51fbc6d1b09 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0230.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .geometryTransition('node') + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0230 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..73b4c780d74921428ef8a352a23656d27db93f37 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0240.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface0240_001') + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0240 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c93b6783977de190bcfb3424e29b6660248dbdc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0250.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let image = typeNode.createNode(uiContext, 'Image'); + image.initialize('cat.jpg') + image.attribute + .width(200) + .height(200) + image.commonAttribute.mask(new ProgressMask(55.0, 100.0, Color.Gray)) + this.rootNode.appendChild(image); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..cb24960e1aeff16f4d6c891f00fd06c76dbc3fce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0260.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, ShapeClip } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .clip(true) + .clipShape(new Circle({ width: 50, height: 50 })) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0260 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..179c556d4b1c89319dbbddb477ce706311e54dc3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0270.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0270") + .width(300) + .height(300) + .backgroundColor(Color.Red) + .shadow({ + radius: 10, + color: Color.Gray, + offsetX: 200, + offsetY: 200 + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0270 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface028.ets new file mode 100644 index 0000000000000000000000000000000000000000..6edecb8796d15bf691c2ef78e3a6126e854add14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface028.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController028 extends NodeController { + private rootNode: FrameNode | null = null; + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 50, height: 50 }; + renderNode.backgroundColor = 0xffff0000; + + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface028 { + private mNodeController028: NodeController028 = new NodeController028(); + @State toggle: boolean = true + build() { + Column() { + NodeContainer(this.mNodeController028) + .id("button028") + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + .onClick(() => { + animateTo({ duration: 4000, curve: Curve.Linear }, () => { + this.toggle = false + }) + }) + }.width('100%').height('100%').alignItems(this.toggle ? HorizontalAlign.Start : HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..7be4577cdcaebec78159a427f02d8534ad215dfd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0290.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .width(200) + .height(100) + .radialGradient({ + center: [100, 50], + radius: 60, + repeating: true, + colors: [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 0.5]] + }); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface030.ets new file mode 100644 index 0000000000000000000000000000000000000000..615d5bc7bb9846efe22697853d82730eae105053 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface030.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController030 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.sweepGradient({ + center: [50, 50], + start: 0, + end: 359, + colors: [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]] + }) + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 200, height: 200 }; + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface030 { + private mNodeController030: NodeController030 = new NodeController030(); + + build() { + Row() { + NodeContainer(this.mNodeController030) + + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..0bf36ca5ce82c839180f5ba2bb6f015932fb03b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0310.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.width(200).height(200); + let img = typeNode.createNode(uiContext, 'Image'); + img.initialize('cat.jpg') + img.attribute.width(200).height(200); + img.commonAttribute.overlay('这是在照片上增加遮罩文本', { + align: Alignment.Bottom, + offset: { x: 0, y: -50} + }) + this.rootNode.appendChild(img); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..d2ce84717dad28e82f13d0652937f5b9ccbd0982 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0320.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .draggable(true) + .onDragStart(()=>{}) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0320 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface033.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0135975bed1b1ebc340fb6073b80deb75ffb7b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface033.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("allowDrop") + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface033_001') + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .draggable(true) + .allowDrop([uniformTypeDescriptor.UniformDataType.TEXT]) + .copyOption(CopyOptions.InApp) + flex.appendChild(text); + let textArea = typeNode.createNode(uiContext, 'TextArea'); + textArea.initialize({ + placeholder: 'input your word...' + }) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface033_002') + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + flex.appendChild(textArea) + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface033 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..375c89a9257d77f03df67853657c783b42225ed5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0340.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .clickEffect({level:ClickEffectLevel.LIGHT}) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0340 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface035.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac1f33f0cfcfd7525d0b2c7a0d23af838e54e02f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface035.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .width(200) + .height(50) + .fontSize(14) + .backgroundColor(Color.Yellow); + flex.appendChild(text); + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("aspectRatio") + .fontColor(Color.White) + .fontSize(14) + .aspectRatio(2) + .width(200) + .height(50) + .backgroundColor(Color.Red); + flex.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface035 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface036.ets new file mode 100644 index 0000000000000000000000000000000000000000..25358a35f0008b290bc37e32aad5d640fcc6aa27 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface036.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let relativeContainer = typeNode.createNode(uiContext, 'RelativeContainer'); + relativeContainer.initialize() + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface036_RelativeContainer') + .width(600) + .height(100) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(relativeContainer); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface036_RelativeContainer_text1') + .fontColor(Color.Black) + .fontSize(14) + .backgroundColor(Color.Yellow) + .alignRules({ + top: { + anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface036_RelativeContainer', + align: VerticalAlign.Top + }, + start: { + anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface036_RelativeContainer', + align: HorizontalAlign.Start + } + }); + relativeContainer.appendChild(text); + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("test") + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface036_RelativeContainer_text2') + .fontColor(Color.White) + .fontSize(14) + .backgroundColor(Color.Red) + .alignRules({ + top: { + anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface036_RelativeContainer_text1', + align: VerticalAlign.Bottom + }, + left: { + anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface036_RelativeContainer_text1', + align: HorizontalAlign.End + } + }); + relativeContainer.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface036 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7b38f8a3371cedc77c25c5f52dee2ca79588a64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0370.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 { RenderNode, FrameNode, NodeController, promptAction } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .enabled(false) + .onClick(()=>{ + promptAction.showToast({message:"enable: false"}) + }) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0370 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..18fef554bd42cf82dfa890994d7b0e1826528e4c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0380.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0380") + .width(150) + .height(150) + .fontSize(24) + .backgroundColor(Color.Red) + .onClick(() => { + text.commonAttribute.offset({ x: 150, y: 50 }) + }) + return text; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0380 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface039.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bc31561723f9cc22185d963a314d8ed7bd95d4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface039.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController039 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .markAnchor({ x: 50, y: -25 }) + .size({ width: 200, height: 200 }) + .backgroundColor(0xffff0000) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface039 { + private mNodeController039: NodeController039 = new NodeController039(); + + build() { + Row() { + NodeContainer(this.mNodeController039) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface040.ets new file mode 100644 index 0000000000000000000000000000000000000000..43ca39012a8c9c6ce4a206c33c62499f293bc95c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface040.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController040 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .markAnchor({ x: 50, y: -25 }) + .size({ width: 200, height: 200 }) + .backgroundColor(0xffff0000) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface040 { + private mNodeController040: NodeController040 = new NodeController040(); + + build() { + Row() { + NodeContainer(this.mNodeController040) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface041.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fac2100e460d933b8bc8febf2a77eee0e5c7bf5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface041.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(200) + .height(200) + .backgroundColor(Color.Pink) + .align(Alignment.TopEnd) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 5 }) + .width(100).height(100).margin({ top: 5 }).backgroundColor(Color.Blue); + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello").fontColor(Color.White).fontSize(14); + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface041 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac3b7071e4f0ee6de59a7c409545d4b0ce8d2de9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0420.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .direction(Direction.Rtl) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0420 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface043.ets new file mode 100644 index 0000000000000000000000000000000000000000..62652b49c6441d9ac362c1b723a4b9bffc039b4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface043.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 { NodeController, FrameNode } from '@kit.ArkUI'; +class NodeController043 extends NodeController { + private rootNode: FrameNode | null = null; + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 50, height: 50 }; + renderNode.backgroundColor = 0xffff0000; + animateTo({ duration: 4000, curve: Curve.Linear }, () => { + + }) + } + return this.rootNode; + } +} +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface043 { + @State active: boolean = false + private mNodeController043: NodeController043 = new NodeController043(); + build() { + Column() { + Navigator({ target: 'testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterfaceSharedTransition', type: NavigationType.Push }) { + NodeContainer(this.mNodeController043).sharedTransition('sharedImage', { duration: 800, curve: Curve.Linear, delay: 100 }) + }.padding({ left: 20, top: 20 }) + .id("click043") + .onClick(() => { + this.active = true + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface044.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0b8641ebb9f7db16213c60292e03e0f87dc2ff5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface044.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class NodeController044 extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface001 { + private mNodeController044: NodeController044 = new NodeController044(); + + build() { + Column() { + NodeContainer(this.mNodeController044) + .width(150) + .height(150) + .borderRadius(10) + .backgroundColor(0xf56c6c) + .zIndex(2) + .shadow({ + radius: 300, + color: Color.Yellow, + offsetX: 0, + offsetY: 0 + }); + NodeContainer(this.mNodeController044) + .width(150) + .height(150) + .backgroundColor(0x67C23A) + .borderRadius(10) + .translate({ y: -50 }) + .shadow({ + radius: 220, + color: Color.Blue, + offsetX: 0, + offsetY: 0 + }) + .zIndex(1) + }.useShadowBatching(true) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..be08d2629fc66fcb010cba50ff60b8aa35731982 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0450.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .displayPriority(2) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0450 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface046.ets new file mode 100644 index 0000000000000000000000000000000000000000..a97096c606f47605fdb2a746b15194f0ef7cd84b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface046.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .height(100) + .fontSize(14) + .backgroundColor(Color.Yellow); + flex.appendChild(text); + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("test") + .fontColor(Color.White) + .fontSize(14) + .height(100) + .alignSelf(ItemAlign.End) + .backgroundColor(Color.Red); + flex.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface046 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..bdc2854e4b03ea730aaf4b54bd59eafe271b3949 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0470.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .flexBasis(50) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0470 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController).flexBasis(100) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0480.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d2cf71b70d65caa4a0655b1a12f049aa50bf3d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0480.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .flexShrink(10) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0480 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0490.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ba0ef524bfc3eaafea48d2cc702e5cd4ff3d90c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0490.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .flexBasis(100) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0490 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..29027d3ba6c52d314d16556871b4af8fd1395f2d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0500.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 { NodeController, FrameNode, matrix4 } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.width(300) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0500") + .height(300) + .backgroundColor(Color.Red) + .transform( + matrix4 + .identity() + .translate({ x: 50, y: 50 }) + .scale({ x: 1.5, y: 1 }) + .rotate({ + x: 0, + y: 0, + z: 1, + angle: 60 + })) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0500 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..141b1cb4e2f445cd9e634768f118ed8bd89feb7c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0510.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, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State z: number = 0; + flag: boolean = true; + + build() { + Column() { + Text('BuilderNode') + .textAlign(TextAlign.Center) + .fontSize(26) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0510") + .width(150) + .height(150) + .backgroundColor(Color.Green) + .rotate({ + x: 0, + y: 0, + z: this.z, + centerX: '50%', + centerY: '50%', + angle: 300 + }) + .onClick(() => { + if (this.flag) { + this.z = 1 + } else { + this.z = 0 + } + this.flag = !this.flag; + }) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0510 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8814511f6ea7c4cd08b2d7c5046e54a6817989f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0520.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .gridOffset(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0520 { + private myNodeController: MyNodeController = new MyNodeController(); + private myNodeController1: MyNodeController = new MyNodeController(); + + build() { + Column(){ + GridContainer(){ + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..4de4b999f8159bd127e07eb128e997945ed897a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0530.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .gridSpan(5) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0530 { + private myNodeController: MyNodeController = new MyNodeController(); + private myNodeController1: MyNodeController = new MyNodeController(); + + build() { + Column(){ + GridContainer(){ + Row() { + NodeContainer(this.myNodeController) + NodeContainer(this.myNodeController1) + }.padding(20) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface054.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface054.ets new file mode 100644 index 0000000000000000000000000000000000000000..512fd4a58b82d8f64d720df995f58f0d8151a569 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface054.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.backgroundColor = 0xffff0000; +renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; +renderNode.scale = { x: 0.5, y: 1 }; +class NodeController054 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface054 { + private mNodeController054: NodeController054 = new NodeController054(); + + build() { + Row() { + NodeContainer(this.mNodeController054) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0550.ets new file mode 100644 index 0000000000000000000000000000000000000000..04bf685ac904640c63f2762da7ec4438ebf55026 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0550.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0550") + .width(150) + .height(150) + .fontSize(24) + .backgroundColor(Color.Red) + .onClick(() => { + text.commonAttribute.translate({ x: 150, y: -50 }) + }) + return text; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0550 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface056.ets new file mode 100644 index 0000000000000000000000000000000000000000..9be0aec338b3076b2c072a03155577ad44255a40 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface056.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class NodeController056 extends NodeController { + private rootNode: FrameNode | null = null; + private renderGroupValue: boolean = false; + + constructor(mRenderGroupValue: boolean) { + super(); + this.renderGroupValue = mRenderGroupValue + } + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + + let col = typeNode.createNode(uiContext, 'Row'); + col.initialize() + .backgroundColor(Color.Black) + .width(200) + .height(200) + .justifyContent(FlexAlign.Center) + .opacity(1) + node.appendChild(col); + let col2 = typeNode.createNode(uiContext, 'Row'); + console.log("zxx renderGroupValue=="+this.renderGroupValue) + col2.initialize() + .backgroundColor(Color.White) + .width(150) + .height(150) + .justifyContent(FlexAlign.Center) + .opacity(0.6) + .renderGroup(this.renderGroupValue) + col.appendChild(col2); + + let col3 = typeNode.createNode(uiContext, 'Row'); + col3.initialize() + .backgroundColor(Color.Black) + .width(100) + .height(100) + .opacity(1) + col2.appendChild(col3); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface056 { + + private mNodeController056: NodeController056 = new NodeController056(true); + private mNodeController0561: NodeController056 = new NodeController056(false); + + build() { + Column() { + NodeContainer(this.mNodeController056) + NodeContainer(this.mNodeController0561) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + } + + +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0570.ets new file mode 100644 index 0000000000000000000000000000000000000000..da64dc95f8ed6a4c464473705f1c4b71bdc1d008 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0570.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .hueRotate(180) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0570 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0580.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd77ab789a2b0bb9ce118ca08fe65b294ffefb28 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0580.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let img = typeNode.createNode(uiContext, 'Image'); + img.initialize('cat.jpg') + img.attribute.width('90%').height(30); + img.commonAttribute.sepia(0.8) + this.rootNode.appendChild(img); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface059.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface059.ets new file mode 100644 index 0000000000000000000000000000000000000000..2debefc5efcccc6968c044fbd58197741ed097df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface059.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(200) + .backgroundColor(Color.Pink) + .saturate(10) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 5 }) + .width('100%').height('100%').margin({ top: 5 }); + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello").fontColor(Color.Blue).fontSize(14); + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface059 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0600.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e0472649e4e9cfce0f3f582c165af92069fa3b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0600.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .colorBlend(Color.Blue) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0600 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0610.ets new file mode 100644 index 0000000000000000000000000000000000000000..f76d34fc7e89c08f00b9b2e611d801412e08379d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0610.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .grayscale(100) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0610 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0620.ets new file mode 100644 index 0000000000000000000000000000000000000000..0312e34f65ef6f5c96f42c74011ec52ee6db0a0b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0620.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .contrast(0.5) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0620 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0630.ets new file mode 100644 index 0000000000000000000000000000000000000000..99c26c6c59561afdff4cfa3aa67658793c86b266 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0630.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .brightness(0.8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderStyle(BorderStyle.Dotted) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0630 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0640.ets new file mode 100644 index 0000000000000000000000000000000000000000..06910a3e03d52f99cb3be5bb213da5eaafaf5a19 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0640.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.width(50) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0640") + .height(50) + .backgroundColor(Color.Red) + .transition(TransitionEffect.OPACITY.animation({ duration: 2000, curve: Curve.Ease }).combine( + TransitionEffect.rotate({ z: 1, angle: 180 }).combine( + TransitionEffect.translate({x:200})))) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0640 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0650.ets new file mode 100644 index 0000000000000000000000000000000000000000..135d2b19f19f6a724513a2fa4526ed6577109246 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0650.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .focusable(true) + .focusOnTouch(true) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0650 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0660.ets new file mode 100644 index 0000000000000000000000000000000000000000..55ce1d2776550b00dfcf0071e2dc819413349899 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0660.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .groupDefaultFocus(true) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0660 { + private myNodeController: MyNodeController = new MyNodeController(); + private myNodeController1: MyNodeController = new MyNodeController(); + + build() { + Column(){ + GridContainer(){ + Row() { + NodeContainer(this.myNodeController).tabIndex(1) + NodeContainer(this.myNodeController1).tabIndex(2) + }.padding(20) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0670.ets new file mode 100644 index 0000000000000000000000000000000000000000..515fa6167d3494a82082aeeb87f103c595df7ad9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0670.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .defaultFocus(true) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0670 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface068.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface068.ets new file mode 100644 index 0000000000000000000000000000000000000000..205856eb85f37d18b437ba96d60883ed71425f80 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface068.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class NodeController068 extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100).height(50) + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 5 }) + .width('100%').height('100%').margin({ top: 5 }); + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Button'); + text.initialize("this is no set tabIndex").fontColor(Color.Blue).fontSize(14); + col.appendChild(text); + + let text2 = typeNode.createNode(uiContext, 'Button'); + text2.initialize("this is set tabIndex").fontColor(Color.Blue).fontSize(14).tabIndex(1); + col.appendChild(text2); + + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface068 { + private mNodeController068: NodeController068 = new NodeController068(); + + build() { + Column({space:30}) { + NodeContainer(this.mNodeController068) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0690.ets new file mode 100644 index 0000000000000000000000000000000000000000..c30f289e4912c4c31ce2866a36a8ac8a9e99f880 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0690.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .focusable(true) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0690 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController).focusable(true) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0700.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c7b5f5705a1fab35cbcc86fa91f1141a4f9d771 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0700.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface0700_001') + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .hoverEffect(HoverEffect.Scale) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0700 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0710.ets new file mode 100644 index 0000000000000000000000000000000000000000..c52b70620cba1ff82bfb5ccdad52400008d6a8ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0710.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Gray) + .backgroundColor(Color.Red) + .foregroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0710 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface072.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface072.ets new file mode 100644 index 0000000000000000000000000000000000000000..d74ceaeca2d64dbcffe0cafd257c9612cca81f29 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface072.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("borderImage") + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .borderImage({ + source: { + angle: 90, + direction: GradientDirection.Left, + colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]] + }, + slice: { + top: 10, + bottom: 10, + left: 10, + right: 10 + }, + width: { + top: "10px", + bottom: "10px", + left: "10px", + right: "10px" + }, + repeat: RepeatMode.Stretch, + fill: false + }) + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface072 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface073.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface073.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed2f250361bf32a09e94877bdcf97008dfa99645 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface073.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("borderColor") + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .border({ + width: 5, + style: BorderStyle.Dotted + }) + .borderColor(0xAFEEEE) + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface073 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0740.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e8162adcbb2adaccb0238032d20eea713dc60ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0740.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Gray) + .borderWidth(8) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0740 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0750.ets new file mode 100644 index 0000000000000000000000000000000000000000..2bd271653327c087834d4a47f2d297f4f0aef96e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0750.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Gray) + .borderStyle(BorderStyle.Dotted) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0750 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface076.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface076.ets new file mode 100644 index 0000000000000000000000000000000000000000..54b06354c35be68fd528ae02b20f49d507b32d37 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface076.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .backgroundColor(Color.Pink); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("border") + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .border({ + width: 5, + color: 0x317AF7, + radius: 10, + style: BorderStyle.Dotted + }) + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface076 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0770.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b562a7c89209e012c7ace1c6df9af03183d4253 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0770.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .foregroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.DARK, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 }) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0770 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface078.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface078.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e4c3ee5690d39113a7a00fc8981b699cac6e5d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface078.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .width(200) + .height(50) + .fontSize(14) + .backgroundImage('cat.jpg'); + flex.appendChild(text); + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("backgroundBlurStyle") + .fontColor(Color.Black) + .fontSize(14) + .margin({ left: 15 }) + .backgroundBlurStyle(BlurStyle.Thin) + .width(200) + .height(50) + .backgroundImage('cat.jpg'); + flex.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface078 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface079.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface079.ets new file mode 100644 index 0000000000000000000000000000000000000000..c9ce71f65d11210b69768a7863672116a1b664e9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface079.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("backgroundImagePosition") + .fontColor(Color.Black) + .width(200) + .height(100) + .fontSize(14) + .backgroundImage('cat.jpg') + .backgroundColor(Color.Yellow) + .backgroundImagePosition({ x: 10, y: 10 }); + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface079 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface080.ets new file mode 100644 index 0000000000000000000000000000000000000000..78ee2b028024e8a83d4e7c462ab532572c8d2c52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface080.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("backgroundImageSize") + .fontColor(Color.Black) + .width(200) + .height(100) + .fontSize(14) + .backgroundImage('cat.jpg') + .backgroundColor(Color.Yellow) + .backgroundImageSize({ width: 100, height: 50 }); + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface080 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface081.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface081.ets new file mode 100644 index 0000000000000000000000000000000000000000..834075e2213fed48f2454ab9e9ca8135d30b89bf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface081.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .width(200) + .height(50) + .fontSize(14) + .backgroundImage('cat.jpg'); + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface081 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0820.ets new file mode 100644 index 0000000000000000000000000000000000000000..78f5d7ad98ca93d12b6b4a585f10bf54360500e9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0820.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 { RenderNode, FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(300) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .margin({ left: 10 }); + + let col = typeNode.createNode(uiContext, 'Row'); + col.initialize({ space: 5 }) + .width('100%').height('100%').margin({ top: 5 }); + this.rootNode.appendChild(col); + let text = typeNode.createNode(uiContext, 'Text'); + text.commonAttribute.layoutWeight(1).backgroundColor(Color.White) + text.initialize("Hello").fontColor(Color.Blue).fontSize(14); + col.appendChild(text); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0820 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0830.ets new file mode 100644 index 0000000000000000000000000000000000000000..4cbf52ffa07d8c9702cf495c11ad192f7b84cffc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0830.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 { RenderNode, FrameNode, NodeController, promptAction } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface0830_001') + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .hitTestBehavior(HitTestMode.None) + .borderWidth(1) + .onTouch((event) => { + promptAction.showToast({message:'onTouch'}) + }) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0830 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0840.ets new file mode 100644 index 0000000000000000000000000000000000000000..871219e8171d7e1b67557357bb0136dc6b338ab9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0840.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .constraintSize({maxWidth:50}) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0840 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface085.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface085.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e9cd1ca58f06e0f1da1def205e39773a9eb408e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface085.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 {FrameNode, NodeController } from '@kit.ArkUI'; + +class NodeController085 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.backgroundColor(0XFFFF0000).size({ width: 100, height: 100 }) + + //const renderNode = this.rootNode.getRenderNode(); + // if (renderNode !== null) { + // renderNode.size = { width: 100, height: 100 }; + // renderNode.backgroundColor = 0XFFFF0000; + // } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface085 { + private mNodeController085: NodeController085 = new NodeController085(); + + build() { + Row() { + NodeContainer(this.mNodeController085) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface086.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface086.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ff218398048a0c847317578055ad4a474dc6c35 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface086.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 { NodeController, FrameNode, BuilderNode ,promptAction} from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text("{x:0,y:0,width:'50%',height:'100%'}") + // 热区宽度为按钮的一半,点击右侧无响应 + Button("responseRegion") + .id("click086") + .responseRegion( { x: 0, y: 0, width: '50%', height: '100%' } ) + .onClick(() => { + promptAction.showToast({ + message: '您点击了左侧宽度一半区域', + duration: 2000 + }); + }) + } + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController086 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface086 { + private mNodeController086: NodeController086 = new NodeController086(); + + build() { + Column() { + NodeContainer(this.mNodeController086) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0860.ets new file mode 100644 index 0000000000000000000000000000000000000000..738e1bfaa02eebc91b274405e272d6e51cc51c9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0860.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + this.rootNode.commonAttribute + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0860") + .width(300) + .height(300) + .backgroundColor(Color.Red) + .responseRegion({ + x: 0, + y: 0, + width: '50%', + height: '100%' + }) + .onClick(() => { + if (rootRenderNode) { + rootRenderNode.size = { width: 200, height: 200 }; + } + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0860 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0870.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0870.ets new file mode 100644 index 0000000000000000000000000000000000000000..30a21c9480388360f4eeac6605735535b2eec754 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0870.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .borderWidth(1) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0870 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0880.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0880.ets new file mode 100644 index 0000000000000000000000000000000000000000..48b9cbfb463985622a765990d5d8b14ec98874e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0880.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .height(50) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0880 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0890.ets new file mode 100644 index 0000000000000000000000000000000000000000..e0e172cb5553b10fbb168207c72d1663d7154965 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0890.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 { FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.width(200); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0910.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0910.ets new file mode 100644 index 0000000000000000000000000000000000000000..aebffb733cec4f77c286b44a5b772ccc033509ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0910.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize('变化范围百分比([0%,100%])') + text.attribute.width('60%').fontColor(Color.Black) + text.commonAttribute.sphericalEffect(0.5) + this.rootNode.appendChild(text); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0920.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0920.ets new file mode 100644 index 0000000000000000000000000000000000000000..17ebfc87cf6a8cbd2c7fd1505d6a3a140d793e4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0920.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize('This is the text content with letterSpacing 0. and lightUpEffect with 0.6') + text.attribute + .width('50%') + .letterSpacing(0) + .padding(10) + text.commonAttribute.lightUpEffect(0.6) + this.rootNode.appendChild(text); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0930.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0930.ets new file mode 100644 index 0000000000000000000000000000000000000000..b22374676b065d87fa99ba95624242bacf5db889 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0930.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('this is BuilderNode') + .letterSpacing(0) + .fontSize(12) + .border({ width: 1 }) + .width(100) + .height(100) + .pixelStretchEffect({ + top: 10, + left: 10, + right: 10, + bottom: 10 + }) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0930 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0940.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0940.ets new file mode 100644 index 0000000000000000000000000000000000000000..f030c06083f14c94cb6b712c85f953a1b69f075d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0940.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let image = typeNode.createNode(uiContext, 'Image'); + image.initialize("cat.jpg") + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0940") + .width(150) + .height(150) + .backgroundImageSize({ width: 150, height: 150 }) + .onClick(() => { + image.commonAttribute.linearGradientBlur(60, + { fractionStops: [[0, 0], [0, 0.33], [1, 0.66], [1, 1]], direction: GradientDirection.Bottom }); + }); + return image; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0940 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0960.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0960.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a18dd3e39fbb4fb5e4397527c59b66b227c8d5c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0960.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface0960") + .width(300) + .height(300) + .backgroundColor(Color.Red) + .linearGradient({ + angle: 90, + colors: [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]] + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0960 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface097.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface097.ets new file mode 100644 index 0000000000000000000000000000000000000000..d1f0e38e6abdf1b3eecb756bddce46b144cf6c9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface097.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 {FrameNode, NodeController } from '@kit.ArkUI'; + +class NodeController097 extends NodeController { + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100).visibility(Visibility.Hidden) + .height(50) + .backgroundColor(Color.Yellow) + .borderWidth(1) + .margin({ left: 10 }); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface097 { + private mNodeController097: NodeController097 = new NodeController097(); + + build() { + Row() { + NodeContainer(this.mNodeController097) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0980.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c45c51339e7d6428e97e6c4bf484b96b3e5f547 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0980.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Gray) + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface0980 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface099.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface099.ets new file mode 100644 index 0000000000000000000000000000000000000000..763f45a99dfcda3a64bd1461fe6e21937486bb03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface099.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController099 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.width(250).height(50).backgroundColor(0xAFEEEE).opacity(0.2) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface099 { + private mNodeController099: NodeController099 = new NodeController099(); + + build() { + Row() { + NodeContainer(this.mNodeController099) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface100.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b2b0aa47a74700ca2083b7fb9f49cf759c06e14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface100.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(300) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let flex = typeNode.createNode(uiContext, 'Flex'); + flex.initialize({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) + .width(600) + .height(200) + .margin({ top: 5 }) + .backgroundColor(Color.Blue); + node.appendChild(flex); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .fontColor(Color.Black) + .width(200) + .height(50) + .fontSize(14) + .backgroundColor(Color.Yellow); + flex.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface100 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface101.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface101.ets new file mode 100644 index 0000000000000000000000000000000000000000..af313a72bf607350b23ece59ca110bd28aafc1c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface101.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class NodeController101 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.width(50).height(50).margin(350).backgroundColor(0XFFFF0000) + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface101 { + private mNodeController101: NodeController101 = new NodeController101(); + + build() { + Row() { + NodeContainer(this.mNodeController101) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1020.ets new file mode 100644 index 0000000000000000000000000000000000000000..6286ee9dbfa2d864ddc10f449bd5b230d39cfd05 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1020.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 { FrameNode, NodeController, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .width(200) + .height(200) + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize('给Text设置padding属性') + text.attribute + .height(80).backgroundColor(Color.Orange) + text.commonAttribute.padding({ + top: 50 + }) + this.rootNode.appendChild(text); + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface103.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface103.ets new file mode 100644 index 0000000000000000000000000000000000000000..5cce0adcec18e8957d592466f7201cac6433d235 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface103.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 { FrameNode, NodeController, typeNode, UIContext } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(600) + .height(600) + .backgroundColor(Color.Pink) + .margin({ left: 10 }); + let row = typeNode.createNode(uiContext, 'Row'); + row.initialize() + .width(600) + .height(600) + .margin({ top: 5 }) + .blendMode(BlendMode.OVERLAY, BlendApplyType.OFFSCREEN) + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Pink); + node.appendChild(row); + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("hello") + .fontColor(Color.Black) + .width(200) + .height(200) + .position({ x: 50, y: 50 }) + .fontSize(14) + .backgroundColor(Color.Green) + let text2 = typeNode.createNode(uiContext, 'Text'); + text2.initialize("test") + .fontColor(Color.Black) + .width(100) + .height(100) + .fontSize(14) + .position({ x: 150, y: 50 }) + .backgroundColor(Color.Blue) + row.appendChild(text); + row.appendChild(text2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface103 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1040.ets new file mode 100644 index 0000000000000000000000000000000000000000..48cecedbcfde2b464818d6d9e66b73ad2c3ad70f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1040.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootNode.commonAttribute.width(100) + .height(50) + .borderRadius(8) + .borderColor(Color.Orange) + .backgroundColor(Color.Red) + .key('UIComponentSpecialComponentsFrameNodeAttributeInterface1040_001') + .borderWidth(1) + .margin({ left: 10 }); + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1040 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface106.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface106.ets new file mode 100644 index 0000000000000000000000000000000000000000..af3c7bb0bec5e3fdc169e055bac9352b83514d8d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface106.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, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Column() { + Text("this isBuilderNode") + .fontWeight(FontWeight.Bold) + .fontSize(10) + .fontColor(Color.White) + } + .justifyContent(FlexAlign.Center) + .width(150) + .height(150) + .borderRadius(10) + .backgroundColor(0xf56c6c) + .shadow({ radius: 300, color: Color.Yellow, offsetX: 0, offsetY: 0 }) + + Column() { + Text("this isBuilderNode") + .fontWeight(FontWeight.Bold) + .fontSize(10) + .fontColor(Color.White) + } + .justifyContent(FlexAlign.Center) + .width(150) + .height(150) + .backgroundColor(0x67C23A) + .borderRadius(10) + .translate({ y: -50}) + .shadow({ radius: 220, color: Color.Blue, offsetX: 0, offsetY: 0 }) + + }.width('100%').height('100%').justifyContent(FlexAlign.Center).margin({ top: 5 }).useShadowBatching(true) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController106 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface106 { + private mNodeController106: NodeController106 = new NodeController106(); + + build() { + Column() { + NodeContainer(this.mNodeController106) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1070.ets new file mode 100644 index 0000000000000000000000000000000000000000..fce04d23023b75b67df86f04dae10cfa8f088f23 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1070.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct OutlineTextComponent { + + build() { + Stack() { + Text('设置元素的外描边圆角半径') + .width(120) + .height(120) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Orange) + .fontSize(16) + .outlineStyle(OutlineStyle.DASHED) + .outlineColor(0xAFEEEE) + .outlineWidth(5) + .outlineRadius(10) + } + .alignContent(Alignment.Center) + .width("100%") + .height("100%") + } +} + +@Builder +function buildComponent() { + OutlineTextComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface108.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface108.ets new file mode 100644 index 0000000000000000000000000000000000000000..8e219730b7288f2dba947613f563baa058e21e16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface108.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('this is BuilderNode') + .backgroundColor(Color.Pink) + .outlineWidth(5).outlineColor(0x317AF7).outlineRadius(10) + .width(120).height(120).textAlign(TextAlign.Center).fontSize(16) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController108 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface108 { + private mNodeController108: NodeController108 = new NodeController108(); + + build() { + Column() { + NodeContainer(this.mNodeController108) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1090.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a8fcc39d6453333d7ebe608dafc0ce5bac6829f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1090.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct OutlineTextComponent { + + build() { + Stack() { + Text('设置元素的外描边宽度') + .width(120) + .height(120) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Orange) + .fontSize(16) + .outlineStyle(OutlineStyle.DASHED) + .outlineColor(0xAFEEEE) + .outlineWidth(10) + } + .alignContent(Alignment.Center) + .width("100%") + .height("100%") + } +} + +@Builder +function buildComponent() { + OutlineTextComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface110.ets new file mode 100644 index 0000000000000000000000000000000000000000..fc5aa6d94e204c2af71305546420be9064a030fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface110.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('this is BuilderNode') + .backgroundColor(Color.Pink) + .outlineStyle(OutlineStyle.DASHED).outlineWidth(5).outlineColor(0x317AF7).outlineRadius(10) + .width(120).height(120).textAlign(TextAlign.Center).fontSize(16) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController110 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface110 { + private mNodeController110: NodeController110 = new NodeController110(); + + build() { + Column() { + NodeContainer(this.mNodeController110) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface111.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface111.ets new file mode 100644 index 0000000000000000000000000000000000000000..7694f647fec8fe291c560e2c4c0c2f012ba47e8f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface111.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + .outline({ width: 5, color: 0x317AF7, radius: 10, style: OutlineStyle.DOTTED }) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController111 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface111 { + private mNodeController111: NodeController111 = new NodeController111(); + + build() { + Column() { + NodeContainer(this.mNodeController111) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface112.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface112.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ee48097bd8dfc5528f131ba5d6f2f1235e94d6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface112.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('Hello') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .textAlign(TextAlign.Center) + Text('backgroundBrightness') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .margin({ left: 15 }) + .backgroundBrightness({ rate: 0.5, lightUpDegree: 0.5 }) + .textAlign(TextAlign.Center) + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface112 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1130.ets new file mode 100644 index 0000000000000000000000000000000000000000..c5b594b524cbd0330c8bd486684896aa318a713b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1130.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .draggable(true) + .onDragStart(()=>{}) + .dragPreviewOptions({ mode: [ DragPreviewMode.ENABLE_DEFAULT_SHADOW, DragPreviewMode.ENABLE_DEFAULT_RADIUS ] }) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1130 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface114.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface114.ets new file mode 100644 index 0000000000000000000000000000000000000000..e52e3c4ab18aed0cadff107a505072410765d272 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface114.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('no aspectRatio,height:70') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .textAlign(TextAlign.Center) + Text('backdropBlur') + .width(200) + .height(70) + .backdropBlur(30) + .margin({ left: 15 }) + .textAlign(TextAlign.Center) + .backgroundImage('cat.jpg'); + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface114 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface115.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface115.ets new file mode 100644 index 0000000000000000000000000000000000000000..f5a874dc5b5de06aed99766d2b0296b528d1c7ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface115.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('Hello') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .textAlign(TextAlign.Center) + Text('blur') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .margin({ left: 15 }) + .blur(3) + .textAlign(TextAlign.Center) + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface115 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface116.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface116.ets new file mode 100644 index 0000000000000000000000000000000000000000..f78d117a5da646f8dd59e591b8c35b9850a0255a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface116.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('Hello') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .textAlign(TextAlign.Center) + Text('backgroundEffect') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .margin({ left: 15 }) + .backgroundEffect({ radius: 20, brightness: 0.6, saturation: 15 }) + .textAlign(TextAlign.Center) + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface116 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1170.ets new file mode 100644 index 0000000000000000000000000000000000000000..614f2fbc22eee484c5c8148f4fbf695fd5bd646a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1170.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .invert(45) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1170 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface118.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface118.ets new file mode 100644 index 0000000000000000000000000000000000000000..d442213c1acff4dfb206d01f868444ef47c8f362 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface118.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State message: string = 'set monopolizeEvents false' + @State messageOut: string = ' ' + @State messageInner: string = ' ' + @State monopolize: boolean = true + + build() { + Column() { + Text(this.message) + .fontSize(22) + .margin(10) + Text(this.messageOut) + .fontSize(22) + .margin(10) + Text(this.messageInner) + .fontSize(22) + .margin(10) + Button('clean') + .fontSize(22) + .margin(10) + // 通过button的点击事件来切换内层column的独占控制属性 + .onClick(()=>{ + this.messageOut = " " + this.messageInner = " " + }) + Button('change monopolizeEvents') + .fontSize(22) + .margin(10) + // 通过button的点击事件来切换内层column的独占控制属性 + .onClick(()=>{ + this.monopolize = !this.monopolize + if (!this.monopolize) { + this.message = "set monopolizeEvents false" + } else { + this.message = "set monopolizeEvents true" + } + }) + Column() { + Column(){} + // this.monopolize是true时,点击内层column只会触发自身的触摸事件,不会触发外层column的触摸事件 + // this.monopolize是false时,点击内层column会同时触发自身的触摸事件和外层column的触摸事件 + .id("click118") + .monopolizeEvents(this.monopolize) + .width('100%') + .height('40%') + .backgroundColor(Color.Blue) + // 内层column绑定触摸事件 + .onTouch((event:TouchEvent)=>{ + if (event.type == TouchType.Down) { + console.log("inner column touch down") + this.messageInner = "inner column touch down" + } + }) + } + .backgroundColor(Color.Gray) + .height('100%') + .width('100%') + // 外层column绑定触摸事件 + .onTouch((event)=>{ + if (event.type == TouchType.Down) { + console.log("outside column touch down") + this.messageOut = "inner column touch down" + } + }) + }.width("100%").height('100%') + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController118 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface118 { + private mNodeController118: NodeController118 = new NodeController118(); + + build() { + Column() { + NodeContainer(this.mNodeController118) + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1190.ets new file mode 100644 index 0000000000000000000000000000000000000000..8734b5e35b04aacd4eb16d33b0c96955039fd690 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1190.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1190 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1200.ets new file mode 100644 index 0000000000000000000000000000000000000000..29ae5283f83119453f53b70bb89fe7ff5c71e045 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1200.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 { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State widthI: number = 150; + @State heightI: number = 30; + flag: boolean = true; + + build() { + Column() { + Text('BuilderNode') + .textAlign(TextAlign.Center) + .fontSize(12) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface1200") + .width(this.widthI) + .height(this.heightI) + .backgroundColor(Color.Yellow) + .renderFit(RenderFit.CENTER) + .onClick(() => { + animateTo({ curve: Curve.Ease }, () => { + if (this.flag) { + this.widthI = 250; + this.heightI = 60; + } else { + this.widthI = 150; + this.heightI = 30; + } + this.flag = !this.flag; + }) + }) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1200 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface121.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface121.ets new file mode 100644 index 0000000000000000000000000000000000000000..abb3821e423c1ad5f5cd42ff6d2a8092434c69b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface121.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('Text set obscured attribute').fontSize(10).fontColor(Color.Black) + Text('This is an example for text obscured attribute.') + .fontSize(30) + .width('600px') + .fontColor(Color.Black) + .border({ width: 1 }) + .obscured([ObscuredReasons.PLACEHOLDER]) + + }.width('100%').height('100%').justifyContent(FlexAlign.Center).margin({ top: 5 }).useShadowBatching(true) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController121 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface121 { + private mNodeController121: NodeController121 = new NodeController121(); + + build() { + Column() { + NodeContainer(this.mNodeController121) + }.useShadowBatching(true) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface122.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface122.ets new file mode 100644 index 0000000000000000000000000000000000000000..b92e18878bd87103d7b5333faf47502bb2f390fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface122.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface122_001') + .width(200) + .height(70) + .textAlign(TextAlign.Center) + .accessibilityLevel('yes') + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface122 { + @State message: string = "accessibilityLevel"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface123.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface123.ets new file mode 100644 index 0000000000000000000000000000000000000000..7237be9d0770b031839273509c048714acacd25a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface123.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface123_001') + .width(200) + .height(70) + .textAlign(TextAlign.Center) + .accessibilityDescription('accessibilityDescription') + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface123 { + @State message: string = "accessibilityDescription"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface124.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface124.ets new file mode 100644 index 0000000000000000000000000000000000000000..06715698a6aea3c86cb1e9159c1474764adc2637 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface124.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface124_001') + .width(200) + .height(70) + .textAlign(TextAlign.Center) + .accessibilityText('accessibilityText') + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface124 { + @State message: string = "accessibilityText"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface125.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface125.ets new file mode 100644 index 0000000000000000000000000000000000000000..f0855067952001049a1d53b595406de861bc825a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface125.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface125_001') + .width(200) + .height(70) + .textAlign(TextAlign.Center) + .accessibilityGroup(true) + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface125 { + @State message: string = "accessibilityGroup"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1260.ets new file mode 100644 index 0000000000000000000000000000000000000000..61caa31b5f2c023e29a5e9277bc815b3fcac0820 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1260.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, BuilderNode} from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State message: string = 'Hello World' + build() { + Row() { + Column({ space: 5 }) { + Text(this.message) + Button("keyboardShortcut").onClick((event: ClickEvent) => { + this.message = "I clicked Button 2"; + }).keyboardShortcut("W", [ModifierKey.CTRL],()=>{ + this.message = "keyboardShortcut Button "; + }) + } + .width('100%') + } + .height('100%') + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController126 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1260 { + private mNodeController126: NodeController126 = new NodeController126(); + + build() { + Column() { + NodeContainer(this.mNodeController126) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1280.ets new file mode 100644 index 0000000000000000000000000000000000000000..d213d7269972087345f58fe9e3d2be9d4efded52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1280.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .geometryTransition('node') + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1280 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1290.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c5b5335d5d64038c33ef7ba8fd215f1e4c7f166 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1290.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface1290_001') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1290 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface130.ets new file mode 100644 index 0000000000000000000000000000000000000000..b324b6ac6d77cac9a9776d2565726cc7dfda13db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface130.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode,typeNode } from '@kit.ArkUI'; + +let messageOut: string = ' ' +let messageInner: string = ' ' +class NodeController130 extends NodeController { + + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(300) + .height(300) + .borderColor(Color.Black) + .margin({left:80,top:30}) + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize().backgroundColor(Color.Red) + .width('200').height('200').onTouch((event:TouchEvent)=>{ + if (event.type == TouchType.Down) { + console.log("inner column touch down 1") + messageInner = "inner column touch down" + } + }) + node.appendChild(col); + let col2 = typeNode.createNode(uiContext, 'Column'); + col2.initialize().width('100').height('100').monopolizeEvents(true).backgroundColor(Color.Blue).onTouch((event:TouchEvent)=>{ + if (event.type == TouchType.Down) { + console.log("inner column touch down 2") + messageOut = "outside column touch down" + } + }) + col.appendChild(col2); + return node; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface130 { + private mNodeController130: NodeController130 = new NodeController130(); + @State mMessageOut: string = ' ' + @State mMessageInner: string = ' ' + build() { + Column() { + Button("获取monopolizeEvents状态") + .id("click130") + .onClick(() => { + this.mMessageOut = messageOut + this.mMessageInner = messageInner + }) + Text(this.mMessageOut) + Text(this.mMessageInner) + Column(){ + NodeContainer(this.mNodeController130) + } + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1300.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8ab5aa7b282b66a19000a3b98c31cbf75f6d24a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1300.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct ProgressMaskComponent { + + progress: ProgressMask = new ProgressMask(55.0, 100.0, Color.Gray); + + build() { + Stack() { + Image('cat.jpg') + .width(200) + .height(200) + .mask(this.progress) + } + .alignContent(Alignment.Center) + .width("100%") + .height("100%") + } +} + +@Builder +function buildComponent() { + ProgressMaskComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1310.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ce526e9a64af4f65daa9c01ee4a83720bd4e2d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1310.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, ShapeClip, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .clip(true) + .clipShape(new Circle({ width: 50, height: 50 })) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1310 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1320.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b6a69a7baebebfe0f1bce16993d81eab59547f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1320.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('this is BuilderNode') + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface1320") + .backgroundColor(Color.Yellow) + .width(120) + .height(120) + .textAlign(TextAlign.Center) + .fontSize(16) + .shadow({ + radius: 10, + color: Color.Green, + offsetX: 20, + offsetY: 20 + }) + + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1320 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface133.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface133.ets new file mode 100644 index 0000000000000000000000000000000000000000..348f185d1f6af167ba7e0c1bff6305ac49e6381a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface133.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, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State toggle: boolean = true + + build() { + Column() { + Button('This is a BuilderNode.') + .id("button133") + .fontSize(16) + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + .onClick(() => { + animateTo({ duration: 4000, curve: Curve.Linear }, () => { + this.toggle = !this.toggle // 通过this.toggle变化组件的位置 + }) + }) + }.width('100%').height('100%').alignItems(this.toggle ? HorizontalAlign.Start : HorizontalAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController133 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.frame = { x: 10, y: 10, width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface133 { + private mNodeController133: NodeController133 = new NodeController133(); + + build() { + Column() { + NodeContainer(this.mNodeController133) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1340.ets new file mode 100644 index 0000000000000000000000000000000000000000..44d0a271b5a1639c3b3e44daf21c23137d8243e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1340.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct RadialGradientComponent { + + build() { + Row() + .width(200) + .height(100) + .radialGradient({ + center: [100, 50], + radius: 60, + colors: [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]] + }) + .overlay() + } +} + +@Builder +function buildComponent() { + RadialGradientComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface135.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface135.ets new file mode 100644 index 0000000000000000000000000000000000000000..b8e93ac4ee93057d9555d1e37e9f07000a179b10 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface135.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('this is BuilderNode') + .backgroundColor(Color.Pink) + .sweepGradient({ + center: [50, 50], + start: 0, + end: 359, + colors: [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]] + }) + .width(150).height(150) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController135 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface135 { + private mNodeController135: NodeController135 = new NodeController135(); + + build() { + Column() { + NodeContainer(this.mNodeController135) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1360.ets new file mode 100644 index 0000000000000000000000000000000000000000..febf8e0921a34aea20a34f4c0049389901e22676 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1360.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct OverlayComponent { + + build() { + Column() { + Text('下面的文字') + Image('cat.jpg') + .width(200) + .height(200) + .overlay('这是在照片上增加遮罩文本', { + align: Alignment.Bottom, + offset: { x: 0, y: -50} + }) + } + } +} + +@Builder +function buildComponent() { + OverlayComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1370.ets new file mode 100644 index 0000000000000000000000000000000000000000..69462b06fed864cb38c2cb694fb0242de02d0dfa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1370.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .draggable(true) + .onDragStart(()=>{}) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1370 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface138.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface138.ets new file mode 100644 index 0000000000000000000000000000000000000000..5503d7a925c5e3eb2b0a22a93b583562fc210d7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface138.ets @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; +import { uniformTypeDescriptor } from '@kit.ArkData'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface138_001') + .width(100) + .height(70) + .textAlign(TextAlign.Center) + .draggable(true) + .copyOption(CopyOptions.InApp) + + TextArea({ + placeholder: 'input your word...' + }) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface138_002') + .placeholderFont({ size: 16, weight: 400 }) + .width(236) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + // .id('UIComponentSpecialComponentsFrameNodeAttributeInterface138_001') + // .draggable(true) + // .allowDrop([uniformTypeDescriptor.UniformDataType.TEXT]) + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface138 { + @State message: string = "allowDrop"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1390.ets new file mode 100644 index 0000000000000000000000000000000000000000..4cdd75a84848576c8f6c0b803ce8d955ce9c6992 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1390.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .clickEffect({level:ClickEffectLevel.LIGHT}) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1390 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface140.ets new file mode 100644 index 0000000000000000000000000000000000000000..19e30e6c5abf5be0dacc40eeb44d4be83fcdf13b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface140.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('no aspectRatio,height:70') + .width(200) + .height(70) + .backgroundColor(0xF5DEB3) + .textAlign(TextAlign.Center) + Text('aspectRatio') + .width(200) + .height(70) + .aspectRatio(2) + .backgroundColor(0xD2B48C) + .textAlign(TextAlign.Center) + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface140 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface141.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface141.ets new file mode 100644 index 0000000000000000000000000000000000000000..debccec4b4708eeb617a8b52cff620a10ee7aaf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface141.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES 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, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + RelativeContainer() { + Text(params.text) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface141_text1') + .fontSize(25) + .fontWeight(FontWeight.Bold) + .backgroundColor(Color.Pink) + .alignRules({ + top: { anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface141_RelativeContainer001', align: VerticalAlign.Top }, + left: { anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface141_RelativeContainer001', align: HorizontalAlign.Start } + }) + + Text('test') + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface141_text2') + .fontSize(25) + .fontWeight(FontWeight.Bold) + .backgroundColor(Color.Yellow) + .alignRules({ + top: { anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface141_text1', align: VerticalAlign.Bottom }, + left: { anchor: 'UIComponentSpecialComponentsFrameNodeAttributeInterface141_text1', align: HorizontalAlign.End } + }) + } + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface141_RelativeContainer001') + .backgroundColor(Color.Green) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 150 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface141 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1420.ets new file mode 100644 index 0000000000000000000000000000000000000000..232044c876a376fade8d4fcd869303494b8e4deb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1420.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 { RenderNode, FrameNode, NodeController, promptAction, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .enabled(false) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + promptAction.showToast({message:"enable: false"}) + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1420 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1430.ets new file mode 100644 index 0000000000000000000000000000000000000000..62088f586bee265bc1c309f93c7487228bf83da8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1430.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 { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State x: number = 0; + @State y: number = 0; + flag: boolean = true; + + build() { + Column() { + Text('BuilderNode') + .textAlign(TextAlign.Center) + .fontSize(26) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface1430") + .width(150) + .height(150) + .backgroundColor(Color.Green) + .offset({ x: this.x, y: this.y }) + .onClick(() => { + if (this.flag) { + this.x = 200 + } else { + this.x = 0 + } + this.flag = !this.flag; + }) + }.width('100%').height('100%') + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1430 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface144.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface144.ets new file mode 100644 index 0000000000000000000000000000000000000000..179d8dc033db308cd4e3860b96f26fd98f100ec3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface144.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + .markAnchor({ x: -100, y: -25 }) + } + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.frame = { x: 10, y: 10, width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface144 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface145.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface145.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c35052e995382f14c9e90a7f01139d7775e525d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface145.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 { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode position.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + .position({ x: 130, y: 10 }) + }.width("300").height("300") + .backgroundColor(Color.Yellow) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController145 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000 + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface145 { + private mNodeController145: NodeController145 = new NodeController145(); + + build() { + Column() { + NodeContainer(this.mNodeController145) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface146.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface146.ets new file mode 100644 index 0000000000000000000000000000000000000000..06f9ad1642c76b86120345ad295dde320348d869 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface146.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Text(params.text) + .fontSize(25) + .fontWeight(FontWeight.Bold) + .align(Alignment.TopEnd) + .backgroundColor(Color.Pink) + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 150 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface146 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1470.ets new file mode 100644 index 0000000000000000000000000000000000000000..fbae42b013f60696dd34201a320c0582d90ca890 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1470.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .direction(Direction.Rtl) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1470 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface148.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface148.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ea911a0f0423b866a0c627c8b146b9d02bbe118 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface148.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, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State active: boolean = false + + build() { + Column() { + Navigator({ target: 'testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterfaceSharedTransition', type: NavigationType.Push }) { + Image($r('app.media.cat')).width(50).height(50) + .sharedTransition('sharedImage', { duration: 800, curve: Curve.Linear, delay: 100 }) + }.padding({ left: 20, top: 20 }) + .id("click148") + .onClick(() => { + console.log("zxx onClick") + this.active = true + }) + } + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.frame = { x: 10, y: 10, width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface148 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface149.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface149.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a390bc7a48789282cc6df99a441ec39f1ee0013 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface149.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Column() { + Text("this isBuilderNode") + .fontWeight(FontWeight.Bold) + .fontSize(10) + .fontColor(Color.White) + } + .justifyContent(FlexAlign.Center) + .width(150) + .height(150) + .borderRadius(10) + .backgroundColor(0xf56c6c) + .shadow({ radius: 300, color: Color.Yellow, offsetX: 0, offsetY: 0 }) + .zIndex(2) + Column() { + Text("this isBuilderNode") + .fontWeight(FontWeight.Bold) + .fontSize(10) + .fontColor(Color.White) + } + .justifyContent(FlexAlign.Center) + .width(150) + .height(150) + .backgroundColor(0x67C23A) + .borderRadius(10) + .translate({ y: -50}) + .shadow({ radius: 220, color: Color.Blue, offsetX: 0, offsetY: 0 }) + .zIndex(1) + + }.width('100%').height('100%').justifyContent(FlexAlign.Center).margin({ top: 5 }).useShadowBatching(true) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController149 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface149 { + private mNodeController149: NodeController149 = new NodeController149(); + + build() { + Column() { + NodeContainer(this.mNodeController149) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1500.ets new file mode 100644 index 0000000000000000000000000000000000000000..585395b7cee6c6e5c15be07e7ccad9797f2e9a7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1500.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .displayPriority(2) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1500 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface151.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface151.ets new file mode 100644 index 0000000000000000000000000000000000000000..3d6b3c859845fb5d9cfd529b06f11e6b2f8a462a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface151.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('no alignSelf,height:50') + .width('33%') + .height(50) + .backgroundColor(0xF5DEB3) + .textAlign(TextAlign.Center) + Text('alignSelf End') + .alignSelf(ItemAlign.End) + .width('33%') + .height(50) + .backgroundColor(0xD2B48C) + .textAlign(TextAlign.Center) + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface151 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1520.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c3a5f30feaeec3e2048977a48903d1a56a6eefa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1520.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .flexBasis(100) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1520 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1530.ets new file mode 100644 index 0000000000000000000000000000000000000000..57b03d7171ced91c6e09debcc77f7e33624ee669 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1530.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .flexShrink(10) + .borderWidth(2) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1530 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1540.ets new file mode 100644 index 0000000000000000000000000000000000000000..a95c70a562a50e7a724b53155496b2298e1b16d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1540.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .flexGrow(1) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1540 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.width('100%').padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1550.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b535a0314dad0a35c21f8e1ba38a69f30b9815f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1550.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 { NodeController, FrameNode, BuilderNode, matrix4 } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('this is BuilderNode') + .backgroundColor(Color.Yellow) + .width(120) + .height(120) + .textAlign(TextAlign.Center) + .fontSize(16) + .transform(matrix4.identity().translate({ x: 50, y: 50 }).scale({ x: 1.5, y: 1 }).rotate({ + x: 0, + y: 0, + z: 1, + angle: 60 + })) + + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1550 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1560.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b09cbcd4544535cf170b92a29a6dbe56afb82ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1560.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 { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private flag: boolean = true; + + makeNode(uiContext: UIContext): FrameNode | null { + let text = typeNode.createNode(uiContext, 'Text'); + text.initialize("Hello") + .textAlign(TextAlign.Center) + .fontSize(26) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface1560") + .width(150) + .height(150) + .backgroundColor(Color.Red) + .onClick(() => { + if (this.flag) { + text.commonAttribute.rotate({ + x: 0, + y: 0, + z: 1, + centerX: '50%', + centerY: '50%', + angle: 300 + }) + } else { + text.commonAttribute.rotate({ + x: 0, + y: 0, + z: 0, + centerX: '', + centerY: '', + angle: 0 + }) + } + this.flag = !this.flag; + }) + return text; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1560 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1570.ets new file mode 100644 index 0000000000000000000000000000000000000000..10f5e6f4bb84c586d55cb399967c581812482139 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1570.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .gridOffset(1) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1570 { + private myNodeController: MyNodeController = new MyNodeController(); + private myNodeController1: MyNodeController = new MyNodeController(); + + build() { + Column(){ + GridContainer(){ + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1580.ets new file mode 100644 index 0000000000000000000000000000000000000000..964f5ce1eaca4360bc03673093ea1ed67dd3be00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1580.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .gridSpan(5) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1580 { + private myNodeController: MyNodeController = new MyNodeController(); + private myNodeController1: MyNodeController = new MyNodeController(); + + build() { + Column(){ + GridContainer(){ + Row() { + NodeContainer(this.myNodeController) + NodeContainer(this.myNodeController1) + }.padding(20) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface159.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface159.ets new file mode 100644 index 0000000000000000000000000000000000000000..53132f7b25863d027a2357a88df432efdcc668c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface159.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 { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .backgroundColor(Color.Gray) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController159 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.frame = { x: 10, y: 10, width: 200, height: 100 }; + rootRenderNode.scale = { x: 0.5, y: 1 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface159 { + private mNodeController159: NodeController159 = new NodeController159(); + + build() { + Column() { + NodeContainer(this.mNodeController159) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1600.ets new file mode 100644 index 0000000000000000000000000000000000000000..c27271224de7b88892acf14d0c7d5231e3f61075 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1600.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State x: number = 0; + @State y: number = 0; + flag: boolean = true; + + build() { + Column() { + Text('BuilderNode') + .textAlign(TextAlign.Center) + .fontSize(26) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface1600") + .width(150) + .height(150) + .backgroundColor(Color.Green) + .translate({ x: this.x, y: this.y }) + .onClick(() => { + if (this.flag) { + this.x = 150 + this.y = -50 + } else { + this.x = 0 + this.y = 0 + } + this.flag = !this.flag; + }) + }.width('100%').height('100%') + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1600 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface161.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface161.ets new file mode 100644 index 0000000000000000000000000000000000000000..4680a9803c25d06c4a600f8eae8233282ca08152 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface161.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. + */ +// xxx.ets +@Component +struct Component1 { + @Prop renderGroupValue: boolean; + build() { + Row() { + Row() { + Row() + .backgroundColor(Color.Red) + .width(100) + .height(100) + .opacity(1) + } + .backgroundColor(Color.White) + .width(150) + .height(150) + .justifyContent(FlexAlign.Center) + .opacity(0.6) + .renderGroup(this.renderGroupValue) + } + .backgroundColor(Color.Black) + .width(200) + .height(200) + .justifyContent(FlexAlign.Center) + .opacity(1) + } +} +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface161 { + build() { + Column() { + Component1({renderGroupValue: true}) + .margin(20) + Component1({renderGroupValue: false}) + .margin(20) + } + .width("100%") + .height("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1620.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca667398a17db2d53c191a4585b4f9085718895e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1620.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .hueRotate(180) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1620 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1630.ets new file mode 100644 index 0000000000000000000000000000000000000000..728469740071ffccd578b8986f4e64c9ad327879 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1630.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct SepiaComponent { + + build() { + Column() { + Text('sepia').fontSize(15).fontColor(0xCCCCCC).width('90%') + Image('cat.jpg') + .width('90%') + .height(30) + .sepia(0.8) + } + } +} + +@Builder +function buildComponent() { + SepiaComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface164.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface164.ets new file mode 100644 index 0000000000000000000000000000000000000000..fde839601fb6e308513a2a2acadad53dfb951072 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface164.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Text(params.text) + .fontSize(25) + .fontWeight(FontWeight.Bold) + .saturate(20) + .backgroundColor(Color.Pink) + } +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 150, height: 150 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface164 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1650.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebb7ae847ee841731ab41e735cfe561dea26471d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1650.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .colorBlend(Color.Blue) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1650 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1660.ets new file mode 100644 index 0000000000000000000000000000000000000000..4040ba46826a6f1959be0e0099637ddb966014d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1660.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .grayscale(100) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1660 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1670.ets new file mode 100644 index 0000000000000000000000000000000000000000..5433dafaa842e32164adc9cbd48891db72a835da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1670.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .contrast(0.5) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1670 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1680.ets new file mode 100644 index 0000000000000000000000000000000000000000..196eb255e39e73acfc2b2cf2199898fce41128dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1680.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .brightness(0.8) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1680 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1690.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbb309b4dae4fa20014708a10b9c8bed7f4f064e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1690.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, BuilderNode, matrix4 } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('this is BuilderNode') + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface1690") + .backgroundColor(Color.Yellow) + .width(120) + .height(120) + .textAlign(TextAlign.Center) + .fontSize(16) + .transition(TransitionEffect.OPACITY.animation({ duration: 2000, curve: Curve.Ease }).combine( + TransitionEffect.rotate({ z: 1, angle: 180 }).combine( + TransitionEffect.translate({ x: 200 })))) + + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1690 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1700.ets new file mode 100644 index 0000000000000000000000000000000000000000..e70c514fe62238d6945de448ef8834704ee024db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1700.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .focusable(true) + .focusOnTouch(true) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1700 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1710.ets new file mode 100644 index 0000000000000000000000000000000000000000..aeed16bf859cb11f08709ed5b882d52d4249b922 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1710.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .groupDefaultFocus(true) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1710 { + private myNodeController: MyNodeController = new MyNodeController(); + private myNodeController1: MyNodeController = new MyNodeController(); + + build() { + Column(){ + GridContainer(){ + Row() { + NodeContainer(this.myNodeController).tabIndex(1) + NodeContainer(this.myNodeController1).tabIndex(2) + }.padding(20) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1720.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5c684e9f890d1693fe525547fd9ea912da80e76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1720.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .defaultFocus(true) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1720 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface173.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface173.ets new file mode 100644 index 0000000000000000000000000000000000000000..516d3ab7de25464080b5df7dcc9315d6804fec72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface173.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode, RenderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column({space:10}) { + Button('no set tabIndex').fontSize(20).fontColor(Color.White) + Button('set tabIndex').fontSize(20).fontColor(Color.White).tabIndex(1) + }.width('100%').height('100%').justifyContent(FlexAlign.Center).margin({ top: 5 }).useShadowBatching(true) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController173 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface173 { + private mNodeController173: NodeController173 = new NodeController173(); + + build() { + Column() { + NodeContainer(this.mNodeController173) + }.useShadowBatching(true) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1740.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc5d4533dec467fa55ec9a4eef9b5fd95617908f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1740.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .focusable(true) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1740 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController).focusable(true) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1750.ets new file mode 100644 index 0000000000000000000000000000000000000000..69da4a216d02408a9e44e46d86a0fa6fed7b6e1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1750.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .height(50) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface1750_001') + .hoverEffect(HoverEffect.Scale) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1750 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1760.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1760.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e6a8ce683a91bdf690eb9cd9521d923503fb564 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1760.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .backgroundColor(Color.Orange) + .foregroundColor(Color.Red) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1760 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface177.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface177.ets new file mode 100644 index 0000000000000000000000000000000000000000..7c79c2d10dc6b52ff76ba9579df670cf6e9bf1c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface177.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .width(200) + .height(70) + .textAlign(TextAlign.Center) + .borderImage({ + source: { + angle: 90, + direction: GradientDirection.Left, + colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]] + }, + slice: { + top: 10, + bottom: 10, + left: 10, + right: 10 + }, + width: { + top: "10px", + bottom: "10px", + left: "10px", + right: "10px" + }, + repeat: RepeatMode.Stretch, + fill: false + }) + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface177 { + @State message: string = "borderImage"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface178.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface178.ets new file mode 100644 index 0000000000000000000000000000000000000000..ccba49263f1ad61e92660aea2108c678e793ecbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface178.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .width(200) + .height(70) + .textAlign(TextAlign.Center) + .border({ + width: 5, + style: BorderStyle.Dotted + }) + .borderColor(0xAFEEEE) + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface178 { + @State message: string = "borderColor"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1790.ets new file mode 100644 index 0000000000000000000000000000000000000000..c35a50f52d5d34507cc7b984185b577a2a0547c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1790.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(8) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1790 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1800.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1800.ets new file mode 100644 index 0000000000000000000000000000000000000000..5759bafe5f12792ee9f8c5d34818ad2dab827cbe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1800.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .backgroundColor(Color.Orange) + .borderStyle(BorderStyle.Dotted) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1800 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface181.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface181.ets new file mode 100644 index 0000000000000000000000000000000000000000..bbfd12dc789c4fe2eb3ca378445625250b11865e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface181.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .width(200) + .height(70) + .textAlign(TextAlign.Center) + .border({ + width: 5, + color: 0x317AF7, + radius: 10, + style: BorderStyle.Dotted + }) + } + .backgroundColor(Color.Pink) + .height(200) + .width('100%') + } + .width('100%') + .height('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface181 { + @State message: string = "border"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1820.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1820.ets new file mode 100644 index 0000000000000000000000000000000000000000..f835a17d16cf4f3c5093085fbdfad511f495d1c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1820.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .foregroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.DARK, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 }) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1820 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface183.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface183.ets new file mode 100644 index 0000000000000000000000000000000000000000..7fa683cf86e462cebd9a8bff1743d2131a4d03b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface183.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('Hello') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .textAlign(TextAlign.Center) + Text('backgroundBlurStyle') + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .margin({ left: 15 }) + .backgroundBlurStyle(BlurStyle.Thin) + .textAlign(TextAlign.Center) + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface183 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface184.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface184.ets new file mode 100644 index 0000000000000000000000000000000000000000..f56a2ac344b16e7e3ea4a843db78c9772f05d0a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface184.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .backgroundImagePosition({ x: 10, y: 10 }) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Yellow) + } + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface184 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface185.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface185.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e6c60b1878103c486c0136c012be90caefbbe3f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface185.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .backgroundImageSize({ width: 100, height: 50 }) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Yellow) + } + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface185 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface186.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface186.ets new file mode 100644 index 0000000000000000000000000000000000000000..c9eb511bd2a8e5e03642a9ad9f57bf051d6ce374 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface186.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 { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text(params.text) + .width(200) + .height(70) + .backgroundImage('cat.jpg') + .textAlign(TextAlign.Center) + } + .backgroundColor(Color.Green) + .height(200) + .width('100%') + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface186 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1870.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1870.ets new file mode 100644 index 0000000000000000000000000000000000000000..6a00eeec41b99f51a723a73c5b0fca5a8946c002 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1870.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Row(){ + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .layoutWeight(1) + .key('UIComponentSpecialComponentsFrameNodeAttributeInterface2090_001') + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) + } +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1870 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1880.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1880.ets new file mode 100644 index 0000000000000000000000000000000000000000..0bd70f45f0d50cb5d1e5b971889a571dd151eefc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1880.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 { RenderNode, FrameNode, NodeController, BuilderNode, promptAction } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .height(50) + .id('UIComponentSpecialComponentsFrameNodeAttributeInterface1880_001') + .hitTestBehavior(HitTestMode.None) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) + .onTouch((event) => { + promptAction.showToast({message:'onTouch'}) + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1880 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1890.ets new file mode 100644 index 0000000000000000000000000000000000000000..f914cac2d4f3fc4a837dd5ea5d40cdcd21420fc8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1890.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 { RenderNode, FrameNode, NodeController, ShapeMask, borderStyles, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .constraintSize({maxWidth:50}) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1890 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface190.ets new file mode 100644 index 0000000000000000000000000000000000000000..e63ebf3d1d499036ff1df4bf82bb66488e6467bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface190.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 { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + } + .backgroundColor(Color.Gray) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController190 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface190 { + private mNodeController190: NodeController190 = new NodeController190(); + + build() { + Column() { + NodeContainer(this.mNodeController190) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface191.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface191.ets new file mode 100644 index 0000000000000000000000000000000000000000..0cc7deb3b73fa59a2263de07795d9bfa16dbfe97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface191.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 { NodeController, FrameNode ,promptAction} from '@kit.ArkUI'; + + +class NodeController191 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute.id("click191").responseRegion([ + { x: 0, y: 0, width: '50%', height: '100%' } // 第二个热区宽度为按钮的一半,点击button2左半边,点击事件生效 + ]).onClick(()=>{ + promptAction.showToast({ + message: '您点击了左侧宽度一半区域', + duration: 2000 + }); + }) + + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 200, height: 100 }; + renderNode.backgroundColor = 0xffff0000; + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface191 { + private mNodeController191: NodeController191 = new NodeController191(); + + build() { + Row() { + NodeContainer(this.mNodeController191) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1920.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1920.ets new file mode 100644 index 0000000000000000000000000000000000000000..bf8f3e9a680d1561cbd592d002cadecc6c014df9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1920.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1920 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1930.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1930.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d541ff6259aa4496a3f647e50d637e84387853d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1930.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .height(50) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1930 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1940.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1940.ets new file mode 100644 index 0000000000000000000000000000000000000000..bff407389cbf1a5ccc673e2f4f6277672692cac9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1940.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TextComponent { + + build() { + Column() { + Text('设置width') + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .backgroundColor(0xf1f3f5) + } + } +} + +@Builder +function buildComponent() { + TextComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1950.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1950.ets new file mode 100644 index 0000000000000000000000000000000000000000..2758fe2d4e3fe6d51a71569c6ae1a7560f200cc4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1950.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct UseEffectComponent { + build() { + Stack() { + EffectComponent() { + Column({ space: 20 }) { + // 使用useEffect进行模糊合并绘制,继承EffectComponent的模糊参数 + Text("Normal text with useEffect blur 1") + .textAlign(TextAlign.Center) + .useEffect(true) + .fontSize(16) + .fontWeight(FontWeight.Medium) + .borderRadius(16) + .width('90%') + .height('48') + // 使用useEffect进行模糊合并绘制,继承EffectComponent的模糊参数 + Text("Normal text with useEffect blur 2") + .textAlign(TextAlign.Center) + .useEffect(true) + .fontSize(16) + .fontWeight(FontWeight.Medium) + .borderRadius(16) + .width('90%') + .height('48') + } + } + .backgroundBlurStyle(BlurStyle.Thin) + } + .backgroundImage($r('app.media.cat')) + .backgroundImageSize({ + width: '100%', + height: '100%' + }) + .width('100%') + .height('100%') + } +} + +@Builder +function buildComponent() { + UseEffectComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1960.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1960.ets new file mode 100644 index 0000000000000000000000000000000000000000..5cc190a0015fd4cafed13ba890de5c3570b558e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1960.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TextComponent { + build() { + Stack() { + TextInput({ placeholder: "请输入变化范围百分比([0%,100%])"}) + .width('60%') + .sphericalEffect(0.5) + }.alignContent(Alignment.Center).width("100%").height("100%") + } +} + +@Builder +function buildComponent() { + TextComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1970.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1970.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f3555297069b3f13b9ee176cccd2767b3c6241a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1970.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct LightUpComponent { + + build() { + Stack() { + Text('This is the text content with letterSpacing 0. and lightUpEffect with 0.6') + .letterSpacing(0) + .padding(10) + .width('50%') + .lightUpEffect(0.6) + } + .alignContent(Alignment.Center) + .width("100%") + .height("100%") + } +} + +@Builder +function buildComponent() { + LightUpComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1980.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d28a6959183df2bfc99c212214a900c4ea44f9d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1980.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.rootNode.commonAttribute + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface1980") + .width(100) + .height(30) + .backgroundColor(Color.Red) + .border({ width: 1 }) + .pixelStretchEffect({ + top: 10, + left: 10, + right: 10, + bottom: 10 + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1980 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1990.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1990.ets new file mode 100644 index 0000000000000000000000000000000000000000..a47fe41a5bfd91b494ae97ac34936460df8d9c3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1990.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 { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + + build() { + Column() { + Image("cat.jpg") + .width(200) + .height(200) + .linearGradientBlur(60, + { fractionStops: [[0, 0], [0, 0.33], [1, 0.66], [1, 1]], direction: GradientDirection.Bottom }) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface1990 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2000.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2000.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d14fd69f7238517c6459331940f97e4877334ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2000.ets @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct UseSizeTypeComponent { + + build() { + Column() { + Text('useSizeType').fontSize(15).fontColor(0xCCCCCC).width('90%') + GridContainer() { + Row() { + Row() { + Text('Left').fontSize(25) + } + .useSizeType({ + xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, + md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } + }) + .height("100%") + .backgroundColor(0x66bbb2cb) + + Row() { + Text('Center').fontSize(25) + } + .useSizeType({ + xs: { span: 1, offset: 0 }, sm: { span: 2, offset: 1 }, + md: { span: 5, offset: 1 }, lg: { span: 7, offset: 2 } + }) + .height("100%") + .backgroundColor(0x66b6c5d1) + + Row() { + Text('Right').fontSize(25) + } + .useSizeType({ + xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 3 }, + md: { span: 2, offset: 6 }, lg: { span: 3, offset: 9 } + }) + .height("100%") + .backgroundColor(0x66bbb2cb) + } + .height(200) + + } + .backgroundColor(0xf1f3f5) + .margin({ top: 10 }) + } + } +} + +@Builder +function buildComponent() { + UseSizeTypeComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2010.ets new file mode 100644 index 0000000000000000000000000000000000000000..1e2557cb7f2b28df5c073ac08d834a3d95a31cc6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2010.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, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('BuilderNode') + .textAlign(TextAlign.Center) + .fontSize(26) + .id("UIComponentSpecialComponentsFrameNodeAttributeInterface2010") + .width(150) + .height(150) + .backgroundColor(Color.Green) + .linearGradient({ + angle: 90, + colors: [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]] + }) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class myNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = 0xffff0000; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface2010 { + private mNodeController: NodeController = new myNodeController(); + + build() { + Column() { + NodeContainer(this.mNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface202.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface202.ets new file mode 100644 index 0000000000000000000000000000000000000000..e271024d1c14c141021f855f5403b329d769d881 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface202.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NodeController, FrameNode, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text('This is a BuilderNode Visibility.') + .fontSize(16) + .fontWeight(FontWeight.Bold) + .visibility(Visibility.None) + } + .backgroundColor(Color.Gray) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController202 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface202 { + private mNodeController202: NodeController202 = new NodeController202(); + + build() { + Column() { + NodeContainer(this.mNodeController202) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2030.ets new file mode 100644 index 0000000000000000000000000000000000000000..218b56bed9bf6cc02a4146bfe878a45748118b4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2030.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 { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface2030 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2040.ets new file mode 100644 index 0000000000000000000000000000000000000000..17b4fa6b086b3bcc23e6f864b38ad9d24b2df25c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2040.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 { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .opacity(0.2) + .backgroundColor(Color.Orange) +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface2040 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface205.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface205.ets new file mode 100644 index 0000000000000000000000000000000000000000..843ee3c980ef86a89eba694d301d56e5620bd1e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface205.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Flex() { + Text(params.text) + .width(200) + .height(70) + .backgroundColor(Color.Blue) + .textAlign(TextAlign.Center) + } + .width('100%') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 200 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface205 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2060.ets new file mode 100644 index 0000000000000000000000000000000000000000..6612fdf139a43d763854566926a8bc2798c05294 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2060.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TextComponent { + + build() { + Column() { + Text('设置margin') + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .backgroundColor(0xf1f3f5) + .margin({ top: 100 }) + } + } +} + +@Builder +function buildComponent() { + TextComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2070.ets new file mode 100644 index 0000000000000000000000000000000000000000..3db1f15128f4a6b0bf5e4822095d1b4fb5d4bb0d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2070.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + +@Component +struct TextComponent { + + build() { + Column() { + Text('给Text设置padding属性') + .height(80) + .backgroundColor(Color.Orange) + .padding({ top: 50 }) + } + .width(200) + .height(200) + } +} + +@Builder +function buildComponent() { + TextComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext); + this.builderNode.build(new WrappedBuilder(buildComponent)) + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode?.appendChild(this.builderNode.getFrameNode()?.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + .borderWidth(1) + } + .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/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface208.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface208.ets new file mode 100644 index 0000000000000000000000000000000000000000..9325f8b1c9f867dc08b14917f2b82ded0bf6fc39 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface208.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BuilderNode, FrameNode, NodeController, RenderNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = ""; + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Row() { + Circle() + .width(200) + .height(200) + .fill(Color.Green) + .position({ x: 50, y: 50 }) + Circle() + .width(200) + .height(200) + .fill(Color.Blue) + .position({ x: 150, y: 50 }) + } + .blendMode(BlendMode.OVERLAY, BlendApplyType.OFFSCREEN) + .alignItems(VerticalAlign.Center) + .height(600) + .width('100%') + } + .width('100%') + .height('100%') + // .backgroundImage('cat.jpg') +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + let renderNode = new RenderNode(); + renderNode.clipToFrame = false; + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 600, height: 600 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + const textRenderNode = this.textNode?.getFrameNode()?.getRenderNode(); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + renderNode.appendChild(textRenderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface208 { + @State message: string = "hello"; + + build() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height('100%') + .backgroundColor('#FFF0F0F0') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2090.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b94171a7981b2a26e021dde9278654fdebef51f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2090.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, BuilderNode } from '@kit.ArkUI'; + + +@Builder +function buttonBuilder() { + Button('button') + .fontSize(12) + .borderRadius(8) + .borderWidth(2) + .key('UIComponentSpecialComponentsFrameNodeAttributeInterface2090_001') + .backgroundColor(Color.Orange) + .onClick((event: ClickEvent) => { + console.log(`Button ${JSON.stringify(event)}`); + }) +} + + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private wrapBuilder: WrappedBuilder<[]> = wrapBuilder(buttonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + let buttonNode = new BuilderNode<[]>(uiContext); + buttonNode.build(this.wrapBuilder) + this.rootNode.appendChild(buttonNode.getFrameNode()) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterface2090 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + }.padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterfaceSharedTransition.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterfaceSharedTransition.ets new file mode 100644 index 0000000000000000000000000000000000000000..e98fa76b19d4bea353a269a43dba6031114590cb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterfaceSharedTransition.ets @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// PageB.ets +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodeAttributeInterfaceSharedTransition { + build() { + Stack() { + Image("this is sharedTransition").width(200).height(200).backgroundColor(Color.Yellow) + .sharedTransition('sharedImage', { duration: 800, curve: Curve.Linear, delay: 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/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4412351e6543f2b28cb0467ddb220cae600bb48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0010.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0010 { + @State isShow: boolean = false; + @State isShowCover: boolean = false + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + build() { + Column() { + Navigation(this.pageInfos) { + }.height(450).backgroundColor(Color.Pink).id('MyComponent1_Navigation') + MyComponent1().height(450).margin({ top: 20 }) + }.height("100%") + } +} + +@Component +struct MyComponent1 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent1 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent1 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent1 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent1 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent1 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent1 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent1 navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("MyComponent1 在NavDestination内,并在 Navigation 内") + TextArea({ + text: this.content + }) + .width('100%') + .height(350) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..3223754825c69d97891c7c674dfaf5fb6ac33a67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0020.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 type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0020 { + @State isShow: boolean = false; + @State isShowCover: boolean = false + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + build() { + Column() { + Navigation(this.pageInfos) { + // MyComponent2 在Navigation内,不在NavDestination内 + MyComponent1().height(450).margin({ top: 20 }) + }.height(650).backgroundColor(Color.Pink).id('MyComponent1_Navigation') + }.height("100%") + } +} + +@Component +struct MyComponent1 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent1 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent1 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent1 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent1 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent1 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent1 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent1 navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("MyComponent1 在NavDestination内,并在 Navigation 内") + TextArea({ + text: this.content + }) + .width('100%') + .height(350) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..32ea2c3a1b3c2274278e880067ce20c6b8be7bb7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0030.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0030 { + @State isShow: boolean = false; + @State isShowCover: boolean = false + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + build() { + Column() { + + Navigation(this.pageInfos) { + // MyComponent1 在NavDestination内,并在 Navigation 内 + NavDestination() { + MyComponent1().height("100%") + }.height(450).id('MyComponent1_NavDestination') + }.height(650).backgroundColor(Color.Pink).id('MyComponent1_Navigation') + + }.height("100%") + } +} + +@Component +struct MyComponent1 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent1 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent1 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent1 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent1 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent1 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent1 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent1 navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("MyComponent1 在NavDestination内,并在 Navigation 内") + TextArea({ + text: this.content + }) + .width('100%') + .height(350) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f688efe339e474bdc99c58f0114d5936b8edc42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0040.ets @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@CustomDialog +struct CustomDialogExample { + controllerTwo?: CustomDialogController + build() { + Column() { + Text('我是第二个弹窗') + .fontSize(30) + .height(100) + MyComponent2() + Button('点我关闭第二个弹窗') + .onClick(() => { + if (this.controllerTwo != undefined) { + this.controllerTwo.close() + } + }) + .margin(20) + } + } +} + + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0040 { + @State isShow:boolean = false; + @State isShowCover:boolean = false + @State pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample(), + cancel: this.exitApp, + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + customStyle: false, + cornerRadius: 10, + }) + + aboutToAppear(): void { + if (this.dialogController != null) { + this.dialogController.open() + } + } + + // 在自定义组件即将析构销毁时将dialogControlle置空 + aboutToDisappear() { + this.dialogController = null // 将dialogController置空 + } + + exitApp() { + console.info('Click the callback in the blank area') + } + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + console.log('PageTwo get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('PageTwo get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('PageTwo get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'PageTwo pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('PageTwo get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('PageTwo get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n PageTwo navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Row() { + Button('CustomDialog') + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }).backgroundColor(0x317aff) + } + }.height("100%") + } +} + + +@Component +struct MyComponent2 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + build() { + Column() { + Text("NavigationRouterExample") + Button("click").onClick(() => { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('CustomDialog get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('CustomDialog get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('CustomDialog get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'CustomDialog pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('CustomDialog get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('CustomDialog get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n CustomDialog navigationInfo: ' + JSON.stringify(this.navigationInfo); + }) + TextArea({ + text: this.content + }) + .width('100%') + .height(100) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..67c41d14f842e9600c2dbab7523c2190d0a7beb8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0050.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 type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0050 { + @State isShow: boolean = false; + @State isShowCover: boolean = false + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder + myBuilder() { + Column() { + MyComponent5() + Button("close modal 1") + .margin(10) + .fontSize(20) + .onClick(() => { + this.isShow = false; + }) + } + .width('100%') + .height('100%') + } + + build() { + Column() { + Row() { + Button("bindSheet") + .onClick(() => { + this.isShow = true + }) + .id('bindSheet') + .fontSize(20) + .margin(10) + .bindSheet($$this.isShow, this.myBuilder(), { + height: 300, + dragBar: true, + backgroundColor: Color.Green, + onAppear: () => { + console.log("BindSheet onAppear.") + }, + onDisappear: () => { + console.log("BindSheet onDisappear.") + } + }) + } + }.height("100%") + } +} + + +@Component +struct MyComponent5 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent5 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent5 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent5 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent5 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent5 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent5 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent5 navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("NavigationRouterExample") + + TextArea({ + text: this.content + }) + .width('100%') + .height(100) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..4326bd801545e572c5832d8a1318edc34495f59c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0060.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 type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0060 { + @State isShow:boolean = false; + @State isShowCover:boolean = false + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + + @Builder myBuilderCover() { + Column() { + MyComponent6() + Button("close modal 1") + .margin(10) + .fontSize(20) + .onClick(()=>{ + this.isShowCover = false; + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Button("bindContentCover") + .onClick(() => { + this.isShowCover = true + }) + .id('bindContentCover') + .fontSize(20) + .margin(10) + .bindContentCover(this.isShowCover, this.myBuilderCover(), { + modalTransition: ModalTransition.NONE, + backgroundColor: Color.Pink, + onWillAppear: () => {console.log("BindContentCover onWillAppear.")}, + onAppear: () => {console.log("BindContentCover onAppear.")}, + onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")}, + onDisappear: () => {console.log("BindContentCover onDisappear.")} + }) + }.height("100%") + } +} + +@Component +struct MyComponent6 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent6 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent6 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent6 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent6 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent6 get navigation: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent6 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent6 navigation: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("NavigationRouterExample") + TextArea({ + text: this.content + }) + .width('100%') + .height(100) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f59a112919e74edf6279d1ea83024e3203afdfc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0070.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@CustomDialog +struct CustomDialogExample { + pageInfos: NavPathStack = new NavPathStack() + controllerTwo?: CustomDialogController + + build() { + Column() { + Text('我是第二个弹窗') + .fontSize(30) + .height(100) + Navigation(this.pageInfos) { + NavDestination() { + MyComponent4().height("100%") + }.height(200).id('MyComponent1_NavDestination') + }.height(450).backgroundColor(Color.Pink).id('MyComponent1_Navigation') + + Button('点我关闭第二个弹窗') + .onClick(() => { + if (this.controllerTwo != undefined) { + this.controllerTwo.close() + } + }) + .margin(20) + } + } +} + + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0070 { + @State isShow: boolean = false; + @State isShowCover: boolean = false + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + dialogController: CustomDialogController | null = new CustomDialogController({ + builder: CustomDialogExample(), + cancel: this.exitApp, + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 4, + customStyle: false, + cornerRadius: 10, + }) + + // 在自定义组件即将析构销毁时将dialogControlle置空 + aboutToDisappear() { + this.dialogController = null // 将dialogController置空 + } + + exitApp() { + console.info('Click the callback in the blank area') + } + + build() { + Column() { + Row() { + Button('CustomDialog') + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open() + } + }).backgroundColor(0x317aff).id('CustomDialog') + } + }.height("100%") + } +} + +@Component +struct MyComponent4 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent4 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent4 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent4 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent4 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent4 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent4 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent4 navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("NavigationRouterExample") + TextArea({ + text: this.content + }) + .width('100%') + .height(200) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a33ec6542acaba85d75e6e656424d0260ce8fe3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0080.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0080 { + @State isShow: boolean = false; + @State isShowCover: boolean = false + pageInfos: NavPathStack = new NavPathStack() + pageInfos1: NavPathStack = new NavPathStack() + + build() { + Column() { + Navigation(this.pageInfos) { + Navigation(this.pageInfos1) { + MyComponent1().height("100%") + }.height(650).backgroundColor(Color.Orange).id('MyComponent1_Navigation1') + }.height(650).backgroundColor(Color.Pink).id('MyComponent1_Navigation') + + }.height("100%") + } +} + +@Component +struct MyComponent1 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent1 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent1 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent1 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent1 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent1 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent1 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent1 navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("MyComponent1 在NavDestination内,并在 Navigation 内") + TextArea({ + text: this.content + }) + .width('100%') + .height(400) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..b325530400e5ad5c763141efd21d53dd88f61ec4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0090.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type observer from '@ohos.arkui.observer'; +import { PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodePageInfo0090 { + @State isShow: boolean = false; + @State isShowCover: boolean = false + pageInfos: NavPathStack = new NavPathStack() + pageInfos1: NavPathStack = new NavPathStack() + + build() { + Column() { + Navigation(this.pageInfos) { + Navigation(this.pageInfos1) { + NavDestination() { + MyComponent1().height("100%") + }.height(450).id('MyComponent1_NavDestination') + }.height(650).backgroundColor(Color.Orange).id('MyComponent1_Navigation1') + }.height(650).backgroundColor(Color.Pink).id('MyComponent1_Navigation') + + }.height("100%") + } +} + +@Component +struct MyComponent1 { + pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent1 get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent1 get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent1 get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent1 pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent1 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent1 get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent1 navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + Text("MyComponent1 在NavDestination内,并在 Navigation 内") + TextArea({ + text: this.content + }) + .width('100%') + .height(400) + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a344797060e2028da908fd257c5b4971d15f9c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0100.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 type observer from '@ohos.arkui.observer'; +import { FrameNode, PageInfo, UIContext } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentSpecialComponentsFrameNodePageInfo0100 { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State pageInfo_navDestination: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const frameNode_navDestination: FrameNode | null = uiContext.getFrameNodeById('navDestination') + const frameNode_navigation: FrameNode | null = uiContext.getFrameNodeById('navigation') + if (frameNode_navDestination) { + const uniqueId_navDestination: number = frameNode_navDestination.getUniqueId(); + this.pageInfo_navDestination = uiContext.getPageInfoByUniqueId(uniqueId_navDestination); + console.log('jerry2 get pageInfo: ' + JSON.stringify(this.pageInfo_navDestination)); + this.content = 'navigation: pageInfo: ' + JSON.stringify(this.pageInfo_navDestination); + } + if (frameNode_navigation) { + const uniqueId_navigation: number = frameNode_navigation.getUniqueId(); + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId_navigation); + console.log('jerry2 get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + this.content += '\n navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + } + + build() { + Navigation() { + NavRouter() { + Row() { + Text("Router") + .fontSize(30) + .fontWeight(FontWeight.Bold) + .id('Router') + } + .width('90%') + .height(72) + + NavDestination() { + MyComponent() + }.hideTitleBar(false).backgroundColor('#0c182431') + } + .borderRadius(24) + .mode(NavRouteMode.PUSH) + } + } +} + +@Component +struct MyComponent { + @State pageInfo: PageInfo = {}; + navigationInfo: observer.NavigationInfo | undefined; + @State content: string = 'content'; + + onDidBuild(): void { + // 获取UniqueId对应FrameNode所在的navDestination和RouterPage的信息 + const uiContext: UIContext = this.getUIContext(); + const uniqueId: number = this.getUniqueId(); + this.pageInfo = uiContext.getPageInfoByUniqueId(uniqueId); + const info1: observer.RouterPageInfo | undefined = this.queryRouterPageInfo(); + const info2: observer.NavDestinationInfo | undefined = this.queryNavDestinationInfo(); + console.log('MyComponent get pageInfo: ' + JSON.stringify(this.pageInfo)); + console.log('MyComponent get queryRouterPageInfo: ' + JSON.stringify(info1)); + console.log('MyComponent get queryNavDestinationInfo: ' + JSON.stringify(info2)); + this.content = 'MyComponent pageInfo: ' + JSON.stringify(this.pageInfo); + + // 获取UniqueId对应FrameNode所在的Navigation信息 + this.navigationInfo = uiContext.getNavigationInfoByUniqueId(uniqueId); + const navigationInfo1: observer.NavigationInfo | undefined = this.queryNavigationInfo(); + console.log('MyComponent get navigationInfo: ' + JSON.stringify(this.navigationInfo)); + console.log('MyComponent get queryNavigationInfo: ' + JSON.stringify(navigationInfo1)); + this.content += '\n MyComponent navigationInfo: ' + JSON.stringify(this.navigationInfo); + } + + build() { + Column() { + TextArea({ + text: this.content, + }) + .width('100%') + } + .width("100%") + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/Controller.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/Controller.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b210f14cb961fdd96d365fda61fde532b58b36f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/Controller.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 { NodeController, FrameNode, BuilderNode, RenderNode } from "@ohos.arkui.node"; + +class TestBuilder { + constructor() {} + displayBuilder: BuilderNode<[Params]> | undefined | null; + textureBuilder: BuilderNode<[Params]> | undefined | null; + textureBuilder1: BuilderNode<[Params]> | undefined | null; + markerBuilder: BuilderNode<[Params]> | undefined | null; + frameNode1: FrameNode | undefined | null; + frameNode2: FrameNode | undefined | null; + renderNode1: RenderNode | undefined | null; + renderNode2: RenderNode | undefined | null; +} + +export let builder : TestBuilder = new TestBuilder() + +@Observed +export class Params { + constructor(text: string, width: number, height: number) { + this.text = text; + this.width = width; + this.height = height; + } + text: string; + width: number; + height: number; +} + +export class Controller extends NodeController { + public rootNode: FrameNode | undefined | null; + public lastRenderNode: RenderNode | undefined | null + makeNode(uiContext: UIContext): FrameNode | null { + return this.rootNode as FrameNode; + } + getRoot() { + return this.rootNode + } + setRoot(node : FrameNode | undefined | null ) { + this.rootNode = node; + } + getLastRenderNode(): RenderNode { + return this.lastRenderNode as RenderNode; + } + setLastRenderNode(renderNode: RenderNode) { + this.lastRenderNode = renderNode + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..92b787ff049b5353c48d9dcd58da3937f7770f3f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0030.ets @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" + + +@Component +struct Component1 { + @ObjectLink params: Params + @State count: number = 0 + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { + Text('Normal button').fontSize(9).fontColor(0xCCCCCC) + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Button('OK', { type: ButtonType.Normal, stateEffect: true }) + .borderRadius(8) + .backgroundColor(0x317aff) + .width(90) + .onClick(() => { + console.log('ButtonType.Normal') + }) + Button({ type: ButtonType.Normal, stateEffect: true }) { + Row() { + LoadingProgress().width(20).height(20).margin({ left: 12 }).color(0xFFFFFF) + Text('loading').fontSize(12).fontColor(0xffffff).margin({ left: 5, right: 12 }) + }.alignItems(VerticalAlign.Center) + }.borderRadius(8).backgroundColor(0x317aff).width(90).height(40) + + Button('Disable', { type: ButtonType.Normal, stateEffect: false }).opacity(0.4) + .borderRadius(8).backgroundColor(0x317aff).width(90) + } + + Text('Capsule button').fontSize(9).fontColor(0xCCCCCC) + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Button('OK', { type: ButtonType.Capsule, stateEffect: true }).backgroundColor(0x317aff).width(90) + Button({ type: ButtonType.Capsule, stateEffect: true }) { + Row() { + LoadingProgress().width(20).height(20).margin({ left: 12 }).color(0xFFFFFF) + Text('loading').fontSize(12).fontColor(0xffffff).margin({ left: 5, right: 12 }) + }.alignItems(VerticalAlign.Center).width(90).height(40) + }.backgroundColor(0x317aff) + + Button('Disable', { type: ButtonType.Capsule, stateEffect: false }).opacity(0.4) + .backgroundColor(0x317aff).width(90) + } + + Text('Circle button').fontSize(9).fontColor(0xCCCCCC) + Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) { + Button({ type: ButtonType.Circle, stateEffect: true }) { + LoadingProgress().width(20).height(20).color(0xFFFFFF) + }.width(55).height(55).backgroundColor(0x317aff) + + Button({ type: ButtonType.Circle, stateEffect: true }) { + LoadingProgress().width(20).height(20).color(0xFFFFFF) + }.width(55).height(55).margin({ left: 20 }).backgroundColor(0xF55A42) + } + }.width('100%').height('100%').padding({ left: 35, right: 35, top: 35 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0030 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export003_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export003_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..93ca90484d099fa366305fa78de2bce93b6ab559 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0040.ets @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() => { + let grad = this.context.createLinearGradient(50, 0, 300, 100) + grad.addColorStop(0.0, '#ff0000') + grad.addColorStop(0.5, '#ffffff') + grad.addColorStop(1.0, '#00ff00') + this.context.fillStyle = grad + this.context.fillRect(0, 0, 400, 400) + }) + } + .width('100%') + .height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0040 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export004_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.id('export004_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ca6c5a46c6a073c05a012295b52748943a67c6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0050.ets @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + private matrix: Matrix2D = new Matrix2D() + private pattern: CanvasPattern | null = null + + build() { + Column() { + Button("Click to set transform") + .onClick(() => { + this.matrix.scaleY = 1 + this.matrix.scaleX = 1 + this.matrix.translateX = 50 + this.matrix.translateY = 200 + if (this.pattern) { + this.pattern.setTransform(this.matrix) + } + this.context.fillRect(0, 0, 480, 720) + }) + .width("45%") + .margin("5px") + Canvas(this.context) + .width('100%') + .height('80%') + .backgroundColor('#FFFFFF') + .onReady(() => { + this.context.fillStyle = "#00ffff" + this.context.fillRect(0, 0, 100, 100) + let pixel = this.context.getPixelMap(0, 0, 100, 100) + let img = new ImageBitmap(pixel) + this.context.drawImage(img, 100, 100) + this.pattern = this.context.createPattern(img, 'no-repeat') + this.matrix.scaleY = 0.5 + this.matrix.scaleX = 0.5 + this.matrix.translateX = 50 + this.matrix.translateY = 50 + if (this.pattern) { + this.context.fillStyle = this.pattern + this.pattern.setTransform(this.matrix) + } + this.context.fillRect(0, 0, 480, 720) + }) + } + .width('100%') + .height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0050 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export005_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.id('export005_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad732361029ef4ac8be6b07e4ea9c246fa188e63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0060.ets @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" + + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + build() { + Column({space:5}) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() =>{ + this.context.fillStyle = '#0000ff' + this.context.fillRect(20, 20, 150, 100) + }) + } + .width('100%') + .height('100%') + + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0060 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0b0d98c23866433f9b4b129226ac5f3831584ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0070.ets @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() => { + this.context.fillRect(0, 30, 100, 100) + }) + } + .width('100%') + .height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0070 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export007_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export007_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..b23b79f2c6b2b1251e39205ef3c661a246a0b761 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0080.ets @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + // 全选按钮 + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + // CheckboxGroup({ group: 'checkboxGroup' }) + CheckboxGroup({ group: this.params.text }) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + console.info("checkbox group content" + JSON.stringify(itemName)) + }) + Text('Select All').fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500) + } + + // 选项1 + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox1 change is' + value) + }) + Text('Checkbox1').fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500) + }.margin({ left: 36 }) + + // 选项2 + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Checkbox({ name: 'checkbox2', group: 'checkboxGroup' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox2 change is' + value) + }) + Text('Checkbox2').fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500) + }.margin({ left: 36 }) + + // 选项3 + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Checkbox({ name: 'checkbox3', group: 'checkboxGroup' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox3 change is' + value) + }) + Text('Checkbox3').fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500) + }.margin({ left: 36 }) + }.height('100%').width('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0080 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export008_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export008_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..49919be99e851d04f2f02043269592a4b708c25d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0090.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Flex({ justifyContent: FlexAlign.SpaceAround }) { + Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) + .select(true) + .selectedColor(0xed6f21) + .shape(CheckBoxShape.CIRCLE) + .onChange((value: boolean) => { + console.info('Checkbox1 change is' + value) + }) + Checkbox({ name: 'checkbox2', group: 'checkboxGroup' }) + .select(false) + .selectedColor(0x39a2db) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox2 change is' + value) + }) + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0090 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export009_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export009_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..ef563511128c0eee878e5bcaca0f3df2b1359654 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0100.ets @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column({ space: 10 }) { + // 绘制一个直径为150的圆 + Circle({ width: 150, height: 150 }) + // 绘制一个直径为150、线条为红色虚线的圆环(宽高设置不一致时以短边为直径) + Circle() + .width(150) + .height(200) + .fillOpacity(0) + .strokeWidth(3) + .stroke(Color.Red) + .strokeDashArray([1, 2]) + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0100 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export010_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.id('export010_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..f602eeae2813425749cc836389138adea355a03d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0110.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column(){ + Text('The secant line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%') + ColumnSplit() { + Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + } + .borderWidth(1) + .resizeable(true) // 可拖动 + .width('90%').height('60%') + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0110 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..77ffbc124c9d713c6068d81f5354aedd243eeff8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0120.ets @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column({ space: 5 }) { + // 设置子元素垂直方向间距为5 + Text('space').width('90%') + Column({ space: 5 }) { + Column().width('100%').height(30).backgroundColor(0xAFEEEE) + Column().width('100%').height(30).backgroundColor(0x00FFFF) + }.width('90%').height(100).border({ width: 1 }) + + // 设置子元素水平方向对齐方式 + Text('alignItems(Start)').width('90%') + Column() { + Column().width('50%').height(30).backgroundColor(0xAFEEEE) + Column().width('50%').height(30).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }) + + Text('alignItems(End)').width('90%') + Column() { + Column().width('50%').height(30).backgroundColor(0xAFEEEE) + Column().width('50%').height(30).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.End).width('90%').border({ width: 1 }) + + Text('alignItems(Center)').width('90%') + Column() { + Column().width('50%').height(30).backgroundColor(0xAFEEEE) + Column().width('50%').height(30).backgroundColor(0x00FFFF) + }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }) + + // 设置子元素垂直方向的对齐方式 + Text('justifyContent(Center)').width('90%') + Column() { + Column().width('90%').height(30).backgroundColor(0xAFEEEE) + Column().width('90%').height(30).backgroundColor(0x00FFFF) + }.height(100).border({ width: 1 }).justifyContent(FlexAlign.Center) + + Text('justifyContent(End)').width('90%') + Column() { + Column().width('90%').height(30).backgroundColor(0xAFEEEE) + Column().width('90%').height(30).backgroundColor(0x00FFFF) + }.height(100).border({ width: 1 }).justifyContent(FlexAlign.End) + }.width('100%').height('100%').padding({ top: 5 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0120 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb9d159b80507997c0060bdec30910d3e27252f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0130.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column() { + Text() { + ContainerSpan() { + ImageSpan($r('app.media.app_icon')) + .width('40vp') + .height('40vp') + .verticalAlign(ImageSpanAlignment.CENTER) + Span(' Hello World ! ').fontSize('16fp').fontColor(Color.White) + }.textBackgroundStyle({color: "#7F007DFF", radius: "12vp"}) + } + }.width('100%').height('100%').alignItems(HorizontalAlign.Center) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0130 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..61a88c1b2b7e843bbc6d59df6df5d3528b1f16df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0150.ets @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + public valueArr: number[] = [10, 10, 10, 10, 10, 10, 10, 10, 10] + + build() { + Column({ space: 5 }) { + Row() { + Stack() { + DataPanel({ values: [30], max: 100, type: DataPanelType.Circle }).width(168).height(168) + Column() { + Text('30').fontSize(35).fontColor('#182431') + Text('1.0.0').fontSize(9.33).lineHeight(12.83).fontWeight(500).opacity(0.6) + } + + Text('%') + .fontSize(9.33) + .lineHeight(12.83) + .fontWeight(500) + .opacity(0.6) + .position({ x: 104.42, y: 78.17 }) + }.margin({ right: 44 }) + + Stack() { + DataPanel({ values: [50, 12, 8, 5], max: 100, type: DataPanelType.Circle }).width(168).height(168) + Column() { + Text('75').fontSize(35).fontColor('#182431') + Text('已使用98GB/128GB').fontSize(8.17).lineHeight(11.08).fontWeight(500).opacity(0.6) + } + + Text('%') + .fontSize(9.33) + .lineHeight(12.83) + .fontWeight(500) + .opacity(0.6) + .position({ x: 104.42, y: 78.17 }) + } + }.margin({ bottom: 59 }) + + DataPanel({ values: this.valueArr, max: 100, type: DataPanelType.Line }).width(300).height(10) + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0150 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..84473fe58d0bd96e39ff4d97c9996299a7d996e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0190.ets @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + @Builder + descriptionBuilder() { + Text('说明文本') + .maxFontSize('30sp') + .minFontSize("10.0vp") + .fontColor("#fffa2a2d") + .fontWeight(FontWeight.Medium) + .width('100%') + .height("100%") + .textAlign(TextAlign.Center) + } + + build() { + Column() { + Gauge({ value: 50, min: 1, max: 100 }) { + Column() { + Text('50') + .fontWeight(FontWeight.Medium) + .width('62%') + .fontColor("#ff182431") + .maxFontSize("60.0vp") + .minFontSize("30.0vp") + .textAlign(TextAlign.Center) + .margin({ top: '35%' }) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + Text('辅助文本') + .maxFontSize("16.0fp") + .minFontSize("10.0vp") + .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontWeight(FontWeight.Regular) + .width('67.4%') + .height('9.5%') + .textAlign(TextAlign.Center) + }.width('100%').height('100%') + } + .value(50) + .startAngle(210) + .endAngle(150) + .colors([[new LinearGradient([{ color: "#deb6fb", offset: 0 }, { color: "#ac49f5", offset: 1 }]), 9], + [new LinearGradient([{ color: "#bbb7fc", offset: 0 }, { color: "#564af7", offset: 1 }]), 8], + [new LinearGradient([{ color: "#f5b5c2", offset: 0 }, { color: "#e64566", offset: 1 }]), 7], + [new LinearGradient([{ color: "#f8c5a6", offset: 0 }, { color: "#ed6f21", offset: 1 }]), 6], + [new LinearGradient([{ color: "#fceb99", offset: 0 }, { color: "#f7ce00", offset: 1 }]), 5], + [new LinearGradient([{ color: "#dbefa5", offset: 0 }, { color: "#a5d61d", offset: 1 }]), 4], + [new LinearGradient([{ color: "#c1e4be", offset: 0 }, { color: "#64bb5c", offset: 1 }]), 3], + [new LinearGradient([{ color: "#c0ece5", offset: 0 }, { color: "#61cfbe", offset: 1 }]), 2], + [new LinearGradient([{ color: "#b5e0f4", offset: 0 }, { color: "#46b1e3", offset: 1 }]), 1]]) + .width('80%') + .height('80%') + .strokeWidth(18) + .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 }) + .description(this.descriptionBuilder) + .padding(18) + }.margin({ top: 40 }).width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0190 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export019_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.id('export019_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..84e6ea300b6925d2d58d08714cf4528ab07a9520 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0220.ets @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + private img:ImageBitmap = new ImageBitmap("/pages/test050/common/249.jpg") + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() =>{ + this.context.drawImage(this.img,0,0,130,130) + let imagedata = this.context.getImageData(50,50,130,130) + this.context.putImageData(imagedata,150,150) + }) + } + .width('100%') + .height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0220 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..353807ac87ca88849259d8ee3be71510af3e5dcd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0230.ets @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State top: number = 40 + @State bottom: number = 5 + @State left: number = 40 + @State right: number = 10 + + build() { + Column({ space: 5 }) { + // 原图效果 + Image('/pages/test050/common/249.jpg') + .width(200).height(200) + .border({ width: 2, color: Color.Pink }) + .objectFit(ImageFit.Contain) + + // 图像拉伸效果,设置resizable属性,对图片不同方向进行拉伸 + Image('/pages/test050/common/249.jpg') + .resizable({ + slice: { + left: this.left, + right: this.right, + top: this.top, + bottom: this.bottom + } + }) + .width(200) + .height(200) + .border({ width: 2, color: Color.Pink }) + .objectFit(ImageFit.Contain) + + Row() { + Button("add top to " + this.top).fontSize(10) + .onClick(() => { + this.top += 2 + }) + Button("add bottom to " + this.bottom).fontSize(10) + .onClick(() => { + this.bottom += 2 + }) + } + + Row() { + Button("add left to " + this.left).fontSize(10) + .onClick(() => { + this.left += 2 + }) + Button("add right to " + this.right).fontSize(10) + .onClick(() => { + this.right += 2 + }) + } + + } + .justifyContent(FlexAlign.Start).width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0230 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e3ccd967b02656aa9c8b4bf2628074665793f52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0250.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params; + @State enableLoading: boolean = false; + + build() { + Column(){ + LoadingProgress().color(Color.Red).layoutWeight(1) + .enableLoading(this.enableLoading); + Button('button1') + .id('UIComponentSpecialComponentsFrameNodeTexetureExport0250_btn1') + .onClick(() => { + this.enableLoading = true; + }) + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0250 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Stack(){ + NodeContainer(this.controller2) + .borderWidth(4) + .borderColor(Color.Blue) + .height(400) + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + } + + Scroll(){ + Column() { + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(300).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba99bb7370fddbb5694dc376eac96c84760b563a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0270.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State message: string = 'Matrix2D ScaleX' + + printMatrix(title: string, matrix: Matrix2D) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("Set scaleX") + .onClick(() => { + let matrix : Matrix2D = new Matrix2D() + matrix.scaleX = 1 + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0270 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..999ab4e3bfb81c56f7e44a551101ff19fd208a93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0310.ets @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column({ space: 10 }) { + Text('Straight line') + .fontSize(11) + .fontColor(0xCCCCCC) + .width('90%') + // 绘制一条长600px,宽3vp的直线 + Path() + .width('600px') + .height('10px') + .commands('M0 0 L600 0') + .stroke(Color.Black) + .strokeWidth(3) + + Text('Straight line graph') + .fontSize(11) + .fontColor(0xCCCCCC) + .width('90%') + // 绘制直线图形 + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Path() + .width('210px') + .height('310px') + .commands('M100 0 L200 240 L0 240 Z') + .fillOpacity(0) + .stroke(Color.Black) + .strokeWidth(1) + Path() + .width('210px') + .height('310px') + .commands('M0 0 H200 V200 H0 Z') + .fillOpacity(0) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('210px') + .height('310px') + .commands('M100 0 L0 100 L50 200 L150 200 L200 100 Z') + .fillOpacity(0) + .stroke(Color.Black) + .strokeWidth(3) + }.width('95%') + + Text('Curve graphics').fontSize(11).fontColor(0xCCCCCC).width('90%') + // 绘制弧线图形 + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Path() + .width('250px') + .height('310px') + .commands("M0 300 S100 0 240 300 Z") + .fillOpacity(0) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('210px') + .height('310px') + .commands('M0 150 C0 100 140 0 200 150 L100 300 Z') + .fillOpacity(0) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('210px') + .height('310px') + .commands('M0 100 A30 20 20 0 0 200 100 Z') + .fillOpacity(0) + .stroke(Color.Black) + .strokeWidth(3) + }.width('95%') + }.width('100%').height('100%') + .margin({ top: 5 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0310 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..e5e17b6285b6c3bf6844856bcf461a86ab5d5be8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0350.ets @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column({ space: 15 }) { + Text('Linear Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 10, type: ProgressType.Linear }).width(200) + Progress({ value: 20, total: 150, type: ProgressType.Linear }).color(Color.Grey).value(50).width(200) + + + Text('Eclipse Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row({ space: 40 }) { + Progress({ value: 10, type: ProgressType.Eclipse }).width(100) + Progress({ value: 20, total: 150, type: ProgressType.Eclipse }).color(Color.Grey).value(50).width(100) + } + + Text('ScaleRing Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row({ space: 40 }) { + Progress({ value: 10, type: ProgressType.ScaleRing }).width(100) + Progress({ value: 20, total: 150, type: ProgressType.ScaleRing }) + .color(Color.Grey).value(50).width(100) + .style({ strokeWidth: 15, scaleCount: 15, scaleWidth: 5 }) + } + + // scaleCount和scaleWidth效果对比 + Row({ space: 40 }) { + Progress({ value: 20, total: 150, type: ProgressType.ScaleRing }) + .color(Color.Grey).value(50).width(100) + .style({ strokeWidth: 20, scaleCount: 20, scaleWidth: 5 }) + Progress({ value: 20, total: 150, type: ProgressType.ScaleRing }) + .color(Color.Grey).value(50).width(100) + .style({ strokeWidth: 20, scaleCount: 30, scaleWidth: 3 }) + } + + Text('Ring Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row({ space: 40 }) { + Progress({ value: 10, type: ProgressType.Ring }).width(100) + Progress({ value: 20, total: 150, type: ProgressType.Ring }) + .color(Color.Grey).value(50).width(100) + .style({ strokeWidth: 20 }) + } + + Text('Capsule Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') + Row({ space: 40 }) { + Progress({ value: 10, type: ProgressType.Capsule }).width(100).height(50) + Progress({ value: 20, total: 150, type: ProgressType.Capsule }) + .color(Color.Grey) + .value(50) + .width(100) + .height(50) + } + }.width('100%').height('100%').margin({ top: 30 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0350 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export035_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export035_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b87b64a9d9b9561d3d4cc8f554307597ee60e9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0360.ets @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + private value: string = 'hello world' + build() { + Column({ space: 5 }) { + Text('normal').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30) + QRCode(this.value).width(140).height(140) + + // 设置二维码颜色 + Text('color').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30) + QRCode(this.value).color(0xF7CE00).width(140).height(140) + + // 设置二维码背景色 + Text('backgroundColor').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30) + QRCode(this.value).width(140).height(140).backgroundColor(Color.Orange) + + // 设置二维码不透明度 + Text('contentOpacity').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30) + QRCode(this.value).width(140).height(140).color(Color.Black).contentOpacity(0.1) + }.width('100%').height('100%').margin({ top: 5 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0360 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..46daf1581a4ed22e6d2e0b8d68932a04baba67c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0370.ets @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Column() { + Text('Radio1') + // Radio({ value: 'Radio1', group: 'radioGroup' }).checked(true) + Radio({ value: 'Radio1', group: this.params.text }) + .checked(true) + .radioStyle({ + checkedBackgroundColor: Color.Pink + }) + .height(50) + .width(50) + .onChange((isChecked: boolean) => { + console.log('Radio1 status is ' + isChecked) + }) + } + + Column() { + Text('Radio2') + Radio({ value: 'Radio2', group: this.params.text }) + .checked(false) + .radioStyle({ + checkedBackgroundColor: Color.Pink + }) + .height(50) + .width(50) + .onChange((isChecked: boolean) => { + console.log('Radio2 status is ' + isChecked) + }) + } + + Column() { + Text('Radio3') + Radio({ value: 'Radio3', group: this.params.text }) + .checked(false) + .radioStyle({ + checkedBackgroundColor: Color.Pink + }) + .height(50) + .width(50) + .onChange((isChecked: boolean) => { + console.log('Radio3 status is ' + isChecked) + }) + } + }.padding({ top: 30 }).width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0370 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export037_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export037_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..14ad63c02ce0fa8312b62903e420793852dab9dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0380.ets @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State rating: number = 3.5 + + build() { + Column() { + Column() { + Rating({ rating: this.rating, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value + }) + Text('current score is ' + this.rating) + .fontSize(16) + .fontColor('rgba(24,36,49,0.60)') + .margin({ top: 16 }) + }.width(360).height(113).backgroundColor('#FFFFFF').margin({ top: 68 }) + + Row() { + Image('common/testImage.jpg') + .width(40) + .height(40) + .borderRadius(20) + .margin({ left: 24 }) + Column() { + Text('Yue') + .fontSize(16) + .fontColor('#182431') + .fontWeight(500) + Row() { + Rating({ rating: 3.5, indicator: false }).margin({ top: 1, right: 8 }) + Text('2021/06/02') + .fontSize(10) + .fontColor('#182431') + } + }.margin({ left: 12 }).alignItems(HorizontalAlign.Start) + + Text('1st Floor') + .fontSize(10) + .fontColor('#182431') + .position({ x: 295, y: 8 }) + }.width(360).height(56).backgroundColor('#FFFFFF').margin({ top: 64 }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0380 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..50278e00119ef6d951b065500f13cb372d7bbc32 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0390.ets @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column({ space: 10 }) { + Text('normal').fontSize(11).fontColor(0xCCCCCC).width('90%') + // 绘制90% * 50的矩形 + Column({ space: 5 }) { + Text('normal').fontSize(9).fontColor(0xCCCCCC).width('90%') + // 绘制90% * 50矩形 + Rect({ width: '90%', height: 50 }) + .fill(Color.Pink) + // 绘制90% * 50的矩形框 + Rect() + .width('90%') + .height(50) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(3) + + Text('with rounded corners').fontSize(11).fontColor(0xCCCCCC).width('90%') + // 绘制90% * 80的矩形, 圆角宽高分别为40、20 + Rect({ width: '90%', height: 80 }) + .radiusHeight(20) + .radiusWidth(40) + .fill(Color.Pink) + // 绘制90% * 80的矩形, 圆角宽高为20 + Rect({ width: '90%', height: 80 }) + .radius(20) + .fill(Color.Pink) + .stroke(Color.Transparent) + }.width('100%').margin({ top: 10 }) + // 绘制90% * 50矩形, 左上圆角宽高40,右上圆角宽高20,右下圆角宽高40,左下圆角宽高20 + Rect({ width: '90%', height: 80 }) + .radius([[40, 40], [20, 20], [40, 40], [20, 20]]) + .fill(Color.Pink) + }.width('100%').height('100%').margin({ top: 5 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0390 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + + + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + build() { + Row() { + Column() { + Scroll(){ + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5).height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) {} else {} + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll(){ + Column() { + + Button('RENDER_TYPE_DISPLAY').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }).id('render_type_display') + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({width:1}).id('scroller1') + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..51bbb67eaf933d5d2362df894d2837d54294d232 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0430.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 webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column({ space: 10 }) { + Text('basic').fontSize(11).fontColor(0xCCCCCC).width(320) + // 在Shape的(-2, -2)点绘制一个 300 * 50 带边框的矩形,颜色0x317AF7,边框颜色黑色,边框宽度4,边框间隙20,向左偏移10,线条两端样式为半圆,拐角样式圆角,抗锯齿(默认开启) + // 在Shape的(-2, 58)点绘制一个 300 * 50 带边框的椭圆,颜色0x317AF7,边框颜色黑色,边框宽度4,边框间隙20,向左偏移10,线条两端样式为半圆,拐角样式圆角,抗锯齿(默认开启) + // 在Shape的(-2, 118)点绘制一个 300 * 10 直线路径,颜色0x317AF7,边框颜色黑色,宽度4,间隙20,向左偏移10,线条两端样式为半圆,拐角样式圆角,抗锯齿(默认开启) + Shape() { + Rect().width(300).height(50) + Ellipse().width(300).height(50).offset({ x: 0, y: 60 }) + Path().width(300).height(10).commands('M0 0 L900 0').offset({ x: 0, y: 120 }) + } + .width(350) + .height(140) + .viewPort({ + x: -2, + y: -2, + width: 304, + height: 130 + }) + .fill(0x317AF7) + .stroke(Color.Black) + .strokeWidth(4) + .strokeDashArray([20]) + .strokeDashOffset(10) + .strokeLineCap(LineCapStyle.Round) + .strokeLineJoin(LineJoinStyle.Round) + .antiAlias(true) + + // 分别在Shape的(0, 0)、(-5, -5)点绘制一个 300 * 50 带边框的矩形,可以看出之所以将视口的起始位置坐标设为负值是因为绘制的起点默认为线宽的中点位置,因此要让边框完全显示则需要让视口偏移半个线宽 + Shape() { + Rect().width(300).height(50) + } + .width(350) + .height(80) + .viewPort({ + x: 0, + y: 0, + width: 320, + height: 70 + }) + .fill(0x317AF7) + .stroke(Color.Black) + .strokeWidth(10) + + Shape() { + Rect().width(300).height(50) + } + .width(350) + .height(80) + .viewPort({ + x: -5, + y: -5, + width: 320, + height: 70 + }) + .fill(0x317AF7) + .stroke(Color.Black) + .strokeWidth(10) + + Text('path').fontSize(11).fontColor(0xCCCCCC).width(320) + // 在Shape的(0, -5)点绘制一条直线路径,颜色0xEE8443,线条宽度10,线条间隙20 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + } + .width(350) + .height(20) + .viewPort({ + x: 0, + y: -5, + width: 300, + height: 20 + }) + .stroke(0xEE8443) + .strokeWidth(10) + .strokeDashArray([20]) + + // 在Shape的(0, -5)点绘制一条直线路径,颜色0xEE8443,线条宽度10,线条间隙20,向左偏移10 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + } + .width(350) + .height(20) + .viewPort({ + x: 0, + y: -5, + width: 300, + height: 20 + }) + .stroke(0xEE8443) + .strokeWidth(10) + .strokeDashArray([20]) + .strokeDashOffset(10) + + // 在Shape的(0, -5)点绘制一条直线路径,颜色0xEE8443,线条宽度10,透明度0.5 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + } + .width(350) + .height(20) + .viewPort({ + x: 0, + y: -5, + width: 300, + height: 20 + }) + .stroke(0xEE8443) + .strokeWidth(10) + .strokeOpacity(0.5) + + // 在Shape的(0, -5)点绘制一条直线路径,颜色0xEE8443,线条宽度10,线条间隙20,线条两端样式为半圆 + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + } + .width(350) + .height(20) + .viewPort({ + x: 0, + y: -5, + width: 300, + height: 20 + }) + .stroke(0xEE8443) + .strokeWidth(10) + .strokeDashArray([20]) + .strokeLineCap(LineCapStyle.Round) + + // 在Shape的(-20, -5)点绘制一个封闭路径,颜色0x317AF7,线条宽度10,边框颜色0xEE8443,拐角样式锐角(默认值) + Shape() { + Path().width(200).height(60).commands('M0 0 L400 0 L400 150 Z') + } + .width(300) + .height(200) + .viewPort({ + x: -20, + y: -5, + width: 310, + height: 90 + }) + .fill(0x317AF7) + .stroke(0xEE8443) + .strokeWidth(10) + .strokeLineJoin(LineJoinStyle.Miter) + .strokeMiterLimit(5) + }.width('100%').height('100%').margin({ top: 15 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0430 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export043_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export043_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7d0bd8d483239fde4c66128333c8da83481adb8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0440.ets @@ -0,0 +1,282 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State outSetValueOne: number = 40 + @State inSetValueOne: number = 40 + @State noneValueOne: number = 40 + @State outSetValueTwo: number = 40 + @State inSetValueTwo: number = 40 + @State vOutSetValueOne: number = 40 + @State vInSetValueOne: number = 40 + @State vOutSetValueTwo: number = 40 + @State vInSetValueTwo: number = 40 + + build() { + Column({ space: 8 }) { + Text('outset slider').fontSize(9).fontColor(0xCCCCCC).width('90%').margin(15) + Row() { + Slider({ + value: this.outSetValueOne, + min: 0, + max: 100, + style: SliderStyle.OutSet + }) + .showTips(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValueOne = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + // toFixed(0)将滑动条返回值处理为整数精度 + Text(this.outSetValueOne.toFixed(0)).fontSize(12) + } + .width('80%') + + Row() { + Slider({ + value: this.outSetValueTwo, + step: 10, + style: SliderStyle.OutSet + }) + .showSteps(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValueTwo = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + Text(this.outSetValueTwo.toFixed(0)).fontSize(12) + } + .width('80%') + + Text('inset slider').fontSize(9).fontColor(0xCCCCCC).width('90%').margin(15) + Row() { + Slider({ + value: this.inSetValueOne, + min: 0, + max: 100, + style: SliderStyle.InSet + }) + .blockColor('#191970') + .trackColor('#ADD8E6') + .selectedColor('#4169E1') + .showTips(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.inSetValueOne = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + Text(this.inSetValueOne.toFixed(0)).fontSize(12) + } + .width('80%') + + Row() { + Slider({ + value: this.inSetValueTwo, + step: 10, + style: SliderStyle.InSet + }) + .blockColor('#191970') + .trackColor('#ADD8E6') + .selectedColor('#4169E1') + .showSteps(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.inSetValueTwo = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + Text(this.inSetValueTwo.toFixed(0)).fontSize(12) + } + .width('80%') + + Text('none slider').fontSize(9).fontColor(0xCCCCCC).width('90%').margin(15) + Row() { + Slider({ + value: this.noneValueOne, + min: 0, + max: 100, + style: SliderStyle.NONE + }) + .blockColor('#191970') + .trackColor('#ADD8E6') + .selectedColor('#4169E1') + .showTips(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.noneValueOne = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + Text(this.noneValueOne.toFixed(0)).fontSize(12) + } + .width('80%') + + Row() { + Column() { + Text('vertical outset slider').fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15) + Row() { + Text().width('10%') + Slider({ + value: this.vOutSetValueOne, + style: SliderStyle.OutSet, + direction: Axis.Vertical + }) + .blockColor('#191970') + .trackColor('#ADD8E6') + .selectedColor('#4169E1') + .showTips(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.vOutSetValueOne = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + Slider({ + value: this.vOutSetValueTwo, + step: 10, + style: SliderStyle.OutSet, + direction: Axis.Vertical + }) + .blockColor('#191970') + .trackColor('#ADD8E6') + .selectedColor('#4169E1') + .showSteps(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.vOutSetValueTwo = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + } + }.width('50%').height(300) + + Column() { + Text('vertical inset slider').fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15) + Row() { + Slider({ + value: this.vInSetValueOne, + style: SliderStyle.InSet, + direction: Axis.Vertical, + reverse: true // 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true + }) + .showTips(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.vInSetValueOne = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + Slider({ + value: this.vInSetValueTwo, + step: 10, + style: SliderStyle.InSet, + direction: Axis.Vertical, + reverse: true + }) + .showSteps(true) + .onChange((value: number, mode: SliderChangeMode) => { + this.vInSetValueTwo = value + console.info('value:' + value + 'mode:' + mode.toString()) + }) + } + }.width('50%').height(300) + } + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0440 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export044_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export044_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..a6a5ae38e83260322eb584cf2b5feb73a5887545 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0460.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Stack({ alignContent: Alignment.Bottom }) { + Text('First child, show in bottom').width('90%').height('100%').backgroundColor(0xd2cab3).align(Alignment.Top) + Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top) + }.width('100%').height('100%').margin({ top: 5 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0460 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export046_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export046_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3cfd64510d6d5d99981c77447f1e90920a959b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0470.ets @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State text: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: TextAreaController = new TextAreaController() + + build() { + Column() { + TextArea({ + text: this.text, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .onChange((value: string) => { + this.text = value + }) + Text(this.text) + Button('Set caretPosition 1') + .backgroundColor('#007DFF') + .margin(15) + .onClick(() => { + // 设置光标位置到第一个字符后 + this.controller.caretPosition(1) + }) + Button('Get CaretOffset') + .backgroundColor('#007DFF') + .margin(15) + .onClick(() => { + this.positionInfo = this.controller.getCaretOffset() + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0470 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export047_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export047_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0480.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ba5b4d2ad1861064370cb6c6c3b80f73bff6408 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0480.ets @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State accumulateTime: number = 0 + controller: TextClockController = new TextClockController() + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Current milliseconds is ' + this.accumulateTime) + .fontSize(20) + // 以12小时制显示东八区的系统时间,精确到秒。 + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .fontSize(30) + Button("start TextClock") + .margin({ bottom: 10 }) + .onClick(() => { + // 启动文本时钟 + this.controller.start() + }) + Button("stop TextClock") + .onClick(() => { + // 停止文本时钟 + this.controller.stop() + }) + } + .width('100%') + .height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0480 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export048_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export048_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0490.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1b263cb571f04b5440959eae1ba9650850f5d34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0490.ets @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State text: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: TextInputController = new TextInputController() + + build() { + Column() { + TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .width('95%') + .height(40) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .inputFilter('[a-z]', (e) => { + console.log(JSON.stringify(e)) + }) + .onChange((value: string) => { + this.text = value + }) + Text(this.text) + Button('Set caretPosition 1') + .margin(15) + .onClick(() => { + // 将光标移动至第一个字符后 + this.controller.caretPosition(1) + }) + Button('Get CaretOffset') + .margin(15) + .onClick(() => { + this.positionInfo = this.controller.getCaretOffset() + }) + // 密码输入框 + TextInput({ placeholder: 'input your password...' }) + .width('95%') + .height(40) + .margin(20) + .type(InputType.Password) + .maxLength(9) + .showPasswordIcon(true) + // 邮箱地址自动填充类型 + TextInput({ placeholder: 'input your email...' }) + .width('95%') + .height(40) + .margin(20) + .contentType(ContentType.EMAIL_ADDRESS) + .maxLength(9) + // 内联风格输入框 + TextInput({ text: 'inline style' }) + .width('95%') + .height(50) + .margin(20) + .borderRadius(0) + .style(TextInputStyle.Inline) + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0490 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export049_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export049_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..faf8272a1b270dc3b963dec0d92ef4f0f8923a14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0500.ets @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + textTimerController: TextTimerController = new TextTimerController() + @State format: string = 'mm:ss.SS' + + build() { + Column() { + TextTimer({ isCountDown: true, count: 30000, controller: this.textTimerController }) + .format(this.format) + .fontColor(Color.Black) + .fontSize(50) + .onTimer((utc: number, elapsedTime: number) => { + console.info('textTimer notCountDown utc is:' + utc + ', elapsedTime: ' + elapsedTime) + }) + Row() { + Button("start").onClick(() => { + this.textTimerController.start() + }) + Button("pause").onClick(() => { + this.textTimerController.pause() + }) + Button("reset").onClick(() => { + this.textTimerController.reset() + }) + } + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0500 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Stack() { + NodeContainer(this.controller2) + .borderWidth(4) + .borderColor(Color.Blue) + .height(400) + + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export050_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export050_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..2806695cba79a20a23913e9d4f4c30450df4d0a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0510.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 webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { + // 文本水平方向对齐方式设置 + // 单行文本 + Text('textAlign').fontSize(9).fontColor(0xCCCCCC) + Text('TextAlign set to Center.') + .textAlign(TextAlign.Center) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + .width('100%') + Text('TextAlign set to Start.') + .textAlign(TextAlign.Start) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + .width('100%') + Text('TextAlign set to End.') + .textAlign(TextAlign.End) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + .width('100%') + + // 多行文本 + Text('This is the text content with textAlign set to Center.') + .textAlign(TextAlign.Center) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + .width('100%') + Text('This is the text content with textAlign set to Start.') + .textAlign(TextAlign.Start) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + .width('100%') + Text('This is the text content with textAlign set to End.') + .textAlign(TextAlign.End) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + .width('100%') + + + // 文本超长时显示方式 + Text('TextOverflow+maxLines').fontSize(9).fontColor(0xCCCCCC) + // 超出maxLines截断内容展示 + Text('This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content. This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content.') + .textOverflow({ overflow: TextOverflow.Clip }) + .maxLines(1) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + + // 超出maxLines展示省略号 + Text('This is set textOverflow to Ellipsis text content This is set textOverflow to Ellipsis text content.'.split('') + .join('\u200B')) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + .fontSize(12) + .border({ width: 1 }) + .padding(10) + + Text('lineHeight').fontSize(9).fontColor(0xCCCCCC) + Text('This is the text with the line height set. This is the text with the line height set.') + .fontSize(12).border({ width: 1 }).padding(10) + Text('This is the text with the line height set. This is the text with the line height set.') + .fontSize(12).border({ width: 1 }).padding(10) + .lineHeight(20) + }.padding({ left: 35, right: 35, top: 35 }).width(350).height(600) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0510 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export051_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export051_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba4fd0427ec9958d6b01e00a09f3914be85dd752 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0520.ets @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column({ space: 10 }) { + Text('type: Switch').fontSize(12).fontColor(0xcccccc).width('90%') + Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + } + + Text('type: Checkbox').fontSize(12).fontColor(0xcccccc).width('90%') + Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .size({ width: 20, height: 20 }) + .selectedColor('#007DFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + + Toggle({ type: ToggleType.Checkbox, isOn: true }) + .size({ width: 20, height: 20 }) + .selectedColor('#007DFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + } + + Text('type: Button').fontSize(12).fontColor(0xcccccc).width('90%') + Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { + Toggle({ type: ToggleType.Button, isOn: false }) { + Text('status button').fontColor('#182431').fontSize(12) + }.width(106) + .selectedColor('rgba(0,125,255,0.20)') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + + Toggle({ type: ToggleType.Button, isOn: true }) { + Text('status button').fontColor('#182431').fontSize(12) + }.width(106) + .selectedColor('rgba(0,125,255,0.20)') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + } + }.width('100%').height('100%').padding(24) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0520 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export052_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export052_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..86e968dcf8d70726264818e2b1ee4b7bfb4395e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0530.ets @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +interface DurationObject { + duration: number; +} + +interface TimeObject { + time: number; +} + +@Component +struct Component1 { + @ObjectLink params: Params + @State videoSrc: Resource = $rawfile('video_1.mp4') + @State previewUri: Resource = $r('app.media.openeye') + @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X + @State isAutoPlay: boolean = false + @State showControls: boolean = true + controller: VideoController = new VideoController() + + build() { + + Column() { + Video({ + src: this.videoSrc, + previewUri: this.previewUri, + currentProgressRate: this.curRate, + controller: this.controller + }) + .width('100%') + .height(350) + .autoPlay(this.isAutoPlay) + .controls(this.showControls) + .onStart(() => { + console.info('onStart') + }) + .onPause(() => { + console.info('onPause') + }) + .onFinish(() => { + console.info('onFinish') + }) + .onError(() => { + console.info('onError') + }) + .onStop(() => { + console.info('onStop') + }) + .onPrepared((e?: DurationObject) => { + if (e != undefined) { + console.info('onPrepared is ' + e.duration) + } + }) + .onSeeking((e?: TimeObject) => { + if (e != undefined) { + console.info('onSeeking is ' + e.time) + } + }) + .onSeeked((e?: TimeObject) => { + if (e != undefined) { + console.info('onSeeked is ' + e.time) + } + }) + .onUpdate((e?: TimeObject) => { + if (e != undefined) { + console.info('onUpdate is ' + e.time) + } + }) + + Row() { + Button('src').onClick(() => { + this.videoSrc = $rawfile('video_1.mp4') // 切换视频源 + }).margin(5) + Button('previewUri').onClick(() => { + this.previewUri = $r('app.media.openeye') // 切换视频预览海报 + }).margin(5) + Button('controls').onClick(() => { + this.showControls = !this.showControls // 切换是否显示视频控制栏 + }).margin(5) + } + + Row() { + Button('start').onClick(() => { + this.controller.start() // 开始播放 + }).margin(5) + Button('pause').onClick(() => { + this.controller.pause() // 暂停播放 + }).margin(5) + Button('stop').onClick(() => { + this.controller.stop() // 结束播放 + }).margin(5) + Button('setTime').onClick(() => { + this.controller.setCurrentTime(10, SeekMode.Accurate) // 精准跳转到视频的10s位置 + }).margin(5) + } + + Row() { + Button('rate 0.75').onClick(() => { + this.curRate = PlaybackSpeed.Speed_Forward_0_75_X // 0.75倍速播放 + }).margin(5) + Button('rate 1').onClick(() => { + this.curRate = PlaybackSpeed.Speed_Forward_1_00_X // 原倍速播放 + }).margin(5) + Button('rate 2').onClick(() => { + this.curRate = PlaybackSpeed.Speed_Forward_2_00_X // 2倍速播放 + }).margin(5) + } + } + + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0530 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export053_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export053_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..27c11d0fc2d640ede62319aad6a55f7137aa46cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0540.ets @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column({ space: 10 }) { + Text('type: Switch').fontSize(12).fontColor(0xcccccc).width('90%') + Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + + Toggle({ type: ToggleType.Switch, isOn: true }) + .selectedColor('#007DFF') + .switchPointColor('#FFFFFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + } + + Text('type: Checkbox').fontSize(12).fontColor(0xcccccc).width('90%') + Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .size({ width: 20, height: 20 }) + .selectedColor('#007DFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + + Toggle({ type: ToggleType.Checkbox, isOn: true }) + .size({ width: 20, height: 20 }) + .selectedColor('#007DFF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + } + + Text('type: Button').fontSize(12).fontColor(0xcccccc).width('90%') + Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { + Toggle({ type: ToggleType.Button, isOn: false }) { + Text('status button').fontColor('#182431').fontSize(12) + }.width(106) + .selectedColor('rgba(0,125,255,0.20)') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + + Toggle({ type: ToggleType.Button, isOn: true }) { + Text('status button').fontColor('#182431').fontSize(12) + }.width(106) + .selectedColor('rgba(0,125,255,0.20)') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn) + }) + } + }.width('100%').height('100%').padding(24) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0540 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export054_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.id('export054_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0550.ets new file mode 100644 index 0000000000000000000000000000000000000000..9de47bf44da4e7048eb9217f66a04a1faf6a4ac9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0550.ets @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeController, NodeRenderType, XComponentNode } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +import { UIContext } from '@ohos.arkui.UIContext'; + +class XComponentNodeController extends NodeController { + private xComponentNode: MyXComponentNode | null = null; + private soName: string = "nativerender" // 该 so 由开发者通过 NAPI 编写并生成 + + constructor() { + super(); + } + + makeNode(context: UIContext): FrameNode | null { + this.xComponentNode = new MyXComponentNode(context, { + selfIdealSize: { width: 200, height: 200 } + }, "xComponentId", XComponentType.SURFACE, this.soName); + return this.xComponentNode; + } + + changeRenderType(renderType: NodeRenderType): void { + if (this.xComponentNode) { + this.xComponentNode.changeRenderType(renderType); + } + } +} + +class MyXComponentNode extends XComponentNode { + onCreate(event: Object) { + // do something when XComponentNode has created + } + + onDestroy() { + // do something when XComponentNode is destroying + } +} + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Row() { + Column() { + NodeContainer(new XComponentNodeController()) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0550 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export055_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.id('export055_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..861ac456374d117e7742f992f80b2aa272e072a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0560.ets @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, FrameNode, NodeRenderType } from '@ohos.arkui.node'; +import { builder, Controller, Params } from './Controller'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column({ space: 10 }) { + Circle() + .width(150) + .height(150) + .fillOpacity(0) + .strokeWidth(3) + .stroke(Color.Red) + .strokeDashArray([1, 2]) + Line() + .width(150) + .height(3) + .startPoint([0, 0]) + .endPoint([150, 0]) + .stroke(Color.Black) + }.width('100%').height('100%').margin({ top: 10 }) + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTexetureExport0560 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + Button('RENDER_TYPE_DISPLAY') + .id('export056_button').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + } + .id('export056_scroll').width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8af0100d66a0238e47cc65817000e19a1d3eeee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0010.ets @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + @Builder + tabBuilder(index: number) { + Column() { + if (index === 2) { + Badge({ + value: '', + style: { badgeSize: 6, badgeColor: '#FA2A2D' } + }) { + Image($r('app.media.image2')) + .width(24) + .height(24) + } + .width(24) + .height(24) + .margin({ bottom: 4 }) + } else { + Image($r('app.media.img')) + .width(24) + .height(24) + .margin({ bottom: 4 }) + } + Text('Tab') + .fontColor('#182431') + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + @Builder + itemBuilder(value: string) { + Row() { + Image($r('app.media.image2')).width(32).height(32).opacity(0.6) + Text(value) + .width(177) + .height(21) + .margin({ left: 15, right: 76 }) + .textAlign(TextAlign.Start) + .fontColor('#182431') + .fontWeight(500) + .fontSize(16) + .opacity(0.9) + Image($r('app.media.image2')).width(12).height(24).opacity(0.6) + }.width('100%').padding({ left: 12, right: 12 }).height(56) + } + + build() { + Column() { + this.itemBuilder('Hello'); + ForEach([1, 2, 3, 4], (item: string, index: number) => { + this.tabBuilder(index); + }, (item: string, index: number) => item + index) + }.width('100%').height('100%').padding({ top: 24 }) + } +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0010 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..fabcaffc3c77ac363eb8467d31fd42a932e1aec7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0020.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column() { + Row() { + Text('Bluetooth').fontSize(18) + Blank() + Toggle({ type: ToggleType.Switch }).margin({ top: 14, bottom: 14, left: 6, right: 6 }) + }.width('100%').backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 }) + }.backgroundColor(0xEFEFEF).padding(20).width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0020 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..25d774023ea0e88b3bf52a33fba60fe522bc0fa1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0140.ets @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State value: number = 0 + + build() { + Column() { + Counter() { + Text(this.value.toString()) + } + .onInc(() => { + this.value++ + }) + .onDec(() => { + this.value-- + }) + }.width('100%').height('100%') + } +} + + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0140 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..3bcb5e86a441b4ee9bb554c6e529c37faec42b6d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0160.ets @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + // 使用横向分割线场景 + Text('Horizontal divider').fontSize(9).fontColor(0xCCCCCC) + List() { + ForEach([1, 2, 3], (item: number) => { + ListItem() { + Text('list' + item).width('100%').fontSize(14).fontColor('#182431').textAlign(TextAlign.Start) + }.width(244).height(48) + }, (item: number) => item.toString()) + }.padding({ left: 24, bottom: 8 }) + + Divider().strokeWidth(8).color('#F1F3F5') + List() { + ForEach([4, 5], (item: number) => { + ListItem() { + Text('list' + item).width('100%').fontSize(14).fontColor('#182431').textAlign(TextAlign.Start) + }.width(244).height(48) + }, (item: number) => item.toString()) + }.padding({ left: 24, top: 8 }) + + // 使用纵向分割线场景 + Text('Vertical divider').fontSize(9).fontColor(0xCCCCCC) + Column() { + Column() { + Row().width(288).height(64).backgroundColor('#30C9F0').opacity(0.3) + Row() { + Button('Button') + .width(136) + .height(22) + .fontSize(16) + .fontColor('#007DFF') + .fontWeight(500) + .backgroundColor(Color.Transparent) + Divider() + .vertical(true) + .height(22) + .color('#182431') + .opacity(0.6) + .margin({ left: 8, right: 8 }) + Button('Button') + .width(136) + .height(22) + .fontSize(16) + .fontColor('#007DFF') + .fontWeight(500) + .backgroundColor(Color.Transparent) + }.margin({ top: 17 }) + } + .width(336) + .height(152) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .padding(24) + } + .width('100%') + .height(168) + .backgroundColor('#F1F3F5') + .justifyContent(FlexAlign.Center) + .margin({ top: 8 }) + }.width('100%').height('100%').padding({ top: 24 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0160 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..e65c849f25dd004e852c7be6f09da937f6dd000c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0170.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column({ space: 10 }) { + // 绘制一个 150 * 80 的椭圆 + Ellipse({ width: 150, height: 80 }) + // 绘制一个 150 * 100 、线条为蓝色的椭圆环 + Ellipse() + .width(150) + .height(100) + .fillOpacity(0) + .stroke(Color.Blue) + .strokeWidth(3) + }.width('100%').height('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0170 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd22dffba117a206152ab78ca6e3c638fe7a3973 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0180.ets @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + build() { + Column() { + Column({ space: 5 }) { + Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ direction: FlexDirection.Row }) { // 子组件在容器主轴上行布局 + Text('1').width('20%').height(50).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(50).backgroundColor(0xD2B48C) + Text('3').width('20%').height(50).backgroundColor(0xF5DEB3) + Text('4').width('20%').height(50).backgroundColor(0xD2B48C) + } + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ direction: FlexDirection.RowReverse }) { // 子组件在容器主轴上反向行布局 + Text('1').width('20%').height(50).backgroundColor(0xF5DEB3) + Text('2').width('20%').height(50).backgroundColor(0xD2B48C) + Text('3').width('20%').height(50).backgroundColor(0xF5DEB3) + Text('4').width('20%').height(50).backgroundColor(0xD2B48C) + } + .height(70) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ direction: FlexDirection.Column }) { // 子组件在容器主轴上列布局 + Text('1').width('100%').height(40).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(40).backgroundColor(0xD2B48C) + Text('3').width('100%').height(40).backgroundColor(0xF5DEB3) + Text('4').width('100%').height(40).backgroundColor(0xD2B48C) + } + .height(160) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + + Text('direction:ColumnReverse').fontSize(9).fontColor(0xCCCCCC).width('90%') + Flex({ direction: FlexDirection.ColumnReverse }) { // 子组件在容器主轴上反向列布局 + Text('1').width('100%').height(40).backgroundColor(0xF5DEB3) + Text('2').width('100%').height(40).backgroundColor(0xD2B48C) + Text('3').width('100%').height(40).backgroundColor(0xF5DEB3) + Text('4').width('100%').height(40).backgroundColor(0xD2B48C) + } + .height(160) + .width('90%') + .padding(10) + .backgroundColor(0xAFEEEE) + }.width('100%').margin({ top: 5 }) + }.width('100%').height('100%') + } +} +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0180 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1:string | undefined = '' + @State width1:number | undefined = 0 + @State height1:number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..23e96d705577ea26c76a0020e0081a0a107384e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0200.ets @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; +import { Controller, Params, builder } from "./Controller" +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + Column() { + Hyperlink('https://example.com/') { + Image($r('app.media.cat')) + .width(200) + .height(100) + } + } + + Column() { + Hyperlink('https://example.com/', 'Go to the developer website') { + } + .color(Color.Blue) + } + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0200 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac025d906c57857ef575a5d20c75303a758b5f9e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0210.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 webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('50%') + .backgroundColor('#ffff00') + .onReady(() => { + this.context.fillStyle = "#00ff00" + this.context.fillRect(0, 0, 100, 100) + let pixel = this.context.getPixelMap(0, 0, 100, 100) + let image = new ImageBitmap(pixel) + this.context.drawImage(image, 100, 100) + }) + + } + .width('100%') + .height('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0210 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f1c8568ac05b845caf9de979732b098d982e41c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0240.ets @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + Line() + .width(200) + .height(150) + .startPoint([50, 50]) + .endPoint([150, 150]) + .strokeWidth(5) + .stroke(Color.Orange) + .strokeOpacity(0.5) + .backgroundColor('#F5F5F5') + // strokeDashOffset用于定义关联虚线strokeDashArray数组渲染时的偏移 + Line() + .width(200) + .height(150) + .startPoint([0, 0]) + .endPoint([100, 100]) + .stroke(Color.Black) + .strokeWidth(3) + .strokeDashArray([10, 3]) + .strokeDashOffset(5) + .backgroundColor('#F5F5F5') + }.width('100%').height('100%').padding({ top: 24 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0240 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2877e3b4343c0abd435fdfa1300c343f9964f65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0260.ets @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State start: boolean = false + @State src: string = '' + @State marqueeText: string = 'Running Marquee' + private fromStart: boolean = true + private step: number = 10 + private loop: number = Number.POSITIVE_INFINITY + + build() { + Column() { + Marquee({ + start: this.start, + step: this.step, + loop: this.loop, + fromStart: this.fromStart, + src: this.marqueeText + this.src + }) + .marqueeUpdateStrategy(MarqueeUpdateStrategy.PRESERVE_POSITION) + .width('300vp') + .height('80vp') + .fontColor('#FFFFFF') + .fontSize('48fp') + .fontWeight(700) + .backgroundColor('#182431') + .margin({ bottom: '40vp' }) + .onStart(() => { + console.info('Succeeded in completing the onStart callback of marquee animation') + }) + .onBounce(() => { + console.info('Succeeded in completing the onBounce callback of marquee animation') + }) + .onFinish(() => { + console.info('Succeeded in completing the onFinish callback of marquee animation') + }) + }.width('100%').height('100%').padding({ top: 24 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0260 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..9126788212a26af01fd200b7fe15d8b991610496 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0280.ets @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + private offCanvas: OffscreenCanvas = new OffscreenCanvas(600, 600) + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() =>{ + let offContext = this.offCanvas.getContext("2d", this.settings) + offContext.font = '30px sans-serif' + offContext.fillText("Hello px", 20, 60) + offContext.font = '30vp sans-serif' + offContext.fillText("Hello vp", 20, 100) + let image = this.offCanvas.transferToImageBitmap() + this.context.transferFromImageBitmap(image) + }) + } + .width('100%') + .height('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0280 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e432608cc9114e899e2771eaf905bb0145e4d05 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0290.ets @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + private offCanvas: OffscreenCanvas = new OffscreenCanvas(200, 300) + + build() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Start, justifyContent: FlexAlign.Start }) { + Column() { + Canvas(this.context) + .width('100%') + .height('100%') + .borderWidth(5) + .borderColor('#057D02') + .backgroundColor('#FFFFFF') + .onReady(() => { + let offContext = this.offCanvas.getContext("2d", this.settings) + offContext.fillStyle = '#CDCDCD' + offContext.fillRect(0, 0, this.offCanvas.width, 150) + let image = this.offCanvas.transferToImageBitmap() + this.context.setTransform(1, 0, 0, 1, 50, 200) + this.context.transferFromImageBitmap(image) + }) + } + }.width('100%').height('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0290 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b00f017517f73d371b8146840761c18c597248a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0300.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + private path2Da: Path2D = new Path2D("M250 150 L150 350 L350 350 Z") + private path2Db: Path2D = new Path2D() + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() =>{ + this.path2Db.addPath(this.path2Da) + this.context.stroke(this.path2Db) + }) + } + .width('100%') + .height('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0300 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..4695cb5264c5d7721a59138578dba27ee5337f35 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0320.ets @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode, LengthUnit } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + @State passwords: Number[] = [] + @State message: string = 'please input password!' + private patternLockController: PatternLockController = new PatternLockController() + + build() { + Column() { + Text(this.message).textAlign(TextAlign.Center).margin(20).fontSize(20) + PatternLock(this.patternLockController) + .sideLength(200) + .circleRadius(9) + .pathStrokeWidth(18) + .activeColor('#B0C4DE') + .selectedColor('#228B22') + .pathColor('#90EE90') + .backgroundColor('#F5F5F5') + .autoReset(true) + .activateCircleStyle({ + color: '#90EE90', + radius: { value: 16, unit: LengthUnit.VP }, + enableWaveEffect: true + }) + .onDotConnect((index: number) => { + console.log("onDotConnect index: " + index) + }) + .onPatternComplete((input: Array) => { + // 输入的密码长度小于5时,提示重新输入 + if (input.length < 5) { + this.message = 'The password length needs to be greater than 5, please enter again.' + return + } + // 判断密码长度是否大于0 + if (this.passwords.length > 0) { + // 判断两次输入的密码是否相同,相同则提示密码设置成功,否则提示重新输入 + if (this.passwords.toString() === input.toString()) { + this.passwords = input + this.message = 'Set password successfully: ' + this.passwords.toString() + this.patternLockController.setChallengeResult(PatternLockChallengeResult.CORRECT) + } else { + this.message = 'Inconsistent passwords, please enter again.' + this.patternLockController.setChallengeResult(PatternLockChallengeResult.WRONG) + } + } else { + // 提示第二次输入密码 + this.passwords = input + this.message = "Please enter again." + } + }) + Button('Reset PatternLock').margin(30).onClick(() => { + // 重置密码锁 + this.patternLockController.reset() + this.passwords = [] + this.message = 'Please input password' + }) + }.width('100%').height('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0320 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..41759807e2a80a4bf69b38cea846599db01b8062 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0330.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + // 在 100 * 100 的矩形框中绘制一个三角形,起点(0, 0),经过(50, 100),终点(100, 0) + Polygon({ width: 100, height: 100 }) + .points([[0, 0], [50, 100], [100, 0]]) + .fill(Color.Green) + // 在 100 * 100 的矩形框中绘制一个四边形,起点(0, 0),经过(0, 100)和(100, 100),终点(100, 0) + Polygon().width(100).height(100) + .points([[0, 0], [0, 100], [100, 100], [100, 0]]) + .fillOpacity(0) + .strokeWidth(5) + .stroke(Color.Blue) + // 在 100 * 100 的矩形框中绘制一个五边形,起点(50, 0),依次经过(0, 50)、(20, 100)和(80, 100),终点(100, 50) + Polygon().width(100).height(100) + .points([[50, 0], [0, 50], [20, 100], [80, 100], [100, 50]]) + .fill(Color.Red) + .fillOpacity(0.6) + }.width('100%').height('100%').padding({ top: 24 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0330 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ca7ed811253bb1f05839e30c6c15f3fc6f5ab8a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0340.ets @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column({ space: 10 }) { + // 在 100 * 100 的矩形框中绘制一段折线,起点(0, 0),经过(20,60),到达终点(100, 100) + Polyline({ width: 100, height: 100 }) + .points([[0, 0], [20, 60], [100, 100]]) + .fillOpacity(0) + .stroke(Color.Blue) + .strokeWidth(3) + // 在 100 * 100 的矩形框中绘制一段折线,起点(20, 0),经过(0,100),到达终点(100, 90) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(8) + .points([[20, 0], [0, 100], [100, 90]]) + // 设置折线拐角处为圆弧 + .strokeLineJoin(LineJoinStyle.Round) + // 设置折线两端为半圆 + .strokeLineCap(LineCapStyle.Round) + }.width('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0340 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..00de009e9be7c28c163d00d4bb1b055e5704bd0a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0400.ets @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Row() { + RelativeContainer() { + Row() + .width(100) + .height(100) + .backgroundColor('#a3cf62') + .alignRules({ + top: { anchor: "__container__", align: VerticalAlign.Top }, + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, + left: { anchor: "__container__", align: HorizontalAlign.Start }, + right: { anchor: "__container__", align: HorizontalAlign.End }, + bias: { vertical: 0.3 } + }) + .id("row1") + } + .width(300).height(300) + .margin({ left: 50 }) + .border({ width: 2, color: "#6699FF" }) + } + .height('100%') + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0400 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..80ae98018e9a747e6c0ab73d38dc82bc5c9c4daf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0410.ets @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + Text('The second line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%') + RowSplit() { + Text('1').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('2').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('3').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + Text('4').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center) + Text('5').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center) + } + .resizeable(true) // 可拖动 + .width('90%').height(100) + }.width('100%').margin({ top: 5 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0410 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..29217f63f98f99fdea2617cb1af6b76197d881ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0420.ets @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + // 设置子组件水平方向的间距为5 + Text('space').width('90%') + Row({ space: 5 }) { + Row().width('30%').height(50).backgroundColor(0xAFEEEE) + Row().width('30%').height(50).backgroundColor(0x00FFFF) + }.width('90%').height(107).border({ width: 1 }) + + // 设置子元素垂直方向对齐方式 + Text('alignItems(Bottom)').width('90%') + Row() { + Row().width('30%').height(50).backgroundColor(0xAFEEEE) + Row().width('30%').height(50).backgroundColor(0x00FFFF) + }.width('90%').alignItems(VerticalAlign.Bottom).height('15%').border({ width: 1 }) + }.width('100%').height('100%').padding({ top: 24 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0420 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..4538d553f9a78fc7c8aeaad9541c40041834c0b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0450.ets @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import webview from '@ohos.web.webview'; +import { BuilderNode, NodeRenderType, FrameNode } from '@ohos.arkui.node'; +import { Controller, Params, builder } from './Controller'; +import business_error from '@ohos.base'; + +@Component +struct Component1 { + @ObjectLink params: Params + + build() { + Column() { + // 文本大小写展示设置 + Text('Text Case').fontSize(9).fontColor(0xCCCCCC) + Text() { + Span('I am Lower-span').fontSize(12) + .textCase(TextCase.LowerCase) + .decoration({ type: TextDecorationType.None }) + } + + Text() { + Span('I am Upper-span').fontSize(12) + .textCase(TextCase.UpperCase) + .decoration({ type: TextDecorationType.None }) + } + }.width('100%').height('100%').padding({ top: 24 }) + } +} + +@Builder +export function DisplayBuilder(params: Params) { + Component1({ params: params }) + .backgroundColor(Color.Green) +} + +@Entry +@Component +export struct UIComponentSpecialComponentsFrameNodeTextureXport0450 { + browserTabController: WebviewController = new webview.WebviewController() + private controller1 = new Controller() + private controller2 = new Controller() + + aboutToAppear() { + // 配置web开启调试模式。 + webview.WebviewController.setWebDebuggingAccess(true); + } + + @State surfaceId1: string | undefined = '' + @State width1: number | undefined = 0 + @State height1: number | undefined = 0 + + build() { + Row() { + Column() { + Scroll() { + Web({ src: $rawfile("test.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .borderWidth(5) + .height(500) + .borderColor(Color.Red) + .enableNativeEmbedMode(true)// 获取embed标签的生命周期变化数据。 + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + this.surfaceId1 = embed.surfaceId as string + this.width1 = embed.info?.width + this.height1 = embed.info?.height + + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)) + let surfaceId = embed.surfaceId as string + builder.textureBuilder = new BuilderNode(this.getUIContext(), + { surfaceId: surfaceId, type: NodeRenderType.RENDER_TYPE_TEXTURE }); + builder.textureBuilder.build(wrapBuilder(DisplayBuilder), { + text: "Texture", + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + + this.controller2.setRoot(builder.textureBuilder.getFrameNode() as FrameNode) + this.controller2.rebuild() + + } else if (embed.status == NativeEmbedStatus.UPDATE) { + } else { + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + builder.textureBuilder?.postTouchEvent(touch.touchEvent) + }) + }.width("100%").height(350).scrollBar(BarState.On) + + + Scroll() { + Column() { + + Button('RENDER_TYPE_DISPLAY').id('render_type_display').onClick(() => { + builder.textureBuilder1 = new BuilderNode(this.getUIContext(), + { surfaceId: this.surfaceId1, type: NodeRenderType.RENDER_TYPE_DISPLAY }); + builder.textureBuilder1.build(wrapBuilder(DisplayBuilder), { + text: "dynamic", + width: px2vp(this.width1), + height: px2vp(this.height1) + }); + + this.controller1.setRoot(builder.textureBuilder1.getFrameNode() as FrameNode) + this.controller1.rebuild() + }) + NodeContainer(this.controller2).borderWidth(4).borderColor(Color.Blue) + + NodeContainer(this.controller1).borderWidth(4).borderColor(Color.Blue) + } + .backgroundColor(Color.Pink) + }.width("100%").height(400).border({ width: 1 }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..443483918ea4ca4a9a19c47d7893db06882f0ed7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0010.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 300, height: 100 }; + this.setMeasuredSize(sizeRes); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + + +class mNodeController0010 extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.size = { width: 100, height: 100 }; + renderNode.backgroundColor = 0xffff0000; + } + return this.rootNode; + } +} +@Entry +@Component +struct UIFramenodeMeasureandlayout0010 { + private nodeController: MyNodeController = new MyNodeController(); + private mNodeController0010: mNodeController0010 = new mNodeController0010(); + build() { + Row() { + Column() { + Text("onMeasure 修改尺寸300*100") + NodeContainer(this.nodeController) + + Text("原生尺寸100*100") + NodeContainer(this.mNodeController0010) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d7d318c17f928c3a079bdcebfaab27de0a86493 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0020.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + public mConstraint: string | undefined = undefined; + + onMeasure(constraint: LayoutConstraint): void { + this.mConstraint = + "onMeasure constraint==" + JSON.stringify(constraint.maxSize) + ",,==" + JSON.stringify(constraint.minSize) + + ",,,==" + JSON.stringify(constraint.percentReference) + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getConstraint() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.mConstraint) + return this.rootNode?.mConstraint; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0020 { + private nodeController: MyNodeController = new MyNodeController(); + @State onMeasureConstraint: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getonMeasureConstraint").id("click0020").onClick(() => { + this.onMeasureConstraint = this.nodeController.getConstraint() + }) + Text(this.onMeasureConstraint) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..0db0659dea109b13e5bb8599710d4fc737acf3d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0030.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + for (let i = 0;i < this.getChildrenCount();i++) { + let child = this.getChild(i); + if (child) { + child.layout({ + x: 20, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + } + this.setLayoutPosition(position); + } + + onDraw(context: DrawContext) { + const canvas = context.canvas; + const pen = new drawing.Pen(); + pen.setStrokeWidth(5); + pen.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachPen(pen); + canvas.drawRect({ left: 0, right: this.width, top: 0, bottom: this.width }); + canvas.detachPen(); + } + + addWidth() { + this.width += 10; + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0030 { + private nodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + Button('Invalidate') + .onClick(() => { + this.nodeController?.rootNode?.addWidth(); + this.nodeController?.rootNode?.invalidate(); + }) + Button('UpdateLayout') + .onClick(() => { + this.nodeController?.rootNode?.setNeedsLayout(); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..650f4cf18bc1729a909833d8810861c4b1a2c9c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0040.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 { + UIContext, + DrawContext, + FrameNode, + NodeController, + LayoutConstraint, + Size, + Position, + BuilderNode +} from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() {} + .width('100%') + .height('100%') + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController040 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 300, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + getMeasuredSize() { + let measuredSize = this.rootNode?.getMeasuredSize(); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0020 getMeasuredSize==" + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize); + + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0040 { + private nodeController: NodeController040 = new NodeController040(); + @State getMeasuredSize: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getMeasuredSize") + .id("click0040") + .onClick(() => { + this.getMeasuredSize = this.nodeController.getMeasuredSize() + }) + Text(this.getMeasuredSize) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..a51e08e1e9fae29eb89840f4dff731af1c16294d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0050.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: undefined!, height: undefined!}; + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + this.setLayoutPosition(position); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } + + getMeasuredSize() { + let measuredSize = this.rootNode?.getMeasuredSize(); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0050" + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize) + } +} + +@Entry +@Component +struct UIFramenodeMeasureandlayout0050 { + private nodeController: MyNodeController = new MyNodeController(); + @State mgetMeasuredSize :string |undefined = undefined + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getMeasuredSize").id("click0050").onClick(()=>{ + this.mgetMeasuredSize = this.nodeController.getMeasuredSize() + }) + Text(this.mgetMeasuredSize) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..fca9d5a2a45c4fa6e193db151db7df701850f029 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0060.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: null!, height:null! }; + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + this.setLayoutPosition(position); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } + + getMeasuredSize() { + let measuredSize = this.rootNode?.getMeasuredSize(); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060" + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize) + } +} + +@Entry +@Component +struct UIFramenodeMeasureandlayout0060 { + private nodeController: MyNodeController = new MyNodeController(); + @State mgetMeasuredSize :string |undefined = undefined + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getMeasuredSize").id("click0060").onClick(()=>{ + this.mgetMeasuredSize = this.nodeController.getMeasuredSize() + }) + Text(this.mgetMeasuredSize) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..6202fe21fa26335e31030dfba87c3ea4e07ccb5d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0070.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 165, height: 165}; + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + this.setLayoutPosition(position); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } + + getMeasuredSize() { + let measuredSize = this.rootNode?.getMeasuredSize(); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060" + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize) + } +} + +@Entry +@Component +struct UIFramenodeMeasureandlayout0070 { + private nodeController: MyNodeController = new MyNodeController(); + @State mgetMeasuredSize :string |undefined = undefined + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getMeasuredSize").id("click0070").onClick(()=>{ + this.mgetMeasuredSize = this.nodeController.getMeasuredSize() + }) + Text(this.mgetMeasuredSize) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..f78aee88d1f31772b486c84f72a1b8f7e5bf7552 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0080.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 0, height: 0 }; + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + this.setLayoutPosition(position); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } + + getMeasuredSize() { + let measuredSize = this.rootNode?.getMeasuredSize(); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0060" + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize) + } +} + +@Entry +@Component +struct UIFramenodeMeasureandlayout0080 { + private nodeController: MyNodeController = new MyNodeController(); + @State mgetMeasuredSize :string |undefined = undefined + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getMeasuredSize").id("click0060").onClick(()=>{ + this.mgetMeasuredSize = this.nodeController.getMeasuredSize() + }) + Text(this.mgetMeasuredSize) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d6753591737a7c97e6d96634fc5f6919d3b2126 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0090.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: -100, height: -100 }; + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + this.setLayoutPosition(position); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } + + getMeasuredSize() { + let measuredSize = this.rootNode?.getMeasuredSize(); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0090" + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize) + } +} + +@Entry +@Component +struct UIFramenodeMeasureandlayout0090 { + private nodeController: MyNodeController = new MyNodeController(); + @State mgetMeasuredSize :string |undefined = undefined + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getMeasuredSize").id("click0090").onClick(()=>{ + this.mgetMeasuredSize = this.nodeController.getMeasuredSize() + }) + Text(this.mgetMeasuredSize) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..23f40fc4371653d7add8f903c08a31ddfaa0056f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0100.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 325.99, height: 325.99 }; + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + this.setLayoutPosition(position); + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + this.rootNode?.commonAttribute?.size({ width: 100, height: 100 }).backgroundColor(Color.Green); + return this.rootNode; + } + + getMeasuredSize() { + let measuredSize = this.rootNode?.getMeasuredSize(); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0100" + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize) + } +} + +@Entry +@Component +struct UIFramenodeMeasureandlayout0100 { + private nodeController: MyNodeController = new MyNodeController(); + @State mgetMeasuredSize :string |undefined = undefined + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getMeasuredSize").id("click0100").onClick(()=>{ + this.mgetMeasuredSize = this.nodeController.getMeasuredSize() + }) + Text(this.mgetMeasuredSize) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9b4c7fae9f2881d3f1ea1bb8959bdfeba058ca7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0110.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + public newOnlayout: string | undefined = undefined; + + onLayout(position: Position): void { + this.setLayoutPosition({ x: 200, y: 200 }); + this.newOnlayout = `getLayoutPosition x=${this.getLayoutPosition().x},y=${this.getLayoutPosition().y}` + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getNewOnLayout() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.newOnlayout) + return this.rootNode?.newOnlayout; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0110 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0110") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..124c95f1a3ae6091473dd85308842f8d955c745a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0120.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public x: number | undefined | null + public y: number | undefined | null + public mGetLayoutPosition : string | undefined | null = undefined + constructor(uiContext: UIContext, value: number | undefined | null) { + super(uiContext) + this.x = value + this.y = value + } + + onLayout(position: Position): void { + this.setLayoutPosition({ x: this.x, y: this.y }); + console.info('SUB_ACE_ULFRAMENODE_MEASUREANDLAYOUT_0120', `MyFrameNodeLayout== getLayoutPosition x=${this.getLayoutPosition() + .x},y=${this.getLayoutPosition().y}`) + this.mGetLayoutPosition = "getNewLayoutPosition x="+this.getLayoutPosition().x +" getNewLayoutPosition y=" + this.getLayoutPosition().y + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context,330); + return this.rootNode; + } + getgetNewOnLayout (){ + return this.rootNode?.mGetLayoutPosition + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0120 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined | null= undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0120") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getgetNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1cf25d7e0ab970791c723d1adc2764397993a66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0130.ets @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + UIContext, + DrawContext, + FrameNode, + NodeController, + LayoutConstraint, + Size, + Position, + BuilderNode +} from '@kit.ArkUI'; + +function GetChildLayoutConstraint(constraint: LayoutConstraint, child: FrameNode): LayoutConstraint { + const size = child.getUserConfigSize(); + const width = Math.max( + Math.min(constraint.maxSize.width, size.width.value), + constraint.minSize.width + ); + const height = Math.max( + Math.min(constraint.maxSize.height, size.height.value), + constraint.minSize.height + ); + const finalSize: Size = { width, height }; + const res: LayoutConstraint = { + maxSize: finalSize, + minSize: finalSize, + percentReference: finalSize + }; + + return res; +} + +class MyFrameNode extends FrameNode { + public width: number = 10; + private space: number = 1; + public newChildLayout: string | undefined = undefined; + + onMeasure(constraint: LayoutConstraint): void { + let sizeRes: Size = { width: 100, height: 100 }; + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + if (child) { + let childConstraint = GetChildLayoutConstraint(constraint, child); + child.measure(childConstraint); + let size = child.getMeasuredSize(); + sizeRes.height += size.height + this.space; + sizeRes.width = Math.max(sizeRes.width, size.width); + } + } + this.setMeasuredSize(sizeRes); + } + + onLayout(position: Position): void { + let y = 0; + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130 old onLayout==" + this.getChildrenCount()) + for (let i = 0; i < this.getChildrenCount(); i++) { + let child = this.getChild(i); + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130 onLayout child==" + JSON.stringify(child?.getPositionToScreen())) + if (child) { + child.layout({ + x: 220, + y: y + }); + y += child.getMeasuredSize().height + this.space; + } + this.newChildLayout = JSON.stringify(child?.getPositionToScreen()) + console.log("SUB_ACE_UI_FRAMENODE_MEASUREANDLAYOUT_0130 new onLayout child==" + + JSON.stringify(child?.getPositionToScreen())) + + } + this.setLayoutPosition(position); + } +} + +@Component +struct TestComponent { + build() { + Column() { + Column() { + Text("this isBuilderNode") + .fontWeight(FontWeight.Bold) + .fontSize(10) + .fontColor(Color.White) + } + .justifyContent(FlexAlign.Center) + .width(150) + .height(150) + .borderRadius(10) + .backgroundColor(0xf56c6c) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .margin({ top: 5 }) + .useShadowBatching(true) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController106 extends NodeController { + private rootNode: MyFrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.size = { width: 200, height: 200 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } + + getnewChildLayout() { + let newChildLayout: string | undefined = undefined + if (this.rootNode != null) { + newChildLayout = this.rootNode.newChildLayout; + } + return newChildLayout + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0130 { + private nodeController: NodeController106 = new NodeController106(); + @State getnewChildLayoutText: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("child getPositionToScreen").id("click0130").onClick(() => { + this.getnewChildLayoutText = this.nodeController.getnewChildLayout() + }) + Text(this.getnewChildLayoutText) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..6fa5056d3bc4b8702cca1a9e4c504394900534ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0140.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 { NodeController, FrameNode, UIContext } from '@kit.ArkUI'; + +const TEST_TAG : string = "FrameNode" +class MyNodeController extends NodeController { + public frameNode: FrameNode | null = null; + public childList: Array = new Array(); + private rootNode: FrameNode | null = null; + private uiContext: UIContext | null = null; + private childrenCount: number = 0; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.childrenCount = this.childrenCount + 1; + this.uiContext = uiContext; + this.frameNode = new FrameNode(uiContext); + this.rootNode.appendChild(this.frameNode); + for (let i = 0; i < 10; i++) { + let childNode = new FrameNode(uiContext); + this.childList.push(childNode); + this.frameNode.appendChild(childNode); + } + return this.rootNode; + } + + appendChild() { + let childNode = new FrameNode(this.uiContext!); + this.rootNode!.appendChild(childNode); + this.childrenCount = this.childrenCount + 1; + } + + getMeasuredSize() { + let measuredSize = this.frameNode?.getMeasuredSize(); + console.log(TEST_TAG + JSON.stringify(measuredSize)); + return JSON.stringify(measuredSize) + } + +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0140 { + private myNodeController: MyNodeController = new MyNodeController(); + @State index : number = 0; + @State mgetMeasuredSize :string |undefined =undefined + build() { + Column(){ + NodeContainer(this.myNodeController) + Button("getMeasuredSize") + .id("click0140") + .width(300) + .onClick(()=>{ + this.mgetMeasuredSize = this.myNodeController.getMeasuredSize(); + }) + Text(this.mgetMeasuredSize) + + } + .width("100%") + .height("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ea90ffba217535804070863f08e297b7f47cdd8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0150.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public newOnlayout: string | undefined = undefined; + + onLayout(position: Position): void { + this.setLayoutPosition({ x: undefined, y: undefined }); + this.newOnlayout = `getLayoutPosition x=${this.getLayoutPosition().x},y=${this.getLayoutPosition().y}` + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getNewOnLayout() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.newOnlayout) + return this.rootNode?.newOnlayout; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0150 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0150") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae6be28e7ab322f3453b497cf52a835b4bb9ebc9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0160.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + public newOnlayout: string | undefined = undefined; + + onLayout(position: Position): void { + this.setLayoutPosition({ x: null, y: null }); + this.newOnlayout = `getLayoutPosition x=${this.getLayoutPosition().x},y=${this.getLayoutPosition().y}` + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getNewOnLayout() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.newOnlayout) + return this.rootNode?.newOnlayout; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0160 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0160") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..cee0f4ab45dd0e20b094e9753a2455e47fbd2496 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0170.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + public newOnlayout: string | undefined = undefined; + + onLayout(position: Position): void { + this.setLayoutPosition({ x: 165, y: 165 }); + this.newOnlayout = `getLayoutPosition x=${this.getLayoutPosition().x},y=${this.getLayoutPosition().y}` + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getNewOnLayout() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.newOnlayout) + return this.rootNode?.newOnlayout; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0170 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0170") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..9689aaffa9abf4fe01672da73187c3d3ae0a4e0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0180.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + public newOnlayout: string | undefined = undefined; + + onLayout(position: Position): void { + this.setLayoutPosition({ x: 0, y: 0 }); + this.newOnlayout = `getLayoutPosition x=${this.getLayoutPosition().x},y=${this.getLayoutPosition().y}` + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getNewOnLayout() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.newOnlayout) + return this.rootNode?.newOnlayout; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0180 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0180") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..581ef6923026cb782974c1653f582d625957680d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0190.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + public newOnlayout: string | undefined = undefined; + + onLayout(position: Position): void { + this.setLayoutPosition({ x: -100, y: -100}); + this.newOnlayout = `getLayoutPosition x=${this.getLayoutPosition().x},y=${this.getLayoutPosition().y}` + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getNewOnLayout() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.newOnlayout) + return this.rootNode?.newOnlayout; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0190 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0190") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8ac2c656587b1007d59a658e6852c0d0c69c781 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0200.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 { UIContext, DrawContext, FrameNode, NodeController, LayoutConstraint, Size, Position } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyFrameNode extends FrameNode { + public width: number = 10; + public newOnlayout: string | undefined = undefined; + + onLayout(position: Position): void { + this.setLayoutPosition({ x: 325.99, y: 325.99 }); + this.newOnlayout = `getLayoutPosition x=${this.getLayoutPosition().x},y=${this.getLayoutPosition().y}` + } +} + +class MyNodeController extends NodeController { + public rootNode: MyFrameNode | null = null; + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new MyFrameNode(context); + return this.rootNode; + } + + getNewOnLayout() { + console.log("this.rootNode?.mConstraint==" + this.rootNode?.newOnlayout) + return this.rootNode?.newOnlayout; + } +} + +@Entry +@Component +struct UIFrameNodeMeasureAndLayout0200 { + private nodeController: MyNodeController = new MyNodeController(); + @State getNewOnLayout: string | undefined = undefined + + build() { + Row() { + Column() { + NodeContainer(this.nodeController) + Button("getNewOnLayout") + .id("click0200") + .onClick(() => { + this.getNewOnLayout = this.nodeController.getNewOnLayout() + }) + Text(this.getNewOnLayout) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..00b15151c17234c9c3890145123fbf3858263a87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0010.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 0, + right: 200, + top: 0, + bottom: 200 + }); + canvas.detachBrush(); + + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 100, + right: 300, + top: 100, + bottom: 300 + }); + canvas.detachBrush(); + } +} + +const renderNode = new MyRenderNode(); +renderNode.frame = { + x: 100, + y: 100, + width: 200, + height: 200 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button("Button") + .id("Button002") + .onClick(() => { + renderNode.opacity = 0.5; + renderNode.markNodeGroup = true; + }).margin({ top: 50 }) + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..09e31bb4a6ae2c8866a5bc81fbdb90e633696403 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0020.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 255, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 0, + right: 200, + top: 0, + bottom: 200 + }); + canvas.detachBrush(); + + brush.setColor({ + alpha: 255, + red: 0, + green: 255, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 100, + right: 300, + top: 100, + bottom: 300 + }); + canvas.detachBrush(); + } +} + +const renderNode = new MyRenderNode(); +renderNode.frame = { + x: 100, + y: 100, + width: 200, + height: 200 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0020 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button("Button") + .id("Button002") + .onClick(() => { + renderNode.opacity = 0.5; + renderNode.markNodeGroup = false; + }).margin({ top: 50 }) + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..95c9dffdac00930abba8eb8c0d5308e298d6b1ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0030.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 { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +const renderNode = new MyRenderNode(); +renderNode.frame = { x: 100, y: 100, width: 200, height: 200 }; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0060 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button("Button") + .id("Button002") + .onClick(() => { + renderNode.opacity = 0.5; + }).margin({ top: 50 }) + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbba40e0a64625f0256b7ee05565017765b0d6af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0060.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 { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +const renderNode = new MyRenderNode(); +renderNode.frame = { x: 100, y: 100, width: 200, height: 200 }; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0060 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button("Button") + .id("Button002") + .onClick(() => { + }).margin({ top: 50 }) + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b97969d6fd3344ecc95ea665150b87124d423a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0070.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 { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +const renderNode = new MyRenderNode(); +renderNode.frame = { x: 100, y: 100, width: 200, height: 200 }; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0070 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button("Button") + .id("Button002") + .onClick(() => { + renderNode.markNodeGroup = false; + }).margin({ top: 50 }) + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a885d4ffc522d80bc0577aa36e6e97035714448 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0080.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 { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + canvas + } +} + +const renderNode = new MyRenderNode(); +renderNode.frame = { x: 100, y: 100, width: 200, height: 200 }; +renderNode + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0080 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button("Button") + .id("Button002") + .onClick(() => { + renderNode.markNodeGroup = true; + }).margin({ top: 50 }) + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ee99b40d56934bd5821f55c365521143346afbe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0150.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +const newNode = new MyRenderNode(); +newNode.frame = { x: 0, y: 0, width: 200, height: 200 }; +newNode.backgroundColor = 0XFFFFFFFF; +newNode.markNodeGroup = true; +newNode.opacity = 0.5; + +const newNode1 = new MyRenderNode(); +newNode1.frame = { x: 200, y: 0, width: 200, height: 200 }; +newNode1.backgroundColor = 0XFFFFFFFF; +newNode1.markNodeGroup = false; +newNode1.opacity = 0.5; + +const newNode2 = new MyRenderNode(); +newNode2.frame = { x: 0, y: 200, width: 200, height: 200 }; +newNode2.backgroundColor = 0XFFFFFFFF; +newNode2.opacity = 0.5; + +const newNode3 = new MyRenderNode(); +newNode3.frame = { x: 200, y: 200, width: 200, height: 200 }; +newNode3.backgroundColor = 0XFFFFFFFF; +newNode3.markNodeGroup = true; +newNode3.opacity = 0.5; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + rootRenderNode: RenderNode | null = null + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootRenderNode = this.rootNode.getRenderNode(); + if (this.rootRenderNode !== null) { + this.rootRenderNode.appendChild(newNode); + this.rootRenderNode.appendChild(newNode1); + this.rootRenderNode.appendChild(newNode2); + this.rootRenderNode.appendChild(newNode3); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0150 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..007c2e521257a710044bb0105d991b6c4ea192f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0160.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 100, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 0, + right: 200, + top: 0, + bottom: 200 + }); + canvas.detachBrush(); + + brush.setColor({ + alpha: 100, + red: 0, + green: 255, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 100, + right: 300, + top: 100, + bottom: 300 + }); + canvas.detachBrush(); + } +} + +const renderNode = new MyRenderNode(); +renderNode.frame = { + x: 100, + y: 100, + width: 200, + height: 200 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0160 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Button("Button") + .id("Button002") + .onClick(() => { + renderNode.opacity = 0.5; + renderNode.markNodeGroup = true; + }).margin({ top: 50 }) + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..f95d25f86a885d27909af92ac2c473852237b8ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0170.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 100, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 100, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +const newNode = new MyRenderNode(); +newNode.frame = { x: 0, y: 0, width: 200, height: 200 }; +newNode.backgroundColor = 0XFFFFFFFF; +newNode.markNodeGroup = false; +newNode.opacity = 0.5; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + rootRenderNode: RenderNode | null = null + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootRenderNode = this.rootNode.getRenderNode(); + if (this.rootRenderNode !== null) { + this.rootRenderNode.appendChild(newNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0170 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..e515ac52310adf0991b61b36fb1f0ef14f3e65b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0180.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +const newNode = new MyRenderNode(); +newNode.frame = { x: 0, y: 0, width: 200, height: 200 }; +newNode.backgroundColor = 0XFFFFFFFF; +newNode.markNodeGroup = true; +newNode.opacity = 0.5; + +const newNode1 = new MyRenderNode(); +newNode1.frame = { x: 0, y: 200, width: 200, height: 200 }; +newNode1.backgroundColor = 0XFFFFFFFF; +newNode1.markNodeGroup = false; +newNode1.opacity = 0.5; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + rootRenderNode: RenderNode | null = null + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootRenderNode = this.rootNode.getRenderNode(); + if (this.rootRenderNode !== null) { + this.rootRenderNode.appendChild(newNode); + this.rootRenderNode.appendChild(newNode1); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0180 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..31954b4dc1abbaffaab86a8523964b9131234e6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0190.ets @@ -0,0 +1,457 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FrameNode, NodeController, RenderNode } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + pixelMap: image.PixelMap | null = null; + + draw(context: DrawContext) { + // ts进行绘制,如果报错的话需要更新一下sdk + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 100, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 0, + right: 200, + top: 0, + bottom: 200 + }); + canvas.detachBrush(); + + brush.setColor({ + alpha: 100, + red: 0, + green: 255, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 100, + right: 300, + top: 100, + bottom: 300 + }); + canvas.detachBrush(); + } +} + +// 不支持设置undefined、null值 +// markNodeGroup:true 不透传 +const newNode = new MyRenderNode(); +newNode.frame = { + x: 100, + y: 25, + width: 150, + height: 150 +}; +newNode.backgroundColor = 0XFF0000FF; +newNode.markNodeGroup = true; +newNode.opacity = 0.5; + +// markNodeGroup:false 透传 +const newNode1 = new MyRenderNode(); +newNode1.frame = { + x: 100, + y: 195, + width: 150, + height: 130 +}; +newNode1.backgroundColor = 0xFFA434A7; +newNode1.markNodeGroup = false; +newNode1.opacity = 0.5; + +// 不设置markNodeGroup 透传 +const newNode2 = new MyRenderNode(); +newNode2.frame = { + x: 100, + y: 325, + width: 150, + height: 150 +}; +newNode2.backgroundColor = 0xFFE28460; +newNode2.opacity = 0.5; + +// 不设置opacity、markNodeGroup:true 不透传 +const newNode3 = new MyRenderNode(); +newNode3.frame = { + x: 100, + y: 475, + width: 150, + height: 150 +}; +newNode3.backgroundColor = 0xFFE28460; +newNode3.markNodeGroup = true; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode { + this.rootNode = new FrameNode(uiContext); + if (this.rootNode === null) { + return this.rootNode + } + this.rootNode.commonAttribute.width('100%') + .height('100%') + .backgroundColor(Color.Gray) + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.clipToFrame = true // 超出部分将被截掉 + } + return this.rootNode; + } + + appendchild() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.appendChild(newNode); + rootRender.appendChild(newNode1); + rootRender.appendChild(newNode2); + rootRender.appendChild(newNode3); + console.info('sally----rootRender appendchilds successfully '); + } + } + + setbackgroundColor() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.backgroundColor = 0XFF00FF00 // 绿色 + console.info('sally---- rootRender setbackgroundColor to "0XFF00FF00"'); + } + } + + updateClip(clipFlag: boolean) { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.clipToFrame = clipFlag + console.info('sally---- set rootRender clipToFrame to ' + clipFlag); + } + } + + framefirst() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.frame = { + x: 0, + y: 0, + width: 500, + height: 500 + }; + rootRender.size = { width: 400, height: 400 } + rootRender.position = { x: 10, y: 10 } + console.info('sally---- rootRender setframe before setsize and setposition '); + } + } + + frameafter() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.size = { width: 400, height: 400 } + rootRender.position = { x: 10, y: 10 } + rootRender.frame = { + x: 0, + y: 0, + width: 500, + height: 500 + }; + console.info('sally---- rootRender setframe after setsize and setposition '); + } + } + + getfirstChild() { + const firstchild = this.rootNode!.getRenderNode()?.getFirstChild() + if (firstchild) { + firstchild.backgroundColor = 0xFFE28460; + console.info('sally---- getfirstChild successfully and change backgroundColor '); + } + } + + getPreviousSibling() { + const firstchild = this.rootNode!.getRenderNode()?.getChild(1)?.getPreviousSibling() + if (firstchild) { + firstchild.backgroundColor = 0xFFE82460; + console.info('sally---- secondChild getPreviousSibling successfully and change backgroundColor '); + } + } + + insertChildAfter1() { + const rootRender = this.rootNode!.getRenderNode()! + const firstchild = this.rootNode!.getRenderNode()?.getFirstChild() + if (firstchild) { + const insertChild = new MyRenderNode() + insertChild.frame = { + x: 100, + y: 175, + width: 150, + height: 20 + }; + insertChild.backgroundColor = 0xFFE28460; + rootRender.insertChildAfter(insertChild, firstchild) + console.info('sally---- insertChildAfter1 successfully '); + } + } + + invalidateRootRender() { + const rootRender = this.rootNode!.getRenderNode() + rootRender?.invalidate() + console.info('sally---- rootRender invalidate successfully '); + } + + opacity0_5() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.opacity = 0.5 + console.info('sally---- rootRender setopacity to 0.5 successfully '); + } + } + + setPivot() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.pivot = { x: 0.5, y: 0.6 }; + rootRender.rotation = { x: 15, y: 0, z: 0 }; + rootRender.scale = { x: 0.5, y: 1 }; + console.info('sally---- rootRender setPivot{ x: 0.5, y: 0.6 } and setrotation{ x: 15, y: 0, z: 0 }' + + ' and setscale{ x: 0.5, y: 1 } successfully '); + } + } + + setPosition() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.position = { x: 10, y: 10 } + console.info('sally---- rootRender changePosition {x:10,y:10} successfully '); + } + } + + removeFirstChild() { + const rootRender = this.rootNode!.getRenderNode()! + const firstchild = this.rootNode!.getRenderNode()?.getFirstChild() + if (firstchild) { + rootRender.removeChild(firstchild) + console.info('sally---- rootRender removeFirstChild successfully '); + } + } + + setRotation() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.rotation = { x: 0, y: 30, z: 0 }; + console.info('sally---- rootRender setrotation{ x: 0, y: 30, z: 0 } successfully '); + } + } + + setShadow() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.frame = { + x: 10, + y: 10, + width: 300, + height: 400 + }; + rootRender.shadowElevation = 30; + rootRender.shadowColor = 0XFF00FF00; + rootRender.shadowOffset = { x: 10, y: 10 }; + rootRender.shadowAlpha = 0.4; + rootRender.shadowRadius = 30; + console.info('sally---- rootRender set shadowAlpha = 0.4 successfully '); + console.info('sally---- rootRender set shadowElevation = 30 successfully '); + console.info('sally---- rootRender set shadowColor = 0XFF00FF00 successfully '); + console.info('sally---- rootRender set shadowOffset = { x: 10, y: 10 } successfully '); + console.info('sally---- rootRender set shadowRadius = 30 successfully '); + } + } + + setSize() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.size = { width: 300, height: 400 }; + console.info('sally---- rootRender setSize = { width: 300, height: 400 } successfully '); + } + } + + setTransform() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.transform = [ + 1, 0, 0, 0, + 0, 2, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]; + console.info( + 'sally---- rootRender settransform = [ 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] successfully ' + ); + } + } + + setTranslation() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.translation = { x: 100, y: 0 }; + console.info('sally---- rootRender setTranslation = { x: 100, y: 0 } successfully '); + } + } + + changeShadowAlphaAndShadowColor() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.shadowColor = 0XFF000000; + rootRender.shadowAlpha = 0.9; + console.info('sally---- rootRender change shadowAlpha = 0.9 successfully '); + console.info('sally---- rootRender change shadowColor = 0XFF000000 successfully '); + } + } +} + +@Entry +@Component +struct RenderTest { + @State myController: MyNodeController = new MyNodeController(); + @State clipFlag: boolean = false + scroller: Scroller = new Scroller() + + build() { + Row() { + Column() { + Text('提供命令式渲染节点') + NodeContainer(this.myController) + .width('100%') + .height("65%") + // .layoutWeight() + + // Line().width('100%').height(1).backgroundColor(Color.Red) + + // Button("change") + // .onClick(()=>{ + // this.myController.changeOpacityAndNodeGroup() + // }) + Scroll() { + Column() { + Button("appendchild") + .id('btn1') + .onClick(() => { + this.myController.appendchild() + }).margin({ top: 4 }) + Button("frame设置在option和size后") + .id('btn5') + .onClick(() => { + this.myController.frameafter() + }).margin({ top: 4 }) + Button("setbackgroundColor") + .id('btn2') + .onClick(() => { + this.myController.setbackgroundColor() + }).margin({ top: 4 }) + Button("updateClip") + .id('btn3') + .onClick(() => { + this.myController.updateClip(this.clipFlag) + this.clipFlag = !this.clipFlag + }).margin({ top: 4 }) + Button("frame设置在option和size前") + .id('btn4') + .onClick(() => { + this.myController.framefirst() + }).margin({ top: 4 }) + + Button("getfirstChild") + .id('btn6') + .onClick(() => { + this.myController.getfirstChild() + }).margin({ top: 4 }) + Button("getPreviousSibling") + .id('btn7') + .onClick(() => { + this.myController.getPreviousSibling() + }).margin({ top: 4 }) + Button("insertChildAfter1") + .id('btn8') + .onClick(() => { + this.myController.insertChildAfter1() + }).margin({ top: 4 }) + Button("invalidateRootRender") + .id('btn9') + .onClick(() => { + this.myController.invalidateRootRender() + }).margin({ top: 4 }) + Button("setopacity0.5") + .id('btn10') + .onClick(() => { + this.myController.opacity0_5() + }).margin({ top: 4 }) + Button("setPivot x:0.5 y:0.6") + .id('btn11') + .onClick(() => { + this.myController.setPivot() + }).margin({ top: 4 }) + Button("setPosition") + .id('btn12') + .onClick(() => { + this.myController.setPosition() + }).margin({ top: 4 }) + Button("removeFirstChild") + .id('btn13') + .onClick(() => { + this.myController.removeFirstChild() + }).margin({ top: 4 }) + Button("setRotation") + .id('btn14') + .onClick(() => { + this.myController.setRotation() + }).margin({ top: 4 }) + Button("setShadow") + .id('btn15') + .onClick(() => { + this.myController.setShadow() + }).margin({ top: 4 }) + Button("setSize") + .id('btn16') + .onClick(() => { + this.myController.setSize() + }).margin({ top: 4 }) + Button("setTransform") + .id('btn17') + .onClick(() => { + this.myController.setTransform() + }).margin({ top: 4 }) + Button("setTranslation") + .id('btn18') + .onClick(() => { + this.myController.setTranslation() + }).margin({ top: 4 }) + Button("change shadowAlpha and shadowColor") + .id('btn19') + .onClick(() => { + this.myController.changeShadowAlphaAndShadowColor() + }).margin({ top: 4 }) + } + }.width('100%') + .height("35%") + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..31954b4dc1abbaffaab86a8523964b9131234e6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0200.ets @@ -0,0 +1,457 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FrameNode, NodeController, RenderNode } from '@kit.ArkUI'; +import { image } from '@kit.ImageKit'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + pixelMap: image.PixelMap | null = null; + + draw(context: DrawContext) { + // ts进行绘制,如果报错的话需要更新一下sdk + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ + alpha: 100, + red: 255, + green: 0, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 0, + right: 200, + top: 0, + bottom: 200 + }); + canvas.detachBrush(); + + brush.setColor({ + alpha: 100, + red: 0, + green: 255, + blue: 0 + }); + canvas.attachBrush(brush); + canvas.drawRect({ + left: 100, + right: 300, + top: 100, + bottom: 300 + }); + canvas.detachBrush(); + } +} + +// 不支持设置undefined、null值 +// markNodeGroup:true 不透传 +const newNode = new MyRenderNode(); +newNode.frame = { + x: 100, + y: 25, + width: 150, + height: 150 +}; +newNode.backgroundColor = 0XFF0000FF; +newNode.markNodeGroup = true; +newNode.opacity = 0.5; + +// markNodeGroup:false 透传 +const newNode1 = new MyRenderNode(); +newNode1.frame = { + x: 100, + y: 195, + width: 150, + height: 130 +}; +newNode1.backgroundColor = 0xFFA434A7; +newNode1.markNodeGroup = false; +newNode1.opacity = 0.5; + +// 不设置markNodeGroup 透传 +const newNode2 = new MyRenderNode(); +newNode2.frame = { + x: 100, + y: 325, + width: 150, + height: 150 +}; +newNode2.backgroundColor = 0xFFE28460; +newNode2.opacity = 0.5; + +// 不设置opacity、markNodeGroup:true 不透传 +const newNode3 = new MyRenderNode(); +newNode3.frame = { + x: 100, + y: 475, + width: 150, + height: 150 +}; +newNode3.backgroundColor = 0xFFE28460; +newNode3.markNodeGroup = true; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode { + this.rootNode = new FrameNode(uiContext); + if (this.rootNode === null) { + return this.rootNode + } + this.rootNode.commonAttribute.width('100%') + .height('100%') + .backgroundColor(Color.Gray) + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.clipToFrame = true // 超出部分将被截掉 + } + return this.rootNode; + } + + appendchild() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.appendChild(newNode); + rootRender.appendChild(newNode1); + rootRender.appendChild(newNode2); + rootRender.appendChild(newNode3); + console.info('sally----rootRender appendchilds successfully '); + } + } + + setbackgroundColor() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.backgroundColor = 0XFF00FF00 // 绿色 + console.info('sally---- rootRender setbackgroundColor to "0XFF00FF00"'); + } + } + + updateClip(clipFlag: boolean) { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.clipToFrame = clipFlag + console.info('sally---- set rootRender clipToFrame to ' + clipFlag); + } + } + + framefirst() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.frame = { + x: 0, + y: 0, + width: 500, + height: 500 + }; + rootRender.size = { width: 400, height: 400 } + rootRender.position = { x: 10, y: 10 } + console.info('sally---- rootRender setframe before setsize and setposition '); + } + } + + frameafter() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.size = { width: 400, height: 400 } + rootRender.position = { x: 10, y: 10 } + rootRender.frame = { + x: 0, + y: 0, + width: 500, + height: 500 + }; + console.info('sally---- rootRender setframe after setsize and setposition '); + } + } + + getfirstChild() { + const firstchild = this.rootNode!.getRenderNode()?.getFirstChild() + if (firstchild) { + firstchild.backgroundColor = 0xFFE28460; + console.info('sally---- getfirstChild successfully and change backgroundColor '); + } + } + + getPreviousSibling() { + const firstchild = this.rootNode!.getRenderNode()?.getChild(1)?.getPreviousSibling() + if (firstchild) { + firstchild.backgroundColor = 0xFFE82460; + console.info('sally---- secondChild getPreviousSibling successfully and change backgroundColor '); + } + } + + insertChildAfter1() { + const rootRender = this.rootNode!.getRenderNode()! + const firstchild = this.rootNode!.getRenderNode()?.getFirstChild() + if (firstchild) { + const insertChild = new MyRenderNode() + insertChild.frame = { + x: 100, + y: 175, + width: 150, + height: 20 + }; + insertChild.backgroundColor = 0xFFE28460; + rootRender.insertChildAfter(insertChild, firstchild) + console.info('sally---- insertChildAfter1 successfully '); + } + } + + invalidateRootRender() { + const rootRender = this.rootNode!.getRenderNode() + rootRender?.invalidate() + console.info('sally---- rootRender invalidate successfully '); + } + + opacity0_5() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.opacity = 0.5 + console.info('sally---- rootRender setopacity to 0.5 successfully '); + } + } + + setPivot() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.pivot = { x: 0.5, y: 0.6 }; + rootRender.rotation = { x: 15, y: 0, z: 0 }; + rootRender.scale = { x: 0.5, y: 1 }; + console.info('sally---- rootRender setPivot{ x: 0.5, y: 0.6 } and setrotation{ x: 15, y: 0, z: 0 }' + + ' and setscale{ x: 0.5, y: 1 } successfully '); + } + } + + setPosition() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.position = { x: 10, y: 10 } + console.info('sally---- rootRender changePosition {x:10,y:10} successfully '); + } + } + + removeFirstChild() { + const rootRender = this.rootNode!.getRenderNode()! + const firstchild = this.rootNode!.getRenderNode()?.getFirstChild() + if (firstchild) { + rootRender.removeChild(firstchild) + console.info('sally---- rootRender removeFirstChild successfully '); + } + } + + setRotation() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.rotation = { x: 0, y: 30, z: 0 }; + console.info('sally---- rootRender setrotation{ x: 0, y: 30, z: 0 } successfully '); + } + } + + setShadow() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.frame = { + x: 10, + y: 10, + width: 300, + height: 400 + }; + rootRender.shadowElevation = 30; + rootRender.shadowColor = 0XFF00FF00; + rootRender.shadowOffset = { x: 10, y: 10 }; + rootRender.shadowAlpha = 0.4; + rootRender.shadowRadius = 30; + console.info('sally---- rootRender set shadowAlpha = 0.4 successfully '); + console.info('sally---- rootRender set shadowElevation = 30 successfully '); + console.info('sally---- rootRender set shadowColor = 0XFF00FF00 successfully '); + console.info('sally---- rootRender set shadowOffset = { x: 10, y: 10 } successfully '); + console.info('sally---- rootRender set shadowRadius = 30 successfully '); + } + } + + setSize() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.size = { width: 300, height: 400 }; + console.info('sally---- rootRender setSize = { width: 300, height: 400 } successfully '); + } + } + + setTransform() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.transform = [ + 1, 0, 0, 0, + 0, 2, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]; + console.info( + 'sally---- rootRender settransform = [ 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] successfully ' + ); + } + } + + setTranslation() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.translation = { x: 100, y: 0 }; + console.info('sally---- rootRender setTranslation = { x: 100, y: 0 } successfully '); + } + } + + changeShadowAlphaAndShadowColor() { + const rootRender = this.rootNode!.getRenderNode() + if (rootRender) { + rootRender.shadowColor = 0XFF000000; + rootRender.shadowAlpha = 0.9; + console.info('sally---- rootRender change shadowAlpha = 0.9 successfully '); + console.info('sally---- rootRender change shadowColor = 0XFF000000 successfully '); + } + } +} + +@Entry +@Component +struct RenderTest { + @State myController: MyNodeController = new MyNodeController(); + @State clipFlag: boolean = false + scroller: Scroller = new Scroller() + + build() { + Row() { + Column() { + Text('提供命令式渲染节点') + NodeContainer(this.myController) + .width('100%') + .height("65%") + // .layoutWeight() + + // Line().width('100%').height(1).backgroundColor(Color.Red) + + // Button("change") + // .onClick(()=>{ + // this.myController.changeOpacityAndNodeGroup() + // }) + Scroll() { + Column() { + Button("appendchild") + .id('btn1') + .onClick(() => { + this.myController.appendchild() + }).margin({ top: 4 }) + Button("frame设置在option和size后") + .id('btn5') + .onClick(() => { + this.myController.frameafter() + }).margin({ top: 4 }) + Button("setbackgroundColor") + .id('btn2') + .onClick(() => { + this.myController.setbackgroundColor() + }).margin({ top: 4 }) + Button("updateClip") + .id('btn3') + .onClick(() => { + this.myController.updateClip(this.clipFlag) + this.clipFlag = !this.clipFlag + }).margin({ top: 4 }) + Button("frame设置在option和size前") + .id('btn4') + .onClick(() => { + this.myController.framefirst() + }).margin({ top: 4 }) + + Button("getfirstChild") + .id('btn6') + .onClick(() => { + this.myController.getfirstChild() + }).margin({ top: 4 }) + Button("getPreviousSibling") + .id('btn7') + .onClick(() => { + this.myController.getPreviousSibling() + }).margin({ top: 4 }) + Button("insertChildAfter1") + .id('btn8') + .onClick(() => { + this.myController.insertChildAfter1() + }).margin({ top: 4 }) + Button("invalidateRootRender") + .id('btn9') + .onClick(() => { + this.myController.invalidateRootRender() + }).margin({ top: 4 }) + Button("setopacity0.5") + .id('btn10') + .onClick(() => { + this.myController.opacity0_5() + }).margin({ top: 4 }) + Button("setPivot x:0.5 y:0.6") + .id('btn11') + .onClick(() => { + this.myController.setPivot() + }).margin({ top: 4 }) + Button("setPosition") + .id('btn12') + .onClick(() => { + this.myController.setPosition() + }).margin({ top: 4 }) + Button("removeFirstChild") + .id('btn13') + .onClick(() => { + this.myController.removeFirstChild() + }).margin({ top: 4 }) + Button("setRotation") + .id('btn14') + .onClick(() => { + this.myController.setRotation() + }).margin({ top: 4 }) + Button("setShadow") + .id('btn15') + .onClick(() => { + this.myController.setShadow() + }).margin({ top: 4 }) + Button("setSize") + .id('btn16') + .onClick(() => { + this.myController.setSize() + }).margin({ top: 4 }) + Button("setTransform") + .id('btn17') + .onClick(() => { + this.myController.setTransform() + }).margin({ top: 4 }) + Button("setTranslation") + .id('btn18') + .onClick(() => { + this.myController.setTranslation() + }).margin({ top: 4 }) + Button("change shadowAlpha and shadowColor") + .id('btn19') + .onClick(() => { + this.myController.changeShadowAlphaAndShadowColor() + }).margin({ top: 4 }) + } + }.width('100%') + .height("35%") + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..b33446d003a006ffd6a972da342f57d9081848cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0210.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; +import { drawing } from '@kit.ArkGraphics2D'; + +class MyRenderNode extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +class MyRenderNode2 extends RenderNode { + draw(context: DrawContext) { + const canvas = context.canvas; + const brush = new drawing.Brush(); + brush.setColor({ alpha: 255, red: 255, green: 0, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 0, right: 200, top: 0, bottom: 200 }); + canvas.detachBrush(); + + brush.setColor({ alpha: 255, red: 0, green: 255, blue: 0 }); + canvas.attachBrush(brush); + canvas.drawRect({ left: 100, right: 300, top: 100, bottom: 300 }); + canvas.detachBrush(); + } +} + +const newNode = new MyRenderNode(); +newNode.frame = { x: 0, y: 0, width: 200, height: 200 }; +newNode.backgroundColor = 0XFFFFFFFF; +newNode.markNodeGroup = false; +newNode.opacity = 0.2; + +const newNode1 = new MyRenderNode2(); +newNode1.frame = { x: 80, y: 80, width: 200, height: 200 }; +newNode1.backgroundColor = 0XFFFFFFFF; +newNode1.markNodeGroup = true; +newNode1.opacity = 0.2; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + rootRenderNode: RenderNode | null = null + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + this.rootRenderNode = this.rootNode.getRenderNode(); + if (this.rootRenderNode !== null) { + this.rootRenderNode.appendChild(newNode); + this.rootRenderNode.appendChild(newNode1); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIFrameNodeRanderNodeMarkNodeGroup0210 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed10512a4cd3d6c41bed26a9872cda3fc822e69d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0020.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 { FrameNode } from '@kit.ArkUI' + +@Entry +@Component +struct UIFramenodeAcquisitionAbility0020 { + build() { + Column() { + myComponent() + } + } +} + +@Component +struct myComponent { + @State text: string | undefined = "我是自定义组件" + + build() { + Button(this.text).id("button").backgroundColor(Color.Brown).onClick(() => { + const uiContext: UIContext = this.getUIContext() + if (uiContext) { + const frameNode: FrameNode | null = uiContext.getFrameNodeById("button") + if (frameNode) { + const uniqueId: number = frameNode.getUniqueId(); + console.log("SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0020==" + JSON.stringify(uniqueId)) + this.text = JSON.stringify(uniqueId); + } + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..46156d4ffac128a07f30b03760f61be2273b450a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0030.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 { FrameNode } from '@kit.ArkUI' + +@Entry +@Component +struct UIFramenodeAcquisitionAbility0030 { + build() { + Column() { + myComponent() + } + } +} + +@Component +struct myComponent { + @State text: string | undefined = "我是自定义组件" + + build() { + Button(this.text).id("button").onClick(() => { + const uiContext: UIContext = this.getUIContext() + if (uiContext) { + const frameNode: FrameNode | null = uiContext.getFrameNodeById("button") + if (frameNode) { + const uniqueId: number = frameNode.getUniqueId(); + console.log("SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0030 getFrameNodeByUniqueId ==" + + JSON.stringify(uiContext.getFrameNodeByUniqueId(uniqueId))) + this.text = JSON.stringify(uiContext.getFrameNodeByUniqueId(uniqueId)); + + } + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ccc89a6dbc2d32e3901eef7c0c540d70bc6b9e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0040.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode } from '@kit.ArkUI' + +@Entry +@Component +struct UIFramenodeAcquisitionAbility0040 { + component2UniqueId: number = -1 + + build() { + Column() { + Button("有渲染获取属性").backgroundColor(Color.Green) + .id("button") + .onClick(() => { + this.component2UniqueId = this.getUniqueId() + let uiContext = this.getUIContext() + if (uiContext) { + // console.log('FrameNodeInfoTest_jerry component2UniqueId: ',this.component2UniqueId) + let node = uiContext.getFrameNodeByUniqueId(this.component2UniqueId) + // console.log('FrameNodeInfoTest_jerry component2UniqueId: ',node?.getUniqueId()) + console.log('有渲染获取属性 FrameNodeInfoTest_jerry component2UniqueId: ', "_" + node?.getNodeType() + "_") + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..584153a977ad9a979c00a766e039e25ba78e3f05 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0050.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 { FrameNode } from '@kit.ArkUI' + +@Entry +@Component +struct UIFramenodeAcquisitionAbility0050 { + build() { + Column() { + myComponent() + } + } +} + +@Component +struct myComponent { + @State text: string | undefined = "我是自定义组件" + + build() { + Button(this.text).id("button").backgroundColor(Color.Brown).onClick(() => { + const uiContext: UIContext = this.getUIContext() + if (uiContext) { + const frameNode: FrameNode | null = uiContext.getFrameNodeById("button") + if (frameNode) { + console.log("SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0050 getFrameNodeByUniqueId ==" + + JSON.stringify(uiContext.getFrameNodeByUniqueId(-1))) + this.text = JSON.stringify(uiContext.getFrameNodeByUniqueId(-1)); + } + } + }) + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba7b63dcf0008b3a04ed3a82a189ebbdfcc5f355 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0060.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 { FrameNode } from '@kit.ArkUI' + +@Entry +@Component +struct UIFramenodeAcquisitionAbility0060 { + build() { + Column() { + myComponent() + } + } +} + +@Component +struct myComponent { + @State text: string | undefined | null = null + + build() { + Button(this.text).id("button").backgroundColor(Color.Brown).onClick(() => { + const uiContext: UIContext = this.getUIContext() + if (uiContext) { + const frameNode: FrameNode | null = uiContext.getFrameNodeById("button") + if (frameNode) { + for (let i = -1; i < 4; ++i) { + if (JSON.stringify(uiContext.getFrameNodeByUniqueId(i)) != null) { + this.text = JSON.stringify(uiContext.getFrameNodeByUniqueId(i)); + } + console.log("SUB_ACE_UI_FRAMENODE_ACQUISITION_ABILITY_0060==" + + JSON.stringify(uiContext.getFrameNodeByUniqueId(i)) + ",,i==" + i); + } + } + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..84d4e91760e9374c364d2f5c071bdc32864bd322 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0070.ets @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode } from '@kit.ArkUI' + +@Entry +@Component +struct UIFramenodeAcquisitionAbility0070 { + component2UniqueId: number = -1 + + build() { + Column() { + Button().id("button") + .onClick(() => { + console.log('未构建获取 uniquId FrameNodeInfoTest_jerry componentfu1UniqueId: ', this.component2UniqueId) + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UILcomponeentGraphicNodecontainerToolchains/UILcomponeentGraphicNodecontainerToolchains0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UILcomponeentGraphicNodecontainerToolchains/UILcomponeentGraphicNodecontainerToolchains0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..a48b0c20920ad3e40b04ae1bdeb564786e99e357 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UILcomponeentGraphicNodecontainerToolchains/UILcomponeentGraphicNodecontainerToolchains0020.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, BuilderNode ,promptAction} from '@kit.ArkUI'; + +@Component +struct TestComponent { + build() { + Column() { + Text("UILCOMPONENT_GRAPHIC_NODECONTAINER_TO0LCHAINS_0020") + } + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class NodeController0020 extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UILcomponeentGraphicNodecontainerToolchains0020 { + private mNodeController0020: NodeController0020 = new NodeController0020(); + + build() { + Column() { + NodeContainer(this.mNodeController0020) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..b12168a6aee47cc8e163dcc3aa288bdb00096b6c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0080.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.rotation = { x: 0, y: 0, z: 0 }; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0080") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.rotation = { x: 10, y: 5, z: 20 }; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0080 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d92d76cf529eeb128581b894583d70099fdf587 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0090.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.rotation = { x: 0, y: 0, z: 0 }; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0090") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0090 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..048d314539d0939d08c4181051c1b483791af221 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0100.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.rotation = { x: 0, y: 0, z: 0 }; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0100") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.rotation = { x: -5, y: 0, z: 0 }; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0100 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope013.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4a762ca4b4a32cea45bf72964601ea62a5b005a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope013.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 { BuilderNode, FrameNode, NodeController, UIContext } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State mBackgroundColor: ResourceColor = Color.Blue; + @State flag: boolean = true + + build() { + Column() { + Button('start') + .fontSize(26) + .fontColor(Color.Black) + .id("UIMotionAnimationImperativePrope013") + .width(150) + .height(80) + .backgroundColor(Color.Yellow) + .onClick(event => { + if (this.flag) { + this.mBackgroundColor = Color.Red + } else { + this.mBackgroundColor = Color.Blue + } + this.flag = !this.flag + }) + } + .backgroundColor(this.mBackgroundColor) + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .animation({ + duration: 2000, + curve: Curve.Linear, + iterations: 1, + playMode: PlayMode.Normal + }) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = Color.Blue; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope013 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope014.ets new file mode 100644 index 0000000000000000000000000000000000000000..702a4aec06e865086fb5c33810ade5131d114209 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope014.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 { BuilderNode, FrameNode, NodeController, UIContext } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State mBackgroundColor: ResourceColor = Color.Blue; + + build() { + Column() { + Button('start') + .fontSize(26) + .fontColor(Color.Black) + .id("UIMotionAnimationImperativePrope014") + .width(150) + .height(80) + .backgroundColor(Color.Yellow) + .onClick(event => { + }) + } + .backgroundColor(this.mBackgroundColor) + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .animation({ + duration: 2000, + curve: Curve.Linear, + iterations: 1, + playMode: PlayMode.Normal + }) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = Color.Blue; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope014 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope015.ets new file mode 100644 index 0000000000000000000000000000000000000000..1688185afbcfa60510c70f1cb88183ddb68307c1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope015.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 { BuilderNode, FrameNode, NodeController, UIContext } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State mBackgroundColor: ResourceColor = Color.Blue; + @State flag: boolean = true + + build() { + Column() { + Button('start') + .fontSize(26) + .fontColor(Color.Black) + .id("UIMotionAnimationImperativePrope015") + .width(150) + .height(80) + .backgroundColor(Color.Yellow) + .onClick(event => { + if (this.flag) { + this.mBackgroundColor = 0XFF00FF00 + } else { + this.mBackgroundColor = Color.Blue + } + this.flag = !this.flag + }) + } + .backgroundColor(this.mBackgroundColor) + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .animation({ + duration: 2000, + curve: Curve.Linear, + iterations: 1, + playMode: PlayMode.Normal + }) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 200 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.backgroundColor = Color.Blue; + rootRenderNode.size = { width: 400, height: 400 }; + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope015 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..c0cb0cd67624356102a62a983332d10c59edd785 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0160.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowAlpha = 0.7 + rootRenderNode.shadowColor = 0XFF00FF00 + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0160") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowAlpha = 0.7; + rootRenderNode.shadowColor = Color.Red; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0160 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..952358103e4370d551df1ed6318f743595e58ee7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0170.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + rootRenderNode.shadowAlpha = 0 + rootRenderNode.shadowColor = 0X00000000; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0170") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowAlpha = 0.7; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0170 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1d5c17fd2c33ee21c026e1d96466a41c04c31e9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0180.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowAlpha = 0.7 + rootRenderNode.shadowColor = 0XFF000000 + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0180") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowAlpha = 0.7; + rootRenderNode.shadowColor = 0XFF00FF00; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0180 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..01da20a58cd0007298b672741e0324bd9e0aaf50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0190.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowOffset = { x: 0, y: 0 }; + rootRenderNode.shadowRadius = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0190") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowRadius = 1; + rootRenderNode.shadowColor = 0xffff0000 + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0190 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..40d5f88b092757d0ac5b163c428979b64c3aa590 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0200.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowOffset = { x: 0, y: 0 }; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0200") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 2000, + curve: Curve.EaseOut + }, () => { + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0200 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..e56e978288b08e60da97a87804d4f80aed470a8d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0210.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowOffset = { x: 0, y: 0 }; + rootRenderNode.shadowRadius = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0210") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowOffset = { x: -10, y: 0 }; + rootRenderNode.shadowRadius = 1; + rootRenderNode.shadowColor = 0xffff0000; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0210 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..3d7826f7956577a8ec1c8ec0f72e0d54a24f631d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0240.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0240") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = -10; + rootRenderNode.shadowColor = 0xffff0000; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0240 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..f78f1aafc06285fe466077e9242884002d53b0a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0250.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0250") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + rootRenderNode.shadowColor = 0xffff0000 + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0250 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c3f4520ecbef785c03123fd89798a3271efe00c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0260.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0260") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 900, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0xffff0000 + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0260 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..28762c6b4533c31d21b28bb638d17dd0741f0632 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0270.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0270") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10.5; + rootRenderNode.shadowColor = 0xffff0000; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0270 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..c32ad33c384cc5494661eec70e0fc91b3d4af2d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0280.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0 + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0280") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0280 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..1eee2c620c14849437c2841a6c6646b29afe34ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0310.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = 0.1; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0310") + .width(100) + .height(300) + .backgroundColor(Color.Yellow) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = -0.4; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0310 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..510e743be9a5ec5af689bb244eabb215328d25d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0320.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = 0.1; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0320") + .width(100) + .height(300) + .backgroundColor(Color.Yellow) + .onClick(() => { + animateTo({ + duration: 2000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = 0; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0320 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..771d3a9a6870cfa9a256c61623c87232bc085d44 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0330.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0330") + .width(100) + .height(300) + .backgroundColor(Color.Yellow) + .onClick(() => { + animateTo({ + duration: 2000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = 0.5; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0330 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..50120d6ead4f9fdbb32b8584716202a9c3d4e908 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0340.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0340") + .width(100) + .height(300) + .backgroundColor(Color.Yellow) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 10; + rootRenderNode.shadowColor = 0XFF00FF00; + rootRenderNode.shadowOffset = { x: 10, y: 10 }; + rootRenderNode.shadowAlpha = 1.5; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0340 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8da15509c08d361836fad2131c4a63b798b462e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0370.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowRadius = 30; + rootRenderNode.shadowColor = 0xffff0000; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0370") + .width(100) + .height(300) + .backgroundColor(Color.Gray) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowRadius = -30; + rootRenderNode.shadowColor = 0xffff0000; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0370 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..d294fe9545d4a12e88e251f188227f5d980bc3a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0380.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowRadius = 30; + rootRenderNode.shadowColor = 0xffff0000; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0380") + .width(100) + .height(300) + .backgroundColor(Color.Gray) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowRadius = 0; + rootRenderNode.shadowColor = 0xffff0000; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0380 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..184a8bec7a7ee380a99a29301ae0af19ee3230fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0390.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowRadius = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0390") + .width(100) + .height(300) + .backgroundColor(Color.Gray) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowRadius = 30; + rootRenderNode.shadowColor = 0xffff0000; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0390 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..65da927b10b75305b10b1c62e654560e6df2b8a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0400.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowRadius = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0400") + .width(100) + .height(300) + .backgroundColor(Color.Gray) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0400 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope055.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope055.ets new file mode 100644 index 0000000000000000000000000000000000000000..a4907bdb5ca79007c6af0cbb15a3c5a40dd75507 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope055.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 { FrameNode, NodeController, RenderNode } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 100, + height: 100 +}; +renderNode.backgroundColor = 0xffff0000; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope055 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Row() { + NodeContainer(this.myNodeController) + } + + Button('start') + .id('UIMotionAnimationImperativeprope055_button') + .margin({ top: 30 }) + .onClick(() => { + animateTo({ + duration: 2000, + curve: Curve.EaseOut, + iterations: 3, + playMode: PlayMode.Normal + }, () => { + renderNode.translation = { x: 0, y: 0 } + }) + }) + } + .backgroundColor(Color.Yellow) + .padding({ right: 100, bottom: 100 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope056.ets new file mode 100644 index 0000000000000000000000000000000000000000..4eec3266e392bdd5fc4a39e146cece7b37c216f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope056.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 { FrameNode, NodeController, RenderNode } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 100, + height: 100 +}; +renderNode.backgroundColor = 0xffff0000; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope056 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + Row() { + NodeContainer(this.myNodeController) + } + + Button('start') + .id('UIMotionAnimationImperativeprope056_button') + .margin({ top: 30 }) + .onClick(() => { + animateTo({ + duration: 2000, + curve: Curve.EaseOut, + iterations: 3, + playMode: PlayMode.Normal + }, () => { + renderNode.translation = { x: 50, y: 30 } + }) + }) + } + .backgroundColor(Color.Yellow) + .padding({ right: 100, bottom: 100 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0570.ets new file mode 100644 index 0000000000000000000000000000000000000000..24749db8fe19615027d90087b1d4391392992314 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0570.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.translation = { x: 0, y: 0 }; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0570") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.translation = { x: -50, y: 0 }; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0570 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0610.ets new file mode 100644 index 0000000000000000000000000000000000000000..59abc46fe47844470ab68297a61d3904e4b21cbd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0610.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.transform = [ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0610") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0610 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0620.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3697df06760d80d209f505bf769de2d86f04725 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0620.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.transform = [ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ] + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0620") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.transform = [ + 1, 0, 0, 0, + 0, 2, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]; + } + }) + }) + + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0620 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0630.ets new file mode 100644 index 0000000000000000000000000000000000000000..d6e06b66ab2c187dde435b5f413f352e06b71717 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0630.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 1; + rootRenderNode.shadowRadius = 1; + rootRenderNode.shadowColor = 0XFF000000 + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0630") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .useEffect(true) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + rootRenderNode.shadowRadius = 0; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0630 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0640.ets new file mode 100644 index 0000000000000000000000000000000000000000..75881b28fe5372baf0f6790c550a71fc418aedc1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0640.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 { NodeController, FrameNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode) { + rootRenderNode.shadowElevation = 0; + rootRenderNode.shadowRadius = 0; + } + this.rootNode.commonAttribute + .id("UIMotionAnimationImperativePrope0640") + .width(100) + .height(300) + .backgroundColor(Color.Green) + .useEffect(true) + .onClick(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseOut + }, () => { + if (rootRenderNode) { + rootRenderNode.shadowElevation = 2; + rootRenderNode.shadowRadius = 2; + rootRenderNode.shadowColor = 0XFF000000; + } + }) + }) + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativePrope0640 { + private mNodeController: NodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.mNodeController) + }.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/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3b3f90e05d8ed917e18a6e5aed93b782e19381c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0010.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); + +renderNode.backgroundColor = 0xffff0000; +renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; +renderNode.scale = { x: 0.5, y: 1 }; + +@Component +struct TestComponent { + @State flagex : number = 1 + @State flagey : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.flagex = 2 + }) + .scale({ + x:this.flagex, + y:this.flagey + }) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..daeab78339bdb8ada036d0ec65a4bcb905f34197 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0020.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); + +renderNode.backgroundColor = 0xffff0000; +renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; +renderNode.scale = { x: 0.5, y: 1 }; + +@Component +struct TestComponent { + @State flagex : number = 1 + @State flagey : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.flagey = 0.5 + }) + .scale({ + x:this.flagex, + y:this.flagey + }) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0020 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..853d42b6cbc2bf4a41b62ac2bbb6d19dda48341e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0030.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 {FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; + +@Component +struct TestComponent { + @State flagex : number = 1 + @State flagey : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.flagex = 1 + this.flagey = 1 + }) + .scale({ + x:this.flagex, + y:this.flagey + }) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0030 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..e914f8af67f7adc5ee125bb3392863b97d3a204c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0040.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); + +renderNode.backgroundColor = 0xffff0000; +renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; +renderNode.scale = { x: 0.5, y: 1 }; + +@Component +struct TestComponent { + @State flagex : number = 1 + @State flagey : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.flagex = 2 + this.flagey = 0.5 + }) + .scale({ + x:this.flagex, + y:this.flagey + }) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0040 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..b664eb4ca1246981903325e15186aaebb663fd9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0050.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); + +renderNode.backgroundColor = 0xffff0000; +renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; +renderNode.scale = { x: 0.5, y: 1 }; + +@Component +struct TestComponent { + @State flagex : number = 1 + @State flagey : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.flagex = -2 + }) + .scale({ + x:this.flagex, + y:this.flagey + }) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0050 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..c0b85f4b155e236d0b3ffe39ecad939c048d3c86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0430.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mOpacity : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mOpacity = -0.5 + }) + .opacity(this.mOpacity) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0430 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca20ef64b159d7271090ecfa39797e2e96e486dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0440.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mOpacity : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mOpacity = 0 + }) + .opacity(this.mOpacity) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0440 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..b72b53ea28bb748cd57da3fc2b7cd99ad90f13b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0450.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mOpacity : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mOpacity = 0.5 + }) + .opacity(this.mOpacity) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0450 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..27ad8489974e824af4ed82567064e243052b08d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0460.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mOpacity : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mOpacity = 1 + }) + .opacity(this.mOpacity) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0440 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..889e6609b0e4f863c390e82092b905aedcb48924 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0470.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mOpacity : number = 1 + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mOpacity = 1.5 + }) + .opacity(this.mOpacity) + .fontSize(16) + .width(200) // 只有写在animation前面才生效 + .height(80) // 只有写在animation前面才生效 + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0470 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..49eb60cc3b240a84a8ad5085a53ecbe8e646229c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0500.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + build() { + Column() { + Button('start') + .id('buttton') + .fontSize(16) + .width(200) + .height(80) + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0500 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..e606633e6f3283730626dcc23c3c1569c95b3e8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0510.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mPositionX : number |undefined= undefined + @State mPositionY : number |undefined= undefined + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mPositionX = 50 + this.mPositionY = 30 + }) + .position({x:this.mPositionX ,y:this.mPositionY }) + .fontSize(16) + .width(200) + .height(80) + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0510 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb6fb659214c3f3d17632b0b5fcbcadb11df2e00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0520.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mPositionX : number |undefined= undefined + @State mPositionY : number |undefined= undefined + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mPositionX = -50 + this.mPositionY = 0 + }) + .position({x:this.mPositionX ,y:this.mPositionY }) + .fontSize(16) + .width(200) + .height(80) + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0520 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..64e9494ef441e6d8947230e5dbdf7ed6e0dafbbd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0530.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mPositionX : number |undefined | string= undefined + @State mPositionY : number |undefined= undefined + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mPositionX = "adhg" + }) + .position({x:this.mPositionX ,y:this.mPositionY }) + .fontSize(16) + .width(200) + .height(80) + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0530 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..11281184140c7241bf00adea15a0e2945718eac0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0540.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 { RenderNode, FrameNode, NodeController ,BuilderNode } from '@kit.ArkUI'; +@Component +struct TestComponent { + @State mPositionX : number |undefined | string= undefined + @State mPositionY : number |undefined= undefined + build() { + Column() { + Button('start') + .id("buttton") + .onClick(()=>{ + this.mPositionX = "2gy" + }) + .position({x:this.mPositionX ,y:this.mPositionY }) + .fontSize(16) + .width(200) + .height(80) + .animation({ + duration: 1500, + curve: Curve.EaseOut, + iterations: 1, + playMode: PlayMode.Normal + }) + } .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } +} + +@Builder +function buildComponent() { + TestComponent() +} + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private builderNode: BuilderNode<[]> | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + this.builderNode = new BuilderNode(uiContext, { selfIdealSize: { width: 200, height: 100 } }); + this.builderNode.build(new WrappedBuilder(buildComponent)); + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(this.builderNode!.getFrameNode()!.getRenderNode()); + } + return this.rootNode; + } +} + +@Entry +@Component +struct UIMotionAnimationImperativeprope0540 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Row() { + NodeContainer(this.myNodeController) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bfbf10625c6d1de04d0ad3afec9d3ac728a4b3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0030.ets @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + DatePicker() + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0030 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..2294b0959b74bcbb31b3241fb342a80daf547857 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0040.ets @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + TimePicker() + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0040 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..750e2ae3b919b1fd5d0c13c097a318b659ac2479 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0050.ets @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X + controller: VideoController = new VideoController() + + build() { + Column() { + Video({ + currentProgressRate: this.curRate, + controller: this.controller + }) + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0050 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..c4f26dd0689572fc28d82ea742b99208f2aa42f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0060.ets @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + myXComponentController: XComponentController = new XComponentController(); + + build() { + Column() { + XComponent({ + id: 'xComponentId', + type: XComponentType.SURFACE, + libraryname: 'nativerender', + controller: this.myXComponentController + }) + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0060 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..745e4134bc9268a92c9191841b56931da50b385d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0070.ets @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0070 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..258d4a6db686d8fdcf8d10d7ae2a2e54329c3234 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0080.ets @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + Scroll(new Scroller()) { + Column() { + ForEach([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], (item: number) => { + Text(item.toString()) + .width('90%') + .height(30) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0080 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..610fe9060cec574ba387de78d7e2e12d13bb06b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0090.ets @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + TextArea({ text: 'TextArea Test' }) + .border({ width: 1 }).padding(10).margin(5) + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0090 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec1a8c86515874054872643eb049aef13774592e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0100.ets @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + TextInput({ placeholder: 'Input Test' }) + .width('95%') + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0100 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1b1c64fcd9aa57b6bc86afc2f13c1b00ed586ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0110.ets @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + Toggle({ type: ToggleType.Checkbox, isOn: true }) + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0110 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..afaf7ce0ee4e449ff751d88ef9c7a8dc397be658 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0120.ets @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + Web({ src: 'www.example.com', controller: new webview.WebviewController() }) + .id(this.params?.elementId) + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0120 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController }) + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..828d4ba6477a19192f1124ff73f1fd97afbf93f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0130.ets @@ -0,0 +1,208 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X + controller: VideoController = new VideoController() + + build() { + Column() { + Web({ src: 'www.example.com', controller: new webview.WebviewController() }) + .height("50%") + Video({ + currentProgressRate: this.curRate, + controller: this.controller + }) + .height("50%") + } + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0130 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + // Web组件加载本地text.html页面。 + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee26d8fcc453a7bb10998ce98546c9fd8e2236eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0140.ets @@ -0,0 +1,232 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 创建NodeController +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + textOne: string + textTwo: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +// 用于控制和反馈对应的NodeContainer上的节点的行为,需要与NodeContainer一起使用。 +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_DISPLAY; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(TextInputBuilder), + { textOne: "myTextInput:", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + // 返回FrameNode节点。 + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct TextInputComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + TextInput({ text: "", placeholder: this.params?.textOne }) + .placeholderColor(Color.Gray) + .id(this.params?.elementId) + .placeholderFont({ size: 13, weight: 400 }) + .caretColor(Color.Gray) + .fontSize(14) + .fontColor(Color.Black) + } + //自定义组件中的最外层容器组件宽高应该为同层标签的宽高 + .width(this.params.width) + .height(this.params.height) + } +} + +// @Builder中为动态组件的具体组件内容。 +@Builder +function TextInputBuilder(params: Params) { + TextInputComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0140 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Button('update') + .id("Button002") + .onClick(() => { + this.browserTabController.refresh() + }).margin({ top: 50 }) + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController }) + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + textOne: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + })// 获取同层渲染组件触摸事件信息。 + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + this.componentIdArr.forEach((componentId: string) => { + let nodeController = this.nodeControllerMap.get(componentId); + if (nodeController?.getEmbedId() == touch.embedId) { + let ret = nodeController?.postEvent(touch.touchEvent) + if (ret) { + console.log("onNativeEmbedGestureEvent success " + componentId); + } else { + console.log("onNativeEmbedGestureEvent fail " + componentId); + } + if (touch.result) { + touch.result.setGestureEventResult(ret); + } + } + }) + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..4eaca4a8785d0f7717a2a7e6d6176836d14d4550 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0150.ets @@ -0,0 +1,235 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 创建NodeController +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + textOne: string + textTwo: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +// 用于控制和反馈对应的NodeContainer上的节点的行为,需要与NodeContainer一起使用。 +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_DISPLAY; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + // 必须要重写的方法,用于构建节点数、返回节点数挂载在对应NodeContainer中。 + // 在对应NodeContainer创建的时候调用、或者通过rebuild方法调用刷新。 + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { // rootNode为null + return null; + } + if (!this.rootNode) { // rootNode 为undefined时 + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(TextInputBuilder), + { textOne: "myTextInput:", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + // 返回FrameNode节点。 + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct TextInputComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + TextInput({ text: "", placeholder: this.params?.textOne }) + .placeholderColor(Color.Gray) + .id(this.params?.elementId) + .placeholderFont({ size: 13, weight: 400 }) + .caretColor(Color.Gray) + .fontSize(14) + .fontColor(Color.Black) + } + //自定义组件中的最外层容器组件宽高应该为同层标签的宽高 + .width(this.params.width) + .height(this.params.height) + } +} + +// @Builder中为动态组件的具体组件内容。 +@Builder +function TextInputBuilder(params: Params) { + TextInputComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0150 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Button('update') + .id("Button002") + .onClick(() => { + this.browserTabController.refresh() + }).margin({ top: 50 }) + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + textOne: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + })// 获取同层渲染组件触摸事件信息。 + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + this.componentIdArr.forEach((componentId: string) => { + let nodeController = this.nodeControllerMap.get(componentId); + if (nodeController?.getEmbedId() == touch.embedId) { + let ret = nodeController?.postEvent(touch.touchEvent) + if (ret) { + console.log("onNativeEmbedGestureEvent success " + componentId); + } else { + console.log("onNativeEmbedGestureEvent fail " + componentId); + } + if (touch.result) { + touch.result.setGestureEventResult(ret); + } + } + }) + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..755473aa5e2cf97deacb1d96b2414f10872f4c82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0160.ets @@ -0,0 +1,225 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import webview from '@ohos.web.webview'; +import { UIContext } from '@ohos.arkui.UIContext'; +import { NodeController, BuilderNode, NodeRenderType, FrameNode } from "@ohos.arkui.node"; + +@Observed +declare class Params { + elementId: string + text: string + width: number + height: number +} + +declare class nodeControllerParams { + surfaceId: string + type: string + renderType: NodeRenderType + embedId: string + width: number + height: number +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null; + private embedId_: string = ""; + private surfaceId_: string = ""; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + private width_: number = 0; + private height_: number = 0; + private type_: string = ""; + private isDestroy_: boolean = false; + + setRenderOption(params: nodeControllerParams) { + this.surfaceId_ = params.surfaceId; + this.renderType_ = params.renderType; + this.embedId_ = params.embedId; + this.width_ = params.width; + this.height_ = params.height; + this.type_ = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + if (this.isDestroy_) { + return null; + } + if (!this.rootNode) { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ }); + if (this.rootNode) { + this.rootNode.build(wrapBuilder(ViewBuilder), { text: "Test", width: this.width_, height: this.height_ }) + return this.rootNode.getFrameNode(); + } else { + return null; + } + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId_; + } + + setDestroy(isDestroy: boolean): void { + this.isDestroy_ = isDestroy; + if (this.isDestroy_) { + this.rootNode = null; + } + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean + } +} + +@Component +struct ViewComponent { + @Prop params: Params + @State bkColor: Color = Color.White + + build() { + Column() { + List({ space: 80, initialIndex: 0 }) { + ForEach([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .id('web002') + } + } +} + +@Builder +function ViewBuilder(params: Params) { + ViewComponent({ params: params }) + .width(params.width) + .height(params.height) + .backgroundColor(Color.White) +} + +@Entry +@Component +struct UiComponentCmmonattrRendering0160 { + browserTabController: WebviewController = new webview.WebviewController() + private nodeControllerMap: Map = new Map(); + @State componentIdArr: Array = []; + @State posMap: Map = new Map(); + @State widthMap: Map = new Map(); + @State heightMap: Map = new Map(); + @State positionMap: Map = new Map(); + @State edges: Edges = {}; + + build() { + Row() { + Column() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)) + .position(this.positionMap.get(componentId)) + .width(this.widthMap.get(componentId)) + .height(this.heightMap.get(componentId)) + }, (embedId: string) => embedId) + Web({ src: $rawfile("webtest.html"), controller: this.browserTabController })// 配置同层渲染开关开启。 + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + console.log("NativeEmbed surfaceId" + embed.surfaceId); + const componentId = embed.info?.id?.toString() as string + if (embed.status == NativeEmbedStatus.CREATE) { + console.log("NativeEmbed create" + JSON.stringify(embed.info)); + // 创建节点控制器、设置参数并rebuild + let nodeController = new MyNodeController() + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }) + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + nodeController.setDestroy(false); + this.nodeControllerMap.set(componentId, nodeController); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + this.positionMap.set(componentId, this.edges); + this.componentIdArr.push(componentId) + } else if (embed.status == NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + console.log("NativeEmbed update" + JSON.stringify(embed)); + this.edges = + { left: `${embed.info?.position?.x as number}px`, top: `${embed.info?.position?.y as number}px` } + this.positionMap.set(componentId, this.edges); + this.widthMap.set(componentId, px2vp(embed.info?.width)); + this.heightMap.set(componentId, px2vp(embed.info?.height)); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject) + } else if (embed.status == NativeEmbedStatus.DESTROY) { + console.log("NativeEmbed destroy" + JSON.stringify(embed)); + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setDestroy(true) + this.nodeControllerMap.clear(); + this.positionMap.delete(componentId); + this.widthMap.delete(componentId); + this.heightMap.delete(componentId); + this.componentIdArr.filter((value: string) => value != componentId) + } else { + console.log("NativeEmbed status" + embed.status); + } + }) + .onNativeEmbedGestureEvent((touch) => { + console.log("NativeEmbed onNativeEmbedGestureEvent" + JSON.stringify(touch.touchEvent)); + this.componentIdArr.forEach((componentId: string) => { + let nodeController = this.nodeControllerMap.get(componentId); + // 将获取到的同层区域的事件发送到该区域embedId对应的nodeController上 + if(nodeController?.getEmbedId() == touch.embedId) { + let ret = nodeController?.postEvent(touch.touchEvent) + if(ret) { + console.log("onNativeEmbedGestureEvent success " + componentId); + } else { + console.log("onNativeEmbedGestureEvent fail " + componentId); + } + if(touch.result) { + // 通知Web组件手势事件消费结果 + touch.result.setGestureEventResult(ret); + } + } + }) + }) + } + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..a90335fe3a51730de8b0492503b33abbf1a0e0c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0180.ets @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { webview } from '@kit.ArkWeb'; + +@Entry +@Component +struct UiComponentCmmonattrRendering0180 { + browserTabController: webview.WebviewController = new webview.WebviewController(); + + build() { + Column() { + Web({ src: $rawfile("webtest2.html"), controller: this.browserTabController }) + .id("web002") + .margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..16a2ea782257b4439511d571508cfa8de4d17955 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0190.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 { webview } from '@kit.ArkWeb'; + +@Entry +@Component +struct UiComponentCmmonattrRendering0190 { + browserTabController: webview.WebviewController = new webview.WebviewController(); + + build() { + Column() { + Web({ src: $rawfile("webtest2.html"), controller: this.browserTabController }) + .gesture( + TapGesture({ count: 2 }) + .onAction((event: GestureEvent) => { + if (event) { + this.browserTabController.zoom(2) + } + }) + ) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9565e30b2ad5ac778e2757db6f9b6def1063a10 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0200.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentCmmonattrRendering0200 { + @State videoSrc: Resource = $rawfile('butterfly.mp4') + @State previewUri: Resource = $r('app.media.butterfly_0') + @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X + @State isAutoPlay: boolean = false + @State showControls: boolean = true + controller: VideoController = new VideoController() + + build() { + Column() { + Video({ + src: this.videoSrc, + previewUri: this.previewUri, + currentProgressRate: this.curRate, + controller: this.controller + }) + .width('100%') + .height(600) + .autoPlay(this.isAutoPlay) + .controls(this.showControls) + .onStart(() => { + console.info('onStart') + }) + .onPause(() => { + console.info('onPause') + }) + .onFinish(() => { + console.info('onFinish') + }) + .onError(() => { + console.info('onError') + }) + .onStop(() => { + console.info('onStop') + }) + .onPrepared(() => { + console.info('onPrepared') + }) + .onSeeking(() => { + console.info('onSeeking') + }) + .onSeeked(() => { + console.info('onSeeked') + }) + .onUpdate(() => { + console.info('onUpdate') + }) + + Row() { + Button('start') + .id('UiComponentCmmonattrRendering0200_btn1') + .onClick(() => { + this.controller.start() // 开始播放 + }).margin(2) + Button('pause').onClick(() => { + this.controller.pause() // 暂停播放 + }).margin(2) + Button('stop').onClick(() => { + this.controller.stop() // 结束播放 + }).margin(2) + Button('reset').onClick(() => { + this.controller.reset() // 重置AVPlayer + }).margin(2) + Button('setTime').onClick(() => { + this.controller.setCurrentTime(10, SeekMode.Accurate) // 精准跳转到视频的10s位置 + }).margin(2) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..83bd8e17a8128111feace5b13f2af05ce5bba866 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0010.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 { NodeController, BuilderNode, FrameNode, UIContext, NodeRenderType } from "@kit.ArkUI"; + +class Params { + surfaceId: string = "textId"; + renderType: NodeRenderType = NodeRenderType.RENDER_TYPE_DISPLAY; + message: string = ""; +} + +@Builder +function buildText(params: Params) { + Column() { + Text(params.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({ bottom: 36 }) + } +} + +class TextNodeController extends NodeController { + private textNode: BuilderNode<[Params]> | null = null; + private message_: string = "DEFAULT"; + private surfaceId_: string = "textId"; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_DISPLAY; + + makeNode(context: UIContext): FrameNode | null { + this.textNode = new BuilderNode(context, { surfaceId: this.surfaceId_, type: this.renderType_ }); + this.textNode.build(wrapBuilder<[Params]>(buildText), { message: this.message_}) + + return this.textNode.getFrameNode(); + } +} + +@Entry +@Component +struct UiComponentGraphicNodecontainerBuildernode0010 { + + build() { + Row() { + Column() { + NodeContainer(new TextNodeController()) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..ab4de797405b6bdfb8bf100331480e14cb12f502 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0020.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 { NodeController, BuilderNode, FrameNode, UIContext, NodeRenderType } from "@kit.ArkUI"; + +class Params { + surfaceId: string = ""; + renderType: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + message: string = ""; +} + +@Builder +function buildText(params: Params) { + Column() { + Text(params.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({ bottom: 36 }) + } +} + +class TextNodeController extends NodeController { + private textNode: BuilderNode<[Params]> | null = null; + private message_: string = "DEFAULT"; + private surfaceId_: string = "textId"; + private renderType_: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + + makeNode(context: UIContext): FrameNode | null { + this.textNode = new BuilderNode(context, { surfaceId: this.surfaceId_, type: this.renderType_ }); + this.textNode.build(wrapBuilder<[Params]>(buildText), { message: this.message_}) + + return this.textNode.getFrameNode(); + } +} + +@Entry +@Component +struct UiComponentGraphicNodecontainerBuildernode0020 { + + build() { + Row() { + Column() { + NodeContainer(new TextNodeController()) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8e42cc6f69316fbc3901900118eecb631eca0ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0030.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 { NodeController, BuilderNode, FrameNode, UIContext } from "@kit.ArkUI" + +class Params { + text: string = "" + + constructor(text: string) { + this.text = text; + } +} + +@Builder +function buildText(params: Params) { + Column() { + Text(params.text) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({ bottom: 36 }) + } +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = "DEFAULT"; + + constructor(message: string) { + super(); + this.message = message; + } + + makeNode(context: UIContext): FrameNode | null { + this.rootNode = new FrameNode(context); + this.textNode = new BuilderNode(context, { selfIdealSize: { width: 150, height: 150 } }); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)); + if (this.rootNode !== null) { + this.rootNode.appendChild(this.textNode?.getFrameNode()); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiComponentGraphicNodecontainerBuildernode0030 { + @State message: string = "hello" + + build() { + Row() { + Column() { + NodeContainer(new TextNodeController(this.message)) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..ff7af6e5009eea554d140998b6ea5c585e2de697 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0040.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 { NodeController, BuilderNode, FrameNode, UIContext, NodeRenderType } from "@kit.ArkUI"; + +class Params { + surfaceId: string = ""; + renderType: NodeRenderType = NodeRenderType.RENDER_TYPE_TEXTURE; + message: string = ""; +} + +@Builder +function buildText(params: Params) { + Column() { + Text(params.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({ bottom: 36 }) + } +} + +class TextNodeController extends NodeController { + private textNode: BuilderNode<[Params]> | null = null; + private message_: string = "DEFAULT"; + private surfaceId_: string = "textId"; + + + makeNode(context: UIContext): FrameNode | null { + this.textNode = new BuilderNode(context, { surfaceId: this.surfaceId_ }); + this.textNode.build(wrapBuilder<[Params]>(buildText), { message: this.message_}) + + return this.textNode.getFrameNode(); + } +} + +@Entry +@Component +struct UiComponentGraphicNodecontainerBuildernode0040 { + + build() { + Row() { + Column() { + NodeContainer(new TextNodeController()) + .width('100%') + .height(100) + .backgroundColor('#FFF0F0F0') + } + .width('100%') + .height('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a95ff3c459d52430d19bd58063f9196e3ed7472 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0060.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 { BuilderNode, NodeContent } from "@kit.ArkUI" + +interface ParamsInterface { + text: string; + func: Function; +} + +@Builder +function buildTextWithFunc(fun: Function) { + Text(fun()) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({ bottom: 36 }) +} + +@Builder +function buildText(params: ParamsInterface) { + Column() { + Text(params.text) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({ bottom: 36 }) + buildTextWithFunc(params.func) + } +} + + +@Entry +@Component +struct UiComponentGraphicNodecontainerBuildernode0060 { + @State message: string = "HELLO" + private content: NodeContent = new NodeContent(); + + build() { + Row() { + Column() { + Button('BuilderNode') + .id("Button002") + .onClick(() => { + let buildNode = new BuilderNode<[ParamsInterface]>(this.getUIContext()); + buildNode.build(wrapBuilder<[ParamsInterface]>(buildText), { + text: this.message, func: () => { + return "FUNCTION" + } + }, { nestingBuilderSupported: true }); + this.content.addFrameNode(buildNode.getFrameNode()); + buildNode.dispose(); + }) + ContentSlot(this.content) + } + .id("column") + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..c821ac03a70fe8f01f81d68ceeec84cdc14e19ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0080.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 { NodeController, BuilderNode, FrameNode, UIContext } from "@kit.ArkUI" + +class Params { + text: string = "" + constructor(text: string) { + this.text = text; + } +} + +// Custom component +@Component +struct TextBuilder { + @Prop message: string = "TextBuilder"; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({bottom: 36}) + .backgroundColor(Color.Gray) + } + } + } +} + +@Builder +function buildText(params: Params) { + Column() { + Text(params.text) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .margin({ bottom: 36 }) + TextBuilder({message: params.text}) // Custom component + } +} + +class TextNodeController extends NodeController { + private rootNode: FrameNode | null = null; + private textNode: BuilderNode<[Params]> | null = null; + private message: string = ""; + + constructor(message: string) { + super() + this.message = message + } + + makeNode(context: UIContext): FrameNode | null { + this.textNode = new BuilderNode(context); + this.textNode.build(wrapBuilder<[Params]>(buildText), new Params(this.message)) + return this.textNode.getFrameNode(); + } + + update(message: string) { + if (this.textNode !== null) { + this.textNode.update(new Params(message)); + } + } +} + +@Entry +@Component +struct UiComponentGraphicNodecontainerBuildernode0080 { + @State message: string = "hello" + private textNodeController: TextNodeController = new TextNodeController(this.message); + private count = 0; + + build() { + Row() { + Column() { + NodeContainer(this.textNodeController) + .width('100%') + .height(200) + .backgroundColor('#FFF0F0F0') + Button('Update') + .id("Button002") + .onClick(() => { + this.count += 1; + const message = "Update " + this.count.toString(); + this.textNodeController.update(message); + }) + } + .width('100%') + .height('100%') + } + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..80f1b4d3b44b4199323ad6e9111c7663f039b8d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0090.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, BuilderNode, FrameNode, UIContext } from '@kit.ArkUI'; + +class Params { + text: string = "this is a text" +} + +@Builder +function ButtonBuilder(params: Params) { + Column() { + Button(`button ` + params.text) + .borderWidth(2) + .backgroundColor(Color.Orange) + .width("100%") + .height("100%") + .gesture( + TapGesture() + .onAction((event: GestureEvent) => { + console.log("TapGesture"); + }) + ) + } + .width(500) + .height(300) + .backgroundColor(Color.Gray) +} + +class MyNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | null = null; + private wrapBuilder: WrappedBuilder<[Params]> = wrapBuilder(ButtonBuilder); + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new BuilderNode(uiContext); + this.rootNode.build(this.wrapBuilder, { text: "this is a string" }) + return this.rootNode.getFrameNode(); + } + + postTouchEvent(touchEvent: TouchEvent): void { + if(this.rootNode == null){ + return; + } + let result = this.rootNode.postTouchEvent(touchEvent); + console.log("result " + result); + } +} + +@Entry +@Component +struct UiComponentGraphicNodecontainerBuildernode0090 { + private nodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.nodeController) + .height(300) + .width(500) + + Column() + .width(500) + .height(300) + .backgroundColor(Color.Pink) + .onTouch((event) => { + if(event != undefined){ + this.nodeController.postTouchEvent(event); + } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..877c98f030eab4a6b3d63ad42ba283266741ca4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0010.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 { FrameNode, NodeController, NodeAdapter, typeNode } from '@kit.ArkUI'; + +class MyNodeAdapter extends NodeAdapter { + uiContext: UIContext + cachePool: Array = new Array(); + changed: boolean = false + reloadTimes: number = 0; + data: Array = new Array(); + hostNode?: FrameNode + value: string = "Value" + + constructor(uiContext: UIContext, count: number) { + super(); + this.uiContext = uiContext; + this.totalNodeCount = count; + this.loadData(); + } + + reloadData(count: number): void { + this.reloadTimes++; + NodeAdapter.attachNodeAdapter(this, this.hostNode); + this.totalNodeCount = count; + this.loadData(); + this.reloadAllItems(); + } + + setTotalNodeCount(count: number): void { + this.totalNodeCount = count; + this.reloadAllItems(); + } + + getTotalNodeCount(): number { + return this.totalNodeCount; + } + + getValue(): string { + return this.value + } + + refreshData(): number { + let items = this.getAllAvailableItems() + console.log("UINodeAdapter get All items:" + items.length); + this.reloadAllItems(); + return items.length; + } + + attachData(): boolean { + return NodeAdapter.attachNodeAdapter(this, this.hostNode); + } + + detachData(): number { + NodeAdapter.detachNodeAdapter(this.hostNode); + return this.reloadTimes = 0; + } + + loadData(): void { + for (let i = 0; i < this.totalNodeCount; i++) { + this.data[i] = "Adapter ListItem " + i + " r:" + this.reloadTimes; + } + } + + changedData(from: number, count: number): void { + this.changed = !this.changed; + for (let i = 0; i < count; i++) { + let index = i + from; + this.data[index] = "Adapter ListItem " + (this.changed ? "changed:" : "") + index + " r:" + this.reloadTimes; + } + this.reloadItem(from, count); + } + + insertData(from: number, count: number): void { + for (let i = 0; i < count; i++) { + let index = i + from; + this.data.splice(index, 0, "Adapter ListItem " + from + "-" + i); + } + this.insertItem(from, count); + this.totalNodeCount += count; + console.log("UINodeAdapter after insert count:" + this.totalNodeCount); + } + + removeData(from: number, count: number): void { + let arr = this.data.splice(from, count); + this.removeItem(from, count); + this.totalNodeCount -= arr.length; + console.log("UINodeAdapter after remove count:" + this.totalNodeCount); + } + + moveData(from: number, to: number): void { + let tmp = this.data.splice(from, 1); + this.data.splice(to, 0, tmp[0]); + this.moveItem(from, to); + } + + onAttachToNode(target: FrameNode): void { + console.log("UINodeAdapter onAttachToNode id:" + target.getUniqueId()); + this.hostNode = target; + } + + onDetachFromNode(): void { + console.log("UINodeAdapter onDetachFromNode"); + } + + onGetChildId(index: number): number { + console.log("UINodeAdapter onGetChildId:" + index); + return index; + } + + onCreateChild(index: number): FrameNode { + console.log("UINodeAdapter onCreateChild:" + index); + if (this.cachePool.length > 0) { + let cacheNode = this.cachePool.pop(); + if (cacheNode !== undefined) { + console.log("UINodeAdapter onCreateChild reused id:" + cacheNode.getUniqueId()); + let text = cacheNode?.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + return cacheNode; + } + } + console.log("UINodeAdapter onCreateChild createNew"); + let itemNode = typeNode.createNode(this.uiContext, "ListItem"); + let textNode = typeNode.createNode(this.uiContext, "Text"); + textNode.initialize(this.data[index]).fontSize(20); + itemNode.appendChild(textNode); + return itemNode; + } + + onDisposeChild(id: number, node: FrameNode): void { + console.log("UINodeAdapter onDisposeChild:" + id); + if (this.cachePool.length < 10) { + if (!this.cachePool.includes(node)) { + console.log("UINodeAdapter caching node id:" + node.getUniqueId()); + this.cachePool.push(node); + } + } else { + node.dispose(); + } + } + + onUpdateChild(id: number, node: FrameNode): void { + let index = id; + let text = node.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + this.value = "onUpdateChild" + } +} + +class MyNodeAdapterController extends NodeController { + rootNode: FrameNode | null = null; + nodeAdapter: MyNodeAdapter | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let listNode = typeNode.createNode(uiContext, "List"); + listNode.initialize({ space: 3 }).borderWidth(2).borderColor(Color.Black); + this.rootNode.appendChild(listNode); + this.nodeAdapter = new MyNodeAdapter(uiContext, 100); + NodeAdapter.attachNodeAdapter(this.nodeAdapter, listNode); + return this.rootNode; + } +} + +@Entry +@Component +struct UiFrameNodeRenderNodeMarkNodeAdapter0010 { + adapterController: MyNodeAdapterController = new MyNodeAdapterController(); + @State returnValue: string = "Value"; + + build() { + Column() { + Text("ListNode Adapter"); + NodeContainer(this.adapterController) + .width("100%").height("70%") + .borderWidth(1).borderColor(Color.Black); + Row() { + Text("setTotalNodeCount"); + Button("0") + .id("button1") + .onClick(() => { + this.adapterController.nodeAdapter?.setTotalNodeCount(0); + }).margin({ left: 20 }) + Button("100") + .id("button2") + .onClick(() => { + this.adapterController.nodeAdapter?.setTotalNodeCount(100); + setTimeout(() => { + this.returnValue = this.adapterController.nodeAdapter?.getTotalNodeCount().toString()!; + }, 1000); + }) + Button("2") + .id("button3") + .onClick(() => { + this.adapterController.nodeAdapter?.setTotalNodeCount(2); + }) + Button("3") + .id("button4") + .onClick(() => { + this.adapterController.nodeAdapter?.setTotalNodeCount(3); + }) + }.margin(10) + + Text(this.returnValue) + .id("text-Value") + .margin(10) + }.borderWidth(1) + .width("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..f82785b9640566429dc49691f410ccc8fc086a5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0040.ets @@ -0,0 +1,203 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FrameNode, NodeController, NodeAdapter, typeNode } from '@kit.ArkUI'; + +class MyNodeAdapter extends NodeAdapter { + uiContext: UIContext + cachePool: Array = new Array(); + changed: boolean = false + reloadTimes: number = 0; + data: Array = new Array(); + hostNode?: FrameNode + value: string = "Value" + + constructor(uiContext: UIContext, count: number) { + super(); + this.uiContext = uiContext; + this.totalNodeCount = count; + this.loadData(); + } + + + setTotalNodeCount(count: number): void { + this.totalNodeCount = count; + this.reloadAllItems(); + } + + getTotalNodeCount(): number { + return this.totalNodeCount; + } + + getValue(): string { + return this.value + } + + refreshData(): number { + let items = this.getAllAvailableItems() + console.log("UINodeAdapter get All items:" + items.length); + this.reloadAllItems(); + return items.length; + } + + attachData(): boolean { + return NodeAdapter.attachNodeAdapter(this, this.hostNode); + } + + detachData(): number { + NodeAdapter.detachNodeAdapter(this.hostNode); + return this.reloadTimes = 0; + } + + loadData(): void { + for (let i = 0; i < this.totalNodeCount; i++) { + this.data[i] = "Adapter ListItem " + i + " r:" + this.reloadTimes; + } + } + + reloadData(from: number, count: number): void { + this.reloadTimes ++ + for (let i = 0; i < count; i++) { + let index = i + from; + this.data[index] = "Adapter ListItem " + (this.changed ? "changed:" : "") + index + " r:" + this.reloadTimes; + } + this.reloadItem(from, count); + } + + insertData(from: number, count: number): void { + for (let i = 0; i < count; i++) { + let index = i + from; + this.data.splice(index, 0, "Adapter ListItem " + from + "-" + i); + } + this.insertItem(from, count); + this.totalNodeCount += count; + console.log("UINodeAdapter after insert count:" + this.totalNodeCount); + } + + removeData(from: number, count: number): void { + let arr = this.data.splice(from, count); + this.removeItem(from, count); + this.totalNodeCount -= arr.length; + console.log("UINodeAdapter after remove count:" + this.totalNodeCount); + } + + moveData(from: number, to: number): void { + let tmp = this.data.splice(from, 1); + this.data.splice(to, 0, tmp[0]); + this.moveItem(from, to); + } + + onAttachToNode(target: FrameNode): void { + console.log("UINodeAdapter onAttachToNode id:" + target.getUniqueId()); + this.hostNode = target; + } + + onDetachFromNode(): void { + console.log("UINodeAdapter onDetachFromNode"); + } + + onGetChildId(index: number): number { + console.log("UINodeAdapter onGetChildId:" + index); + return index; + } + + onCreateChild(index: number): FrameNode { + console.log("UINodeAdapter onCreateChild:" + index); + if (this.cachePool.length > 0) { + let cacheNode = this.cachePool.pop(); + if (cacheNode !== undefined) { + console.log("UINodeAdapter onCreateChild reused id:" + cacheNode.getUniqueId()); + let text = cacheNode?.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + return cacheNode; + } + } + console.log("UINodeAdapter onCreateChild createNew"); + let itemNode = typeNode.createNode(this.uiContext, "ListItem"); + let textNode = typeNode.createNode(this.uiContext, "Text"); + textNode.initialize(this.data[index]).fontSize(20); + itemNode.appendChild(textNode); + return itemNode; + } + + onDisposeChild(id: number, node: FrameNode): void { + console.log("UINodeAdapter onDisposeChild:" + id); + if (this.cachePool.length < 10) { + if (!this.cachePool.includes(node)) { + console.log("UINodeAdapter caching node id:" + node.getUniqueId()); + this.cachePool.push(node); + } + } else { + node.dispose(); + } + } + + onUpdateChild(id: number, node: FrameNode): void { + let index = id; + let text = node.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + this.value = "onUpdateChild" + } +} + +class MyNodeAdapterController extends NodeController { + rootNode: FrameNode | null = null; + nodeAdapter: MyNodeAdapter | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let listNode = typeNode.createNode(uiContext, "List"); + listNode.initialize({ space: 3 }).borderWidth(2).borderColor(Color.Black); + this.rootNode.appendChild(listNode); + this.nodeAdapter = new MyNodeAdapter(uiContext, 3); + NodeAdapter.attachNodeAdapter(this.nodeAdapter, listNode); + return this.rootNode; + } +} + +@Entry +@Component +struct UiFrameNodeRenderNodeMarkNodeAdapter0040 { + adapterController: MyNodeAdapterController = new MyNodeAdapterController(); + @State returnValue: string = "Value"; + + build() { + Column() { + Text("ListNode Adapter"); + NodeContainer(this.adapterController) + .width("100%").height("70%") + .borderWidth(1).borderColor(Color.Black); + Row() { + Button("Reload-0-0") + .id("button-reload-0-0") + .onClick(() => { + this.adapterController.nodeAdapter?.reloadData(0, 0) + }) + Button("Reload-0-1") + .id("button-reload-0-1") + .onClick(() => { + this.adapterController.nodeAdapter?.reloadData(0, 1) + }) + Button("Reload-0-50") + .id("button-reload-0-5") + .onClick(() => { + this.adapterController.nodeAdapter?.reloadData(0, 5) + }) + }.margin(10) + }.borderWidth(1) + .width("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..baa9415987cb2b7dd333675bd5e620809026a157 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0050.ets @@ -0,0 +1,203 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FrameNode, NodeController, NodeAdapter, typeNode } from '@kit.ArkUI'; + +class MyNodeAdapter extends NodeAdapter { + uiContext: UIContext + cachePool: Array = new Array(); + changed: boolean = false + reloadTimes: number = 0; + data: Array = new Array(); + hostNode?: FrameNode + value: string = "Value" + + constructor(uiContext: UIContext, count: number) { + super(); + this.uiContext = uiContext; + this.totalNodeCount = count; + this.loadData(); + } + + + setTotalNodeCount(count: number): void { + this.totalNodeCount = count; + this.reloadAllItems(); + } + + getTotalNodeCount(): number { + return this.totalNodeCount; + } + + getValue(): string { + return this.value + } + + refreshData(): number { + let items = this.getAllAvailableItems() + console.log("UINodeAdapter get All items:" + items.length); + this.reloadAllItems(); + return items.length; + } + + attachData(): boolean { + return NodeAdapter.attachNodeAdapter(this, this.hostNode); + } + + detachData(): number { + NodeAdapter.detachNodeAdapter(this.hostNode); + return this.reloadTimes = 0; + } + + loadData(): void { + for (let i = 0; i < this.totalNodeCount; i++) { + this.data[i] = "Adapter ListItem " + i + " r:" + this.reloadTimes; + } + } + + reloadData(from: number, count: number): void { + this.reloadTimes ++ + for (let i = 0; i < count; i++) { + let index = i + from; + this.data[index] = "Adapter ListItem " + (this.changed ? "changed:" : "") + index + " r:" + this.reloadTimes; + } + this.reloadItem(from, count); + } + + insertData(from: number, count: number): void { + for (let i = 0; i < count; i++) { + let index = i + from; + this.data.splice(index, 0, "Adapter ListItem " + from + "-" + i); + } + this.insertItem(from, count); + this.totalNodeCount += count; + console.log("UINodeAdapter after insert count:" + this.totalNodeCount); + } + + removeData(from: number, count: number): void { + let arr = this.data.splice(from, count); + this.removeItem(from, count); + this.totalNodeCount -= arr.length; + console.log("UINodeAdapter after remove count:" + this.totalNodeCount); + } + + moveData(from: number, to: number): void { + let tmp = this.data.splice(from, 1); + this.data.splice(to, 0, tmp[0]); + this.moveItem(from, to); + } + + onAttachToNode(target: FrameNode): void { + console.log("UINodeAdapter onAttachToNode id:" + target.getUniqueId()); + this.hostNode = target; + } + + onDetachFromNode(): void { + console.log("UINodeAdapter onDetachFromNode"); + } + + onGetChildId(index: number): number { + console.log("UINodeAdapter onGetChildId:" + index); + return index; + } + + onCreateChild(index: number): FrameNode { + console.log("UINodeAdapter onCreateChild:" + index); + if (this.cachePool.length > 0) { + let cacheNode = this.cachePool.pop(); + if (cacheNode !== undefined) { + console.log("UINodeAdapter onCreateChild reused id:" + cacheNode.getUniqueId()); + let text = cacheNode?.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + return cacheNode; + } + } + console.log("UINodeAdapter onCreateChild createNew"); + let itemNode = typeNode.createNode(this.uiContext, "ListItem"); + let textNode = typeNode.createNode(this.uiContext, "Text"); + textNode.initialize(this.data[index]).fontSize(20); + itemNode.appendChild(textNode); + return itemNode; + } + + onDisposeChild(id: number, node: FrameNode): void { + console.log("UINodeAdapter onDisposeChild:" + id); + if (this.cachePool.length < 10) { + if (!this.cachePool.includes(node)) { + console.log("UINodeAdapter caching node id:" + node.getUniqueId()); + this.cachePool.push(node); + } + } else { + node.dispose(); + } + } + + onUpdateChild(id: number, node: FrameNode): void { + let index = id; + let text = node.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + this.value = "onUpdateChild" + } +} + +class MyNodeAdapterController extends NodeController { + rootNode: FrameNode | null = null; + nodeAdapter: MyNodeAdapter | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let listNode = typeNode.createNode(uiContext, "List"); + listNode.initialize({ space: 3 }).borderWidth(2).borderColor(Color.Black); + this.rootNode.appendChild(listNode); + this.nodeAdapter = new MyNodeAdapter(uiContext, 100); + NodeAdapter.attachNodeAdapter(this.nodeAdapter, listNode); + return this.rootNode; + } +} + +@Entry +@Component +struct UiFrameNodeRenderNodeMarkNodeAdapter0050 { + adapterController: MyNodeAdapterController = new MyNodeAdapterController(); + @State returnValue: string = "Value"; + + build() { + Column() { + Text("ListNode Adapter"); + NodeContainer(this.adapterController) + .width("100%").height("70%") + .borderWidth(1).borderColor(Color.Black); + Row() { + Button("Remove-0-0") + .id("button1") + .onClick(() => { + this.adapterController.nodeAdapter?.removeData(0, 0) + }) + Button("Remove-1-20") + .id("button2") + .onClick(() => { + this.adapterController.nodeAdapter?.removeData(1, 20) + }) + Button("Remove-0-101") + .id("button3") + .onClick(() => { + this.adapterController.nodeAdapter?.removeData(0, 101) + }) + }.margin(10) + }.borderWidth(1) + .width("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..86acf3b02fe0095a53c736b75e64e3c93de07e48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0060.ets @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FrameNode, NodeController, NodeAdapter, typeNode } from '@kit.ArkUI'; + +class MyNodeAdapter extends NodeAdapter { + uiContext: UIContext + cachePool: Array = new Array(); + changed: boolean = false + reloadTimes: number = 0; + data: Array = new Array(); + hostNode?: FrameNode + value: string = "Value" + + constructor(uiContext: UIContext, count: number) { + super(); + this.uiContext = uiContext; + this.totalNodeCount = count; + this.loadData(); + } + + setTotalNodeCount(count: number): void { + this.totalNodeCount = count; + this.reloadAllItems(); + } + + getTotalNodeCount(): number { + return this.totalNodeCount; + } + + getValue(): string { + return this.value + } + + refreshData(): number { + let items = this.getAllAvailableItems() + console.log("UINodeAdapter get All items:" + items.length); + this.reloadAllItems(); + return items.length; + } + + attachData(): boolean { + return NodeAdapter.attachNodeAdapter(this, this.hostNode); + } + + detachData(): number { + NodeAdapter.detachNodeAdapter(this.hostNode); + return this.reloadTimes = 0; + } + + loadData(): void { + for (let i = 0; i < this.totalNodeCount; i++) { + this.data[i] = "Adapter ListItem " + i + " r:" + this.reloadTimes; + } + } + + reloadData(from: number, count: number): void { + this.reloadTimes++ + for (let i = 0; i < count; i++) { + let index = i + from; + this.data[index] = "Adapter ListItem " + (this.changed ? "changed:" : "") + index + " r:" + this.reloadTimes; + } + this.reloadItem(from, count); + } + + insertData(from: number, count: number): void { + for (let i = 0; i < count; i++) { + let index = i + from; + this.data.splice(index, 0, "Adapter ListItem " + from + "-" + i); + } + this.insertItem(from, count); + this.totalNodeCount += count; + console.log("UINodeAdapter after insert count:" + this.totalNodeCount); + } + + removeData(from: number, count: number): void { + let arr = this.data.splice(from, count); + this.removeItem(from, count); + this.totalNodeCount -= arr.length; + console.log("UINodeAdapter after remove count:" + this.totalNodeCount); + } + + moveData(from: number, to: number): void { + let tmp = this.data.splice(from, 1); + this.data.splice(to, 0, tmp[0]); + this.moveItem(from, to); + } + + onAttachToNode(target: FrameNode): void { + console.log("UINodeAdapter onAttachToNode id:" + target.getUniqueId()); + this.hostNode = target; + } + + onDetachFromNode(): void { + console.log("UINodeAdapter onDetachFromNode"); + } + + onGetChildId(index: number): number { + console.log("UINodeAdapter onGetChildId:" + index); + return index; + } + + onCreateChild(index: number): FrameNode { + console.log("UINodeAdapter onCreateChild:" + index); + if (this.cachePool.length > 0) { + let cacheNode = this.cachePool.pop(); + if (cacheNode !== undefined) { + console.log("UINodeAdapter onCreateChild reused id:" + cacheNode.getUniqueId()); + let text = cacheNode?.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + return cacheNode; + } + } + console.log("UINodeAdapter onCreateChild createNew"); + let itemNode = typeNode.createNode(this.uiContext, "ListItem"); + let textNode = typeNode.createNode(this.uiContext, "Text"); + textNode.initialize(this.data[index]).fontSize(20); + itemNode.appendChild(textNode); + return itemNode; + } + + onDisposeChild(id: number, node: FrameNode): void { + console.log("UINodeAdapter onDisposeChild:" + id); + if (this.cachePool.length < 10) { + if (!this.cachePool.includes(node)) { + console.log("UINodeAdapter caching node id:" + node.getUniqueId()); + this.cachePool.push(node); + } + } else { + node.dispose(); + } + } + + onUpdateChild(id: number, node: FrameNode): void { + let index = id; + let text = node.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + this.value = "onUpdateChild" + } +} + +class MyNodeAdapterController extends NodeController { + rootNode: FrameNode | null = null; + nodeAdapter: MyNodeAdapter | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let listNode = typeNode.createNode(uiContext, "List"); + listNode.initialize({ space: 3 }).borderWidth(2).borderColor(Color.Black); + this.rootNode.appendChild(listNode); + this.nodeAdapter = new MyNodeAdapter(uiContext, 5); + NodeAdapter.attachNodeAdapter(this.nodeAdapter, listNode); + return this.rootNode; + } +} + +@Entry +@Component +struct UiFrameNodeRenderNodeMarkNodeAdapter0060 { + adapterController: MyNodeAdapterController = new MyNodeAdapterController(); + @State returnValue: string = "Value"; + + build() { + Column() { + Text("ListNode Adapter"); + NodeContainer(this.adapterController) + .width("100%").height("70%") + .borderWidth(1).borderColor(Color.Black); + Row() { + Button("Insert-0-1") + .id("button1") + .onClick(() => { + this.adapterController.nodeAdapter?.insertData(0, 1) + }) + Row() { + Button("Insert-1-20") + .id("button2") + .onClick(() => { + this.adapterController.nodeAdapter?.insertData(1, 20) + }) + Button("Detach") + .id("button3") + .onClick(() => { + this.adapterController.nodeAdapter?.detachData() + }) + }.margin(10) + }.borderWidth(1) + .width("100%") + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..f42ee6c9994ae11b231a987ae17bec1a7d005c74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0070.ets @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FrameNode, NodeController, NodeAdapter, typeNode } from '@kit.ArkUI'; + +class MyNodeAdapter extends NodeAdapter { + uiContext: UIContext + cachePool: Array = new Array(); + changed: boolean = false + reloadTimes: number = 0; + data: Array = new Array(); + hostNode?: FrameNode + value: string = "Value" + + constructor(uiContext: UIContext, count: number) { + super(); + this.uiContext = uiContext; + this.totalNodeCount = count; + this.loadData(); + } + + + setTotalNodeCount(count: number): void { + this.totalNodeCount = count; + this.reloadAllItems(); + } + + getTotalNodeCount(): number { + return this.totalNodeCount; + } + + getValue(): string { + return this.value + } + + refreshData(): number { + let items = this.getAllAvailableItems() + console.log("UINodeAdapter get All items:" + items.length); + this.reloadAllItems(); + return items.length; + } + + attachData(): boolean { + return NodeAdapter.attachNodeAdapter(this, this.hostNode); + } + + detachData(): number { + NodeAdapter.detachNodeAdapter(this.hostNode); + return this.reloadTimes = 0; + } + + loadData(): void { + for (let i = 0; i < this.totalNodeCount; i++) { + this.data[i] = "Adapter ListItem " + i + " r:" + this.reloadTimes; + } + } + + reloadData(from: number, count: number): void { + this.reloadTimes ++ + for (let i = 0; i < count; i++) { + let index = i + from; + this.data[index] = "Adapter ListItem " + (this.changed ? "changed:" : "") + index + " r:" + this.reloadTimes; + } + this.reloadItem(from, count); + } + + insertData(from: number, count: number): void { + for (let i = 0; i < count; i++) { + let index = i + from; + this.data.splice(index, 0, "Adapter ListItem " + from + "-" + i); + } + this.insertItem(from, count); + this.totalNodeCount += count; + console.log("UINodeAdapter after insert count:" + this.totalNodeCount); + } + + removeData(from: number, count: number): void { + let arr = this.data.splice(from, count); + this.removeItem(from, count); + this.totalNodeCount -= arr.length; + console.log("UINodeAdapter after remove count:" + this.totalNodeCount); + } + + moveData(from: number, to: number): void { + let tmp = this.data.splice(from, 1); + this.data.splice(to, 0, tmp[0]); + this.moveItem(from, to); + } + + onAttachToNode(target: FrameNode): void { + console.log("UINodeAdapter onAttachToNode id:" + target.getUniqueId()); + this.hostNode = target; + } + + onDetachFromNode(): void { + console.log("UINodeAdapter onDetachFromNode"); + } + + onGetChildId(index: number): number { + console.log("UINodeAdapter onGetChildId:" + index); + return index; + } + + onCreateChild(index: number): FrameNode { + console.log("UINodeAdapter onCreateChild:" + index); + if (this.cachePool.length > 0) { + let cacheNode = this.cachePool.pop(); + if (cacheNode !== undefined) { + console.log("UINodeAdapter onCreateChild reused id:" + cacheNode.getUniqueId()); + let text = cacheNode?.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + return cacheNode; + } + } + console.log("UINodeAdapter onCreateChild createNew"); + let itemNode = typeNode.createNode(this.uiContext, "ListItem"); + let textNode = typeNode.createNode(this.uiContext, "Text"); + textNode.initialize(this.data[index]).fontSize(20); + itemNode.appendChild(textNode); + return itemNode; + } + + onDisposeChild(id: number, node: FrameNode): void { + console.log("UINodeAdapter onDisposeChild:" + id); + if (this.cachePool.length < 10) { + if (!this.cachePool.includes(node)) { + console.log("UINodeAdapter caching node id:" + node.getUniqueId()); + this.cachePool.push(node); + } + } else { + node.dispose(); + } + } + + onUpdateChild(id: number, node: FrameNode): void { + let index = id; + let text = node.getFirstChild(); + let textNode = text as typeNode.Text; + textNode?.initialize(this.data[index]).fontSize(20); + this.value = "onUpdateChild" + } +} + +class MyNodeAdapterController extends NodeController { + rootNode: FrameNode | null = null; + nodeAdapter: MyNodeAdapter | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + let listNode = typeNode.createNode(uiContext, "List"); + listNode.initialize({ space: 3 }).borderWidth(2).borderColor(Color.Black); + this.rootNode.appendChild(listNode); + this.nodeAdapter = new MyNodeAdapter(uiContext, 5); + NodeAdapter.attachNodeAdapter(this.nodeAdapter, listNode); + return this.rootNode; + } +} + +@Entry +@Component +struct UiFrameNodeRenderNodeMarkNodeAdapter0070 { + adapterController: MyNodeAdapterController = new MyNodeAdapterController(); + @State returnValue: string = "Value"; + + build() { + Column() { + Text("ListNode Adapter"); + NodeContainer(this.adapterController) + .width("100%").height("70%") + .borderWidth(1).borderColor(Color.Black); + Row() { + Button("Move-0-0") + .id("button1") + .onClick(() => { + this.adapterController.nodeAdapter?.moveData(0, 0) + }) + Button("Move-0-3") + .id("button2") + .onClick(() => { + this.adapterController.nodeAdapter?.moveData(0, 3) + }) + }.margin(10) + }.borderWidth(1) + .width("100%") + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask.ets new file mode 100644 index 0000000000000000000000000000000000000000..584826540f2e9fe3722a981ff8c4ed8b5f9209b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderRadius = { + topLeft: 32, + topRight: 32, + bottomLeft: 32, + bottomRight: 32 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderRadius = { + topLeft: 0, + topRight: 0, + bottomLeft: 0, + bottomRight: 0 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..26c558e8973160954e0a6bb21d23775f357bb850 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0010.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0010 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 8, + top: 16, + right: 24, + bottom: 32 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..1e22976d279cf1cd3d5a03f25cd0b7bc231c24b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0020.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0020 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..221318284b4ef90b57e83e9e691a8b00bdfa45e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0030.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0030 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 0, + top: 0, + right: 0, + bottom: 0 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..27c2358ba223b67720b5119ce9d4fccc5c95776b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0040.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0040 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: -10, + top: -10, + right: -10, + bottom: -10 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..f33564dc930d2021ab4062bdea1080ed2f96dd54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0050.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0050 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderColor = { + left: 0xFFFF0000, + top: 0xFF0000FF, + right: 0xFFFFFF00, + bottom: 0xFF000000 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..4885b1cb076b454d2c75efcd41713392bf2ee88e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0060.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0060 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderColor = { + left: 0xFFFF0000, + top: 0xFFFF0000, + right: 0xFFFF0000, + bottom: 0xFFFF0000 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..83eaf39eaf028d0999831fcab7b9a0ce8c4636b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0070.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0070 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderColor = { + left: 0xFFFF0000, + top: 0xFFFF0000, + right: 0xFFFF0000, + bottom: 0xFFFF0000 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a18b6b806e221d1d390a8662497d4370bd54692 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0080.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderColor = { + left: 0xFFFF0000, + top: 0xFF0000FF, + right: 0xFFFFFF00, + bottom: 0xFF000000 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0080 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 8, + top: 16, + right: 24, + bottom: 32 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..698655e9a6d3cf6019a1555968c01f9cd83e8f9e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0090.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderColor = { + left: 0xFFFF0000, + top: 0xFF0000FF, + right: 0xFFFFFF00, + bottom: 0xFF000000 +}; +renderNode.borderWidth = { + left: 8, + top: 16, + right: 24, + bottom: 32 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0090 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 16, + top: 16, + right: 16, + bottom: 16 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..cee71313b89f47fbfae35b537411b6eb76046a77 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0110.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.borderRadius = { + topLeft: 32, + topRight: 32, + bottomLeft: 32, + bottomRight: 32 +}; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0110 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderRadius = { + topLeft: -10, + topRight: -10, + bottomLeft: -10, + bottomRight: -10 + }; + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..f275cf9e163eb26af2abf9a703ab3b3d82217a54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0120.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +let borderStyle: BorderStyle = null!; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0120 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("Dotted") + .id("Button001") + .onClick(() => { + borderStyle = BorderStyle.Dotted + }).margin(50) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 + }; + renderNode.borderStyle = { + left: borderStyle, + top: borderStyle, + right: borderStyle, + bottom: borderStyle + } + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..923afd13128ddb7b1ef78b74b0290b006754adda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0130.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +let borderStyle: BorderStyle = null!; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0130 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("Dashed") + .id("Button001") + .onClick(() => { + borderStyle = BorderStyle.Dashed + }).margin(50) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 + }; + renderNode.borderStyle = { + left: borderStyle, + top: borderStyle, + right: borderStyle, + bottom: borderStyle + } + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..d150c3f8efe889307435fe8cec7ffbb2a014d2a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0140.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +let borderStyle: BorderStyle = null!; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0140 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("Solid") + .id("Button001") + .onClick(() => { + borderStyle = BorderStyle.Solid + }).margin(50) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 + }; + renderNode.borderStyle = { + left: borderStyle, + top: borderStyle, + right: borderStyle, + bottom: borderStyle + } + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..32240981b35aa8c5e439a9a3cd54d37dfe936db0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0150.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 { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 150 +}; +renderNode.backgroundColor = 0XFF00FF00; +let borderStyle: BorderStyle = null!; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0150 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("不设置") + .id("Button001") + .onClick(() => { + }).margin(50) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.borderWidth = { + left: 8, + top: 8, + right: 8, + bottom: 8 + }; + renderNode.borderStyle = { + left: borderStyle, + top: borderStyle, + right: borderStyle, + bottom: borderStyle + } + }).margin(50) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..42bde6fb84175dd7167604cab210c484f8dab5e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0170.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 100 +}; +renderNode.backgroundColor = 0xffff0000; + +const mask = new ShapeMask(); +mask.setRectShape({ + left: 0, + right: 350, + top: 0, + bottom: 250 +}); +mask.fillColor = 0x55FF0000; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0170 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..083d1acaf80556553ceccb7829447b59e2d7bb69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0180.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 300, height: 200 }; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0180 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ff87cc1d05b37ebb98b97c9bc012916ef3939b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0190.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ left: 0, right: 100, top: 100, bottom: 150 }); +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; +// mask.strokeWidth = 24; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 800, height: 600 }; +renderNode.backgroundColor = 0XFF00FF00; +// renderNode.shapeMask = mask; +// const shapeMask = renderNode.shapeMask; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0190 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..272fbbbc21dab85ab2b094672d5b857711335bea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0200.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ left: 0, right: 100, top: 0, bottom: 100 }); +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 80, height: 60 }; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0200 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..642312d6fd4d8baf822ec9b45f18ea3fa4c0fe80 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0210.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ left: 0, right: 50, top: 0, bottom: 50 }); +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 80, height: 60 }; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0210 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..21dd6b684ca659c97e4d15c9da46a110bb16e13e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0220.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 80, height: 60 }; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0220 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setRoundRectShape") + .id("Button001") + .onClick(() => { + mask.setRoundRectShape({ + rect: { + left: 0, + top: 0, + right: vp2px(80), + bottom: vp2px(60) + }, + corners: { + topLeft: { x: 32, y: 32 }, + topRight: { x: 32, y: 32 }, + bottomLeft: { x: 32, y: 32 }, + bottomRight: { x: 32, y: 32 } + } + }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..39931b441a387e860f0c9b26656899d659ef184d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0230.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 80, height: 60 }; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0230 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setRoundRectShape") + .id("Button001") + .onClick(() => { + mask.setRoundRectShape({ + rect: { + left: 0, + top: 0, + right: vp2px(100), + bottom: vp2px(100) + }, + corners: { + topLeft: { x: 32, y: 32 }, + topRight: { x: 32, y: 32 }, + bottomLeft: { x: 32, y: 32 }, + bottomRight: { x: 32, y: 32 } + } + }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..7b872c1a1acd68a61d8d2197e20baa5323dfdc52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0240.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { x: 0, y: 0, width: 80, height: 60 }; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0240 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setRoundRectShape") + .id("Button001") + .onClick(() => { + mask.setRoundRectShape({ + rect: { + left: 0, + top: 0, + right: vp2px(50), + bottom: vp2px(50) + }, + corners: { + topLeft: { x: 32, y: 32 }, + topRight: { x: 32, y: 32 }, + bottomLeft: { x: 32, y: 32 }, + bottomRight: { x: 32, y: 32 } + } + }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..048a6497218d6c096c725b92676c4994fa4b800b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0250.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0250 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setCircleShape") + .id("Button001") + .onClick(() => { + mask.setCircleShape({ centerY: 75, centerX: 75, radius: 75 }) + mask.fillColor = 0X55FF0000; + mask.strokeColor = 0XFFFF0000; + }).margin(100) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin(100) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..72333ef3af76c5bb10e4f6d653dde1e7d1ac6d32 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0260.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setCircleShape({ centerY: 75, centerX: 75, radius: 75 }) +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 60, + height: 80 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0260 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setCircleShape") + .id("Button001") + .onClick(() => { + }).margin(100) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin(100) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..c743049917628dedd0053484d0bb020f55d0e50d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0270.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setCircleShape({ centerY: 75, centerX: 75, radius: 75 }) +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0270 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setCircleShape") + .id("Button001") + .onClick(() => { + }).margin(100) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin(100) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..e47aee1f92761a255885b3e694e57d26b8430ece --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0280.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 100 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0280 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setRoundRectShape") + .id("Button001") + .onClick(() => { + mask.setOvalShape({ + left: 75, + top: 0, + right: 250, + bottom: 100 + }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..41eefd28c96ee71e86fef14e93a6d26daae21b75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0290.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 80, + height: 60 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0290 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setRoundRectShape") + .id("Button001") + .onClick(() => { + mask.setOvalShape({ + left: 75, + top: 0, + right: 250, + bottom: 100 + }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..97468d028b084692bc694550deba46f42227b087 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0300.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 200, + height: 100 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0300 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setRoundRectShape") + .id("Button001") + .onClick(() => { + mask.setOvalShape({ + left: 75, + top: 0, + right: 250, + bottom: 100 + }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..5505856e3e2cfe435c5a6c5b0bdf009af4918c10 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0310.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0310 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setCommandPath") + .id("Button001") + .onClick(() => { + mask.setCommandPath({ commands: "M100 0 L0 100 L50 200 L150 200 L200 100 Z" }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..32747d80d47a66922acec5e36ccc22bd81d59058 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0320.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 80, + height: 60 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0320 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setCommandPath") + .id("Button001") + .onClick(() => { + mask.setCommandPath({ commands: "M100 0 L0 100 L50 200 L150 200 L200 100 Z" }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..615466e18e19dc89ff5b28a4a86d9acab56d4347 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0330.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); + +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0330 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("setCommandPath") + .id("Button001") + .onClick(() => { + mask.setCommandPath({ commands: "M100 0 L0 100 L50 200 L150 200 L200 100 Z" }); + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1fad830874db428a5541e5d4a20c7800556a872 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0340.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ left: 0, right: 100, top: 0, bottom: 100 }); + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0340 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("fillColor") + .id("Button001") + .onClick(() => { + mask.fillColor = 0XFFFF0000; + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..032f25676458f115a389e94171fa5f4178133011 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0350.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ left: 0, right: 450, top: 0, bottom: 300 }); + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0350 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("fillColor") + .id("Button001") + .onClick(() => { + mask.fillColor = Color.Red; + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d4c4db8f3bcc91eea54f8df43a3f6526cf2692b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0360.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ left: 0, right: 450, top: 0, bottom: 300 }) +mask.fillColor = 0X55FF0000; +mask.strokeWidth = 24; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0360 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("strokeColor") + .id("Button001") + .onClick(() => { + mask.strokeColor = 0XFFFF0000; + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..740f6284f42714bcd25c8851cf6698fa1e4647b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0370.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ left: 0, right: 450, top: 0, bottom: 300 }) + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0370 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("strokeColor") + .id("Button001") + .onClick(() => { + mask.strokeColor = Color.Red; + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin({ top: 50 }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..39a5dac9fc8a01414c5e2c70584bf3495816594d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0380.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ + left: 0, + right: 450, + top: 0, + bottom: 300 +}) +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.shapeMask = mask; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0380 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("strokeWidth = 24") + .id("Button001") + .onClick(() => { + mask.strokeWidth = 24; + }).margin(50) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin(50) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2dc3477cfbd6fc283e3a79814a2ece3f6b3d75e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0390.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ + left: 0, + right: 450, + top: 0, + bottom: 300 +}) +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; +mask.strokeWidth = 24; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.shapeMask = mask; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0390 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("strokeWidth = 0") + .id("Button001") + .onClick(() => { + mask.strokeWidth = 0; + }).margin(50) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin(50) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..c02317abc686fbf156ed38373430414b62c4aa8d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0400.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 { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ + left: 0, + right: 450, + top: 0, + bottom: 300 +}) +mask.fillColor = 0X55FF0000; +mask.strokeColor = 0XFFFF0000; +mask.strokeWidth = 24; + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 300, + height: 200 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.shapeMask = mask; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0400 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("strokeWidth = -10") + .id("Button001") + .onClick(() => { + mask.strokeWidth = -10; + }).margin(50) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin(50) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..90c1ce95a0bfaa84567b0ab47dbdb41f9bebe78f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0410.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; + +const mask = new ShapeMask(); +mask.setRectShape({ + left: 0, + right: 150, + top: 0, + bottom: 150 +}) + +const renderNode = new RenderNode(); +renderNode.frame = { + x: 0, + y: 0, + width: 100, + height: 100 +}; +renderNode.backgroundColor = 0XFF00FF00; +renderNode.shapeMask = mask; + +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + + const rootRenderNode = this.rootNode.getRenderNode(); + if (rootRenderNode !== null) { + rootRenderNode.appendChild(renderNode); + } + + return this.rootNode; + } +} + +@Entry +@Component +struct UiMotionAnimationMask0410 { + private myNodeController: MyNodeController = new MyNodeController(); + + build() { + Column() { + NodeContainer(this.myNodeController) + Button("strokeColor") + .id("Button001") + .onClick(() => { + mask.fillColor = 0X000000FF; + mask.strokeColor = 0XFF0000FF; + }).margin({ top: 50 }) + Button("strokeWidth") + .id("Button003") + .onClick(() => { + mask.strokeWidth = 24; + }).margin({ top: 50 }) + Button("start") + .id("Button002") + .onClick(() => { + renderNode.shapeMask = mask; + }).margin(50) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 index e58bd507f3ecff51931c351ebcabf6603cd5c40c..b27957df19e9b245dcfce292548707ef4e6edc0e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 @@ -12,15 +12,33 @@ "installationFree": false, "pages": "$profile:test_pages", "requestPermissions": [ + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "usedScene": { + "abilities":[ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, { "name": "ohos.permission.WRITE_MEDIA" }, { "name": "ohos.permission.READ_MEDIA" }, + { + "name":"ohos.permission.CAPTURE_SCREEN" + }, { "name":"ohos.permission.UPDATE_CONFIGURATION" }, + { + "name":"ohos.permission.ACCESS_SCREEN_LOCK_INNER" + }, { "name":"ohos.permission.RUNNING_LOCK" }, diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/butterfly_0.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/butterfly_0.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1bb0e98066ea646bf5d723963206db8878b319 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/butterfly_0.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..11ccb085fbe47a42299784dafb07406094ec3d38 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 @@ -1766,6 +1766,606 @@ "testability/pages/UIComponentButtonCommonButton/UIComponentButtonCommonButton039", "testability/pages/UIComponentButtonCommonButton/UIComponentButtonCommonButton040", "testability/pages/UIComponentButtonCommonButton/UIComponentButtonCommonButton041", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0010", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0020", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0030", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0040", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0050", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0060", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0070", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0080", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0090", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0110", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0120", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0130", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0140", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0150", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0170", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0180", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0190", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0200", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0210", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0220", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0230", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0240", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0250", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0260", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0270", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0280", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0290", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0300", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0310", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0320", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0330", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0340", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0350", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0360", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0370", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0380", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0390", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0400", + "testability/pages/UiMotionAnimationMask/UiMotionAnimationMask0410", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0010", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0020", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0030", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0040", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0110", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0120", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0130", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0140", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0050", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0060", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0070", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0080", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0090", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0100", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0150", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0160", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0170", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0180", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0190", + "testability/pages/UIFrameNodeMeasureAndLayout/UIFrameNodeMeasureAndLayout0200", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommoneventFramenodeClip0100", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0080", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0120", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0130", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0140", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0230", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0240", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0260", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0320", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0340", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0370", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0420", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0450", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0470", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0480", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0490", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0520", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0530", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0570", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0600", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0610", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0620", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0630", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0650", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0660", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0670", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0690", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0700", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0710", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0740", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0750", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0770", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0820", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0830", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0840", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0870", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0880", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0980", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1040", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1130", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1170", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1190", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1280", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1290", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1310", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1370", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1390", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1420", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1470", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1500", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1520", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1530", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1540", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1570", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1580", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1620", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1650", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1660", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1670", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1680", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1700", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1710", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1720", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1740", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1750", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1760", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1790", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1800", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1820", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1870", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1880", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1890", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1920", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1930", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2030", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2040", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2090", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface001", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface003", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface005", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface006", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface028", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface030", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface039", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface043", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface044", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface054", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface085", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface101", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface106", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface108", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface110", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface111", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface133", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface135", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface144", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface148", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface149", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface159", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface190", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface097", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface202", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface145", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface121", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface016", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface040", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface173", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface068", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface118", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface130", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface161", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface056", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface191", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface086", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface099", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1260", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0210", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterfaceSharedTransition", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0150", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0270", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0380", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0500", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0510", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0550", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0640", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0860", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0930", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0940", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0960", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1200", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1320", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1430", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1550", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1560", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1600", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1690", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1980", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1990", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2010", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0030", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0040", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0050", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0060", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0070", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0080", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0090", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0100", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0120", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0130", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0140", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0150", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0160", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0180", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0190", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0110", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0150", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0170", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0180", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0210", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0010", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0020", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0030", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0060", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0070", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0080", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0160", + "testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0010", + "testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0020", + "testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0030", + "testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0040", + "testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0060", + "testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0080", + "testability/pages/UiComponentGraphicNodecontainerBuildernode/UiComponentGraphicNodecontainerBuildernode0090", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface007", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface009", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface035", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface036", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface041", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface046", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface059", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface078", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface112", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface114", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface140", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface141", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface146", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface151", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface164", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface183", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface205", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface100", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface011", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface116", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface186", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface081", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface079", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface184", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface080", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface185", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface208", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface103", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface115", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface010", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface076", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface181", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface178", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface073", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface177", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface072", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface138", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface033", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface123", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface018", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface020", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface125", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface017", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface122", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface019", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface124", + "testability/pages/UILcomponeentGraphicNodecontainerToolchains/UILcomponeentGraphicNodecontainerToolchains0020", + "testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0010", + "testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0040", + "testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0050", + "testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0060", + "testability/pages/UiFrameNodeRenderNodeMarkNodeAdapter/UiFrameNodeRenderNodeMarkNodeAdapter0070", + "testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0010", + "testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0080", + "testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0260", + "testability/pages/UIComponentCraphicNodeContainerRender/UIComponentCraphicNodeContainerRender0270", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0010", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0020", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0030", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0040", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0050", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0430", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0440", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0450", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0460", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0470", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0510", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0520", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0530", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0540", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativeprope0500", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope015", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope013", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope014", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope055", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope056", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0080", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0090", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0100", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0160", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0170", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0180", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0190", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0200", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0210", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0240", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0250", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0260", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0270", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0280", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0310", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0320", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0330", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0340", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0370", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0380", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0390", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0400", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0570", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0610", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0620", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0630", + "testability/pages/UIMotionAnimationImperativeprope/UIMotionAnimationImperativePrope0640", + "testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0020", + "testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0030", + "testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0050", + "testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0060", + "testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0040", + "testability/pages/UIFramenodeAcquisitionAbility/UIFramenodeAcquisitionAbility0070", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0120", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0140", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0150", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0160", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0170", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0110", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0300", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0310", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0320", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0180", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0210", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0200", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0060", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0220", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0080", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0230", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0090", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0250", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0100", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0070", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0240", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0190", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4000", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4010", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4020", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4030", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4040", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4050", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4060", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4070", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4100", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4110", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4120", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4130", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4140", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4150", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4170", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4180", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4190", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4200", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0360", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4090", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4080", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0050", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4210", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4220", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4230", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4240", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4250", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4260", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4270", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4280", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4290", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4300", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode4310", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4000", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4010", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4020", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4030", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4040", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4050", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4060", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4070", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4080", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4090", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4100", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4110", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4120", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4130", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4140", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4150", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4160", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4170", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4180", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4190", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4200", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4210", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventTypeNodeCreateFrameNode4230", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0130", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0260", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0370", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0390", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0380", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0280", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0400", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0020", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0290", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0030", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0010", + "testability/pages/ActionEventCommonEventFrameNode/ActionEventCommonEventFrameNode0270", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0010", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0020", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0140", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0160", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0170", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0180", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0200", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0210", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0240", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0260", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0280", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0290", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0300", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0320", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0330", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0340", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0400", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0410", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0420", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTextureXport0450", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0060", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0110", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0120", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0130", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0150", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0220", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0230", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0250", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0270", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0310", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0360", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0380", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0390", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0350", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0370", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0440", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0520", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0490", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0460", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0470", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0430", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0510", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0090", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0480", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0080", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0500", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0030", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0530", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0070", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0540", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0040", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0190", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0100", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0560", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0050", + "testability/pages/UIComponentSpecialComponentsFrameNodeTextureXport/UIComponentSpecialComponentsFrameNodeTexetureExport0550", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0100", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0010", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0020", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0030", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0080", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0090", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0110", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0120", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0130", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0140", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0150", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0160", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0170", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0180", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/ActionEventCommonEventFrameNodeOnDraw0190", + "testability/pages/ActionEventCommonEventFrameNodeOnDraw/UIComponentGraphicNodeContainer0230", + "testability/pages/UiComponentCmmonattrRendering/UiComponentCmmonattrRendering0200", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0330", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0340", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0350", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0370", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0380", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0390", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0400", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0410", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0420", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0430", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0440", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0760", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0820", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0830", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0840", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0860", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0870", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0880", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget0790", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1170", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1180", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1190", + "testability/pages/UIComponentPopupBoxPopupFollowTransformOfTarget/UIComponentPopupBoxPopupFollowTransformOfTarget1200", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0190", + "testability/pages/UIFrameNodeRanderNodeMarkNodeGroup/UIFrameNodeRanderNodeMarkNodeGroup0200", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0040", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0050", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0060", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0070", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0160", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0170", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0180", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0190", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0200", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0210", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0220", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0230", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0240", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0250", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0260", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0270", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0280", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0290", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0300", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0310", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0320", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0330", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0340", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0350", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0360", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0370", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0380", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0390", + "testability/pages/ActionEventCommoneventFramenodeClip/ActionEventCommonEventFrameNodeClip0400", + "testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0010", + "testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0030", + "testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0040", + "testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0050", + "testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0060", + "testability/pages/UIComponentGraphicNodeContainerToolChains/UIComponentGraphicNodeContainerToolChains0070", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0020", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0040", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0250", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0060", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0290", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0310", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0580", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0890", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0910", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface0920", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1020", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1070", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1090", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1300", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1340", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1360", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1630", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1940", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1950", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1960", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface1970", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2000", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2060", + "testability/pages/UIComponentSpecialComponentsFrameNodeAttributeInterface/UIComponentSpecialComponentsFrameNodeAttributeInterface2070", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0010", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0020", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0030", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0040", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0050", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0060", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0070", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0080", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0090", + "testability/pages/UIComponentSpecialComponentsFrameNodePageInfoTest/UIComponentSpecialComponentsFrameNodePageInfo0100", + "testability/pages/ComponentGtaphicNodecontainerDocDemo/ComponentGtaphicNodecontainerDocDemo", "testability/pages/UIComponentPopupBoxSpecificationsPopup/UIComponentPopupBoxSpecificationsPopup001", "testability/pages/UIComponentPopupBoxSpecificationsPopup/UIComponentPopupBoxSpecificationsPopup002", "testability/pages/UIComponentPopupBoxSpecificationsPopup/UIComponentPopupBoxSpecificationsPopup003", diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/butterfly.mp4 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/butterfly.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..c8489799f549457b017664d6eb7ccbd82ae5bff4 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/butterfly.mp4 differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/test.html b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/test.html new file mode 100644 index 0000000000000000000000000000000000000000..41ede0290be8c45de3369cb6d07a1e40241dcbce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/test.html @@ -0,0 +1,67 @@ + + + + 同层渲染测试html + + + + +
+ 同层渲染测试html +
+ +
+
+ + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/video_1.mp4 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/video_1.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..6ba1ce4fabd81dec393d270f87085ab687aa8d8d Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/video_1.mp4 differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/webtest.html b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/webtest.html new file mode 100644 index 0000000000000000000000000000000000000000..ed1300e43c86aa77fc423f4142485fd6b97b7d0e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/webtest.html @@ -0,0 +1,13 @@ + + + + + 同层渲染html + + + + + + + + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/webtest2.html b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/webtest2.html new file mode 100644 index 0000000000000000000000000000000000000000..04eb04402478c6ba5343a8e5c8c5643014ff3609 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/rawfile/webtest2.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file