From 259771c78229e536ef42e7940a8f97b6a3796c33 Mon Sep 17 00:00:00 2001 From: zhoudede Date: Fri, 8 Aug 2025 09:31:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E20=E6=9D=A1=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoudede --- .../Statusmanagerv2Optimize.test.ets | 686 ++++++++++++++++++ .../Statusmanagerv2Optimize100.ets | 55 ++ .../Statusmanagerv2Optimize110.ets | 56 ++ .../Statusmanagerv2Optimize120.ets | 59 ++ .../Statusmanagerv2Optimize140.ets | 55 ++ .../Statusmanagerv2Optimize150.ets | 55 ++ .../Statusmanagerv2Optimize160.ets | 55 ++ .../Statusmanagerv2Optimize180.ets | 68 ++ .../Statusmanagerv2Optimize190.ets | 45 ++ .../Statusmanagerv2Optimize20.ets | 66 ++ .../Statusmanagerv2Optimize200.ets | 79 ++ .../Statusmanagerv2Optimize210.ets | 45 ++ .../Statusmanagerv2Optimize220.ets | 57 ++ .../Statusmanagerv2Optimize230.ets | 47 ++ .../Statusmanagerv2Optimize240.ets | 62 ++ .../Statusmanagerv2Optimize250.ets | 63 ++ .../Statusmanagerv2Optimize30.ets | 40 + .../Statusmanagerv2Optimize40.ets | 56 ++ .../Statusmanagerv2Optimize60.ets | 72 ++ .../Statusmanagerv2Optimize70.ets | 56 ++ .../Statusmanagerv2Optimize80.ets | 66 ++ 21 files changed, 1843 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize100.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize110.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize120.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize140.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize150.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize160.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize180.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize190.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize20.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize200.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize210.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize220.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize230.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize30.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize40.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize60.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize70.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize80.ets diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets new file mode 100644 index 00000000..a9c7aeb8 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets @@ -0,0 +1,686 @@ +/** + * Copyright (c) 2025 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, Level } 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 { hidebug } from '@kit.PerformanceAnalysisKit'; +import { BusinessError } from '@kit.BasicServicesKit'; + +export default function Statusmanagerv2Optimize() { + + describe('Statusmanagerv2Optimize', () => { + 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_STATUSMANAGERV2_OPTIMIZE_0080 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0080 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0080', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0080 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize80") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0030 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0030 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0030', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0030 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize30") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0040 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0040 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0040', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0040 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize40") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0020 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0020 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0020', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0020 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize20") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0120 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0120 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0120', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0120 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize120") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0070 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0070 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0070', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0070 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize70") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0060 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0060 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0060', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0060 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize60") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0160 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0160 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0160', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0160 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize160") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0100 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0100 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0100', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0100 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize100") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0150 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0150 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0150', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0150 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize150") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0110 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0110 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0110', Level.LEVEL1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0110 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize110") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0140 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0140 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0140', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0140 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize140") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0180 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0180 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0180', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0180 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize180") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0200 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0200 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0200', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0200 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize200") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(10000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0190 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0190 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0190', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0190 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize190") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0210 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0210 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0210', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0210 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize210") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0220 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0220 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0220', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0220 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize220") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('ca'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + let component_1 = await driver.waitForComponent(ON.id('cb'), 1000); // 显式等待组件出现[6](@ref) + await component_1.click(); + await driver.waitForIdle(500,2000) + let component_2 = await driver.waitForComponent(ON.id('cba'), 1000); // 显式等待组件出现[6](@ref) + await component_2.click(); + await driver.waitForIdle(500,2000) + let component_3 = await driver.waitForComponent(ON.id('abb'), 1000); // 显式等待组件出现[6](@ref) + await component_3.click(); + await driver.waitForIdle(500,2000) + let component_4 = await driver.waitForComponent(ON.id('cba_n'), 1000); // 显式等待组件出现[6](@ref) + await component_4.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0230 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0230 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0230', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0230 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize230") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('change length'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0260 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0260 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0260', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0260 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize260") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + // 通过ID定位(推荐) + let component_1 = await driver.waitForComponent(ON.id('btn2'), 1000); // 显式等待组件出现[6](@ref) + await component_1.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0270 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0270 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0270', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0270 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize270") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + // 通过ID定位(推荐) + let component_1 = await driver.waitForComponent(ON.id('btn2'), 1000); // 显式等待组件出现[6](@ref) + await component_1.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + // 通过ID定位(推荐) + let component_1 = await driver.waitForComponent(ON.id('btn2'), 1000); // 显式等待组件出现[6](@ref) + await component_1.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0280 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0280 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0280', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0280 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize280") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0290 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0290 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0290', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0290 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize290") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0340 + * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0340 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0340', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0340 start.`); + Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize340") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + done(); + }) + + }) +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize100.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize100.ets new file mode 100644 index 00000000..ac993714 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize100.ets @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2025 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. + */ +type MixedType_150 = number | boolean | string | null | undefined | (() => void); +enum LoginType_150 { pass = "密码登录", code = "验证码登录" } +@Component +struct CompD_150 { + @Consume flag: MixedType_150 | LoginType_150 ; + + build() { + Column() { + Text(`Local ${this.flag}`) + } + } +} + +@Entry +@Component +struct CompA_150 { + @Provide flag: MixedType_150 | LoginType_150 = 0; + + build() { + Column() { + Button('refresh') + .margin(10) + .onClick(() => { + const current = this.flag; + if (typeof current === "number") { + this.flag = "文字"; + } else if (typeof current === "string") { + this.flag = true; + } else if (typeof current === "boolean") { + this.flag = () => console.log("函数执行"); + } else if (current instanceof Function) { + this.flag = null; + } else { + this.flag = LoginType_150.pass; // 枚举值 + } + }) + .id('btn') + CompD_150() + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize110.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize110.ets new file mode 100644 index 00000000..2d7cef0b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize110.ets @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2025 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. + */ +type MixedType_110 = number | boolean | string | null | undefined | (() => void); +enum LoginType_110 { pass = "密码登录", code = "验证码登录" } +@Component +struct CompD_110 { + @Consume flag: MixedType_110 | LoginType_110 ; + + build() { + Column() { + Text(`Local ${this.flag}`) + + } + } +} + +@Entry +@Component +struct CompA_110 { + @Provide flag: MixedType_110 | LoginType_110 = undefined; + + build() { + Column() { + Button('refresh') + .margin(10) + .onClick(() => { + const current = this.flag; + if (typeof current === "number") { + this.flag = "文字"; + } else if (typeof current === "string") { + this.flag = true; + } else if (typeof current === "boolean") { + this.flag = () => console.log("函数执行"); + } else if (current instanceof Function) { + this.flag = null; + } else { + this.flag = LoginType_110.pass; // 枚举值 + } + }) + .id('btn') + CompD_110() + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize120.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize120.ets new file mode 100644 index 00000000..532b30a6 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize120.ets @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2025 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. + */ + +@Component +struct CompD { + @Consume selectedDate: Date; + @Consume message: Map + @Consume message_set: Set + @Consume privateArray: string[] + + build() { + Column() { + ForEach(Array.from(this.message.entries()), (item: [number, string]) => { + Text(`${item[0]}`).fontSize(30) + Text(`${item[1]}`).fontSize(30) + Divider() + }) + Button(`refresh`) + .onClick(() => { + this.selectedDate.setDate(this.selectedDate.getDate() + 1) + this.message.set(4, "d") + this.message_set.add(5) + this.privateArray.push('D') + }) + .id('btn') + } + } +} + +@Entry +@Component +struct CompA { + @Provide selectedDate: Date = new Date('2021-08-08') + @Provide message: Map = new Map([[0, "a"], [1, "b"], [3, "c"]]) + @Provide message_set: Set = new Set([0, 1, 2, 3, 4]) + @Provide privateArray: string[] = ['A', 'B', 'C']; + + build() { + Column() { + Button('refresh') + .margin(10) + .onClick(() => { + }) + CompD() + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize140.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize140.ets new file mode 100644 index 00000000..4a71020f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize140.ets @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2025 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. + */ +type MixedType_140 = number | boolean | string | null | undefined | (() => void); +enum LoginType_140 { pass = "密码登录", code = "验证码登录" } +@Component +struct CompD_140 { + @Consume flag: MixedType_140 | LoginType_140 ; + + build() { + Column() { + Text(`Local ${this.flag}`) + Button('refresh') + .margin(10) + .onClick(() => { + const current = this.flag; + if (typeof current === "number") { + this.flag = "文字"; + } else if (typeof current === "string") { + this.flag = true; + } else if (typeof current === "boolean") { + this.flag = () => console.log("函数执行"); + } else if (current instanceof Function) { + this.flag = null; + } else { + this.flag = LoginType_140.pass; // 枚举值 + } + }) + .id('btn') + } + } +} + +@Entry +@Component +struct CompA_140 { + @Provide flag: MixedType_140 | LoginType_140 = undefined; + + build() { + Column() { + CompD_140() + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize150.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize150.ets new file mode 100644 index 00000000..21a8c798 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize150.ets @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2025 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. + */ +type MixedType_100 = number | boolean | string | null | undefined | (() => void); +enum LoginType_100 { pass = "密码登录", code = "验证码登录" } +@Component +struct CompD_100 { + @Consume flag: MixedType_100 | LoginType_100 ; + + build() { + Column() { + Text(`Local ${this.flag}`) + Button('refresh') + .margin(10) + .onClick(() => { + const current = this.flag; + if (typeof current === "number") { + this.flag = "文字"; + } else if (typeof current === "string") { + this.flag = true; + } else if (typeof current === "boolean") { + this.flag = () => console.log("函数执行"); + } else if (current instanceof Function) { + this.flag = null; + } else { + this.flag = LoginType_100.pass; // 枚举值 + } + }) + .id('btn') + } + } +} + +@Entry +@Component +struct CompA_100 { + @Provide flag: MixedType_100 | LoginType_100 = undefined; + + build() { + Column() { + CompD_100() + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize160.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize160.ets new file mode 100644 index 00000000..e29c4654 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize160.ets @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2025 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. + */ + +@Component +struct CompD_160 { + @Consume selectedDate: Date; + @Consume message: Map + @Consume message_set: Set + @Consume privateArray: string[] + + build() { + Column() { + ForEach(Array.from(this.message.entries()), (item: [number, string]) => { + Text(`${item[0]}`).fontSize(30) + Text(`${item[1]}`).fontSize(30) + Divider() + }) + } + } +} + +@Entry +@Component +struct CompA_160 { + @Provide selectedDate: Date = new Date('2021-08-08') + @Provide message: Map = new Map([[0, "a"], [1, "b"], [3, "c"]]) + @Provide message_set: Set = new Set([0, 1, 2, 3, 4]) + @Provide privateArray: string[] = ['A', 'B', 'C']; + + build() { + Column() { + Button(`refresh`) + .onClick(() => { + this.selectedDate.setDate(this.selectedDate.getDate() + 1) + this.message.set(4, "d") + this.message_set.add(5) + this.privateArray.push('D') + }) + .id('btn') + CompD_160() + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize180.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize180.ets new file mode 100644 index 00000000..9248dbae --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize180.ets @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2025 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. + */ + +// 定义类型和枚举 +type ComplexType = number | string | boolean | null | undefined | (() => void); +enum LogLevel { + Info = "INFO", + Error = "ERROR" +} + +// 数据模型 +@ObservedV2 +class AppData { + @Trace current: ComplexType = "Initial"; + + // 计算属性(根据联合类型动态返回描述) + @Computed get typeDescription(): string { + switch (typeof this.current) { + case "number": + return `数字: ${this.current}`; + case "boolean": + return `布尔: ${this.current ? "是" : "否"}`; + case "function": + return "函数类型"; + default: + return this.current === null ? "null" : "undefined"; + } + } +} + +// 主组件 +@Entry +@ComponentV2 +struct MainPage_180 { + appData: AppData = new AppData(); + + // 刷新联合类型值 + updateValue(newVal: ComplexType) { + this.appData.current = newVal; + } + + build() { + Column() { + // 显示联合类型信息 + Text("联合类型示例").fontSize(24).margin(10) + Text(this.appData.typeDescription).fontSize(18) + Text(`实际类型: ${typeof this.appData.current}`).fontColor(Color.Blue) + + // 操作按钮组 + Button("设置为数字") + .onClick(() => this.updateValue(100)) + .margin(5) + .id('btn') + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize190.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize190.ets new file mode 100644 index 00000000..404f5928 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize190.ets @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2025 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. + */ + +// 数据模型 +@ObservedV2 +class AppData_190 { + @Trace current: undefined = undefined; + + // 计算属性(根据联合类型动态返回描述) + @Computed get typeDescription(): undefined { + return this.current; + } +} + +// 主组件 +@Entry +@ComponentV2 +struct MainPage_190 { + appData: AppData_190 = new AppData_190(); + + build() { + Column() { + // 显示联合类型信息 + Text("文本:"+this.appData.typeDescription).fontSize(18) + + // 操作按钮组 + Button("refresh") + .onClick(()=>{this.appData.current=undefined}) + .margin(5) + .id('btn') + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize20.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize20.ets new file mode 100644 index 00000000..ff445edf --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize20.ets @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2025 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. + */ +// 定义联合类型 +type MixedType_20 = number | boolean | string | null | undefined | (() => void); +enum LoginType { pass = "密码登录", code = "验证码登录" } + +// 数据模型 +@ObservedV2 +class DataModel { + @Trace value: MixedType_20 | LoginType = 0; +} + +// 入口组件 +@Entry +@ComponentV2 +struct MainPage { + dataModel: DataModel = new DataModel(); + + // 刷新逻辑 + refreshValue() { + const current = this.dataModel.value; + if (typeof current === "number") { + this.dataModel.value = "文字"; + } else if (typeof current === "string") { + this.dataModel.value = true; + } else if (typeof current === "boolean") { + this.dataModel.value = () => console.log("函数执行"); + } else if (current instanceof Function) { + this.dataModel.value = null; + } else { + this.dataModel.value = LoginType.pass; // 枚举值 + } + } + + build() { + Column() { + Text("联合类型值刷新示例") + .fontSize(24) + .margin(20) + + Text(`值: ${this.dataModel.value}`) + .fontSize(18) + + Text(`类型: ${typeof this.dataModel.value}`) + .fontColor(Color.Grey) + + Button("切换值") + .onClick(() => this.refreshValue()) + .margin(20) + .width("60%") + .id('btn') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize200.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize200.ets new file mode 100644 index 00000000..b84ab0b9 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize200.ets @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2025 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. + */ + +@ObservedV2 +class DataModel_200 { + // 原始状态(需响应式更新) + @Trace arrayData: string[] = ['A', 'B']; + @Trace setData: Set = new Set([1, 2]); + @Trace mapData: Map = new Map([['active', true]]); + @Trace dateData: Date = new Date('2023-07-08'); + + // 派生状态(@Computed 返回新对象) + @Computed get computedArray(): string[] { + return [...this.arrayData, 'COMPUTED']; // 返回新数组 + } + + @Computed get computedSet(): Set { + const newSet = new Set(this.setData) + newSet.add(3) + return newSet; // 返回新 Set + } + + @Computed get computedMap(): Map { + const newMap = new Map(this.mapData); + newMap.set('computed', false); + return newMap; // 返回新 Map + } + + @Computed get formattedDate(): Date { + const newDate = new Date(this.dateData) + newDate.setDate(1) + return newDate; // 返回字符串(避免引用问题) + } +} +@Entry +@ComponentV2 +struct Index_200 { + data: DataModel_200 = new DataModel_200(); + + refreshAll() { + this.data.arrayData.push('C') + this.data.setData.add(4) + this.data.mapData.set("new",false) + this.data.dateData.setDate(2) + } + + build() { + Column() { + + ForEach(this.data.computedArray, (item: string, index: number) => { + Text(`${index} ${item}`) + .fontSize(40) + }) + ForEach(Array.from(this.data.computedSet.entries()), (item: [string, string]) => { + Text(`${item[0]}`) + }) + ForEach(Array.from(this.data.computedSet.entries()), (item: [string, number]) => { + Text(`${item[0]}`) + Text(`${item[1]}`) + }) + Text(`Date: ${this.data.formattedDate.toLocaleString()}`) + + // 刷新按钮 + Button('refresh').onClick(() => this.refreshAll()).id('btn') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize210.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize210.ets new file mode 100644 index 00000000..208601d2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize210.ets @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2025 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. + */ + +// 数据模型 +@ObservedV2 +class AppData_210 { + @Trace current: string = 'hello'; + + // 计算属性(根据联合类型动态返回描述) + @Computed get typeDescription(): string { + return this.current; + } +} + +// 主组件 +@Entry +@ComponentV2 +struct MainPage_210 { + appData: AppData_210 = new AppData_210(); + + build() { + Column() { + // 显示联合类型信息 + Text("文本:"+this.appData.typeDescription).fontSize(18) + + // 操作按钮组 + Button("refresh") + .onClick(()=>{this.appData.current = 'hi'}) + .margin(5) + .id('btn') + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize220.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize220.ets new file mode 100644 index 00000000..504ef237 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize220.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2025 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. + */ + +let bigObj: Record = {} +let temp: Array = Array.from(new Array(100).keys()) +temp.forEach(item => { + bigObj[item] = item; +}) +@ObservedV2 +class B { + @Trace arr: string[] = ['a', 'b'] + @Trace bb: string = 'cccc' + constructor(bb: string) { + this.bb = bb; + } +} +@Entry +@ComponentV2 +struct Page21 { + @Local a: Record = {1: 1}; + @Local b: B = new B('qqq') + build() { + Column() { + Text(`${JSON.stringify(this.a)}`) + Text(`${this.b.bb}`) + Button('change a').onClick(() => { + this.a = bigObj + }).id('ca') + Button('change b').onClick(() => { + this.b = new B(`wwww`)//上报Local + }).id('cb') + Button('change b.arr').onClick(() => { + this.b.arr.push("ddd")//方案1 没有装饰器、属性名、所属组件 + }).id('cba') + Button('change b.bb').onClick(() => { + this.b.bb= 'ccc'//上报的Trace + }).id('abb') + Button('change b.aa=new arr').onClick(() => { + this.b.arr= ['ccc']//上报的Trace + }).id('cba_n') + } + .height('100%') + .width('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize230.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize230.ets new file mode 100644 index 00000000..16784816 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize230.ets @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2025 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. + */ + +@ObservedV2 +class Pencil { + @Trace length: number = 21; // 当length变化时,会刷新关联的组件 +} +class Bag { + width: number = 50; + height: number = 60; + pencil: Pencil = new Pencil(); +} + +@Entry +@ComponentV2 +struct Page { + bag: Bag = new Bag(); + + build() { + Column() { + Text('pencil length'+ this.bag.pencil.length) + // UINode (1) + Button("change length") + .onClick(() => { + // 点击更改length值,UINode(1)会刷新 + this.bag.pencil.length += 100; + }) + Button("assign Son") + .onClick(() => { + // 由于变量bag非状态变量,因此无法刷新UINode(1) + this.bag = new Bag(); + }) + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets new file mode 100644 index 00000000..6e3d2b4b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2025 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. + */ + +//使用以下ets +@ObservedV2 +class User_240 { + @Trace name: string; + @Trace age: number; + + constructor(name: string, age: number) { + this.name = name; + this.age = age; + } +} +@Entry +@ComponentV2 +struct Parent_240 { + + @Provider('data1') users1: User_240 = new User_240('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.name}`).fontSize(30) + Child_240() + Button('add new user') + .onClick(() => { + this.users1= new User_240('Molly', 19);//Provider + }) + .id('btn1') + + Button('change name') + .onClick(() => { + this.users1.name = 'Shelly';//Trace + }) + .id('btn2') + } + } +} + +@ComponentV2 +struct Child_240 { + @Consumer('data1') users1: User_240= new User_240('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.age}`).fontSize(30) + Divider() + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets new file mode 100644 index 00000000..8a1340fa --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2025 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. + */ +//使用以下ets +@ObservedV2 +class User_250 { + @Trace name: string; + @Trace age: number; + + constructor(name: string, age: number) { + this.name = name; + this.age = age; + } +} +@Entry +@ComponentV2 +struct Parent_250 { + + @Provider('data1') users1: User_250 = new User_250('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.age}`).fontSize(30) + + Divider() + Child_250() + + } + } +} + +@ComponentV2 +struct Child_250 { + @Consumer('data1') users1: User_250= new User_250('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.name}`).fontSize(30) + Button('add new user') + .onClick(() => { + this.users1= new User_250('Molly', 19);//Provider + }) + .id('btn1') + + Button('change name') + .onClick(() => { + this.users1.name = 'Shelly';//Trace + }) + .id('btn2') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize30.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize30.ets new file mode 100644 index 00000000..c6d27bd0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize30.ets @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2025 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. + */ + +@ObservedV2 +class Product_30 { + @Trace price: number | null = null; +} + +@Entry +@ComponentV2 +struct Index_30 { + product: Product_30 = new Product_30(); + + build() { + Column() { + Text(`Price: ¥${this.product.price}`).fontSize(30) + Button("Increase Price") + .onClick(() => { + if(this.product.price){ + this.product.price += 10; // 直接修改,UI自动刷新 + }else { + this.product.price = 0; + } + }) + .id('btn') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize40.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize40.ets new file mode 100644 index 00000000..21401ae8 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize40.ets @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2025 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. + */ + +@ObservedV2 +class Product { + @Trace privateArray: string[] = ['A', 'B', 'C']; + @Trace privateSet: Set = new Set(['X', 'Y']); + @Trace privateMap: Map = new Map([['key1', 1], ['key2', 2]]); + @Trace privateDate: Date = new Date('2021-08-08') +} + +@Entry +@ComponentV2 +struct Index_op40 { + product: Product = new Product(); + + // 刷新 @Local 变量的方法 + refreshAll() { + this.product.privateArray.push('D'); // 直接修改数组 + this.product.privateSet.add('Z'); + this.product.privateMap.set('key3', 3); + this.product.privateDate = new Date('2023-07-08'); + } + + build() { + Column() { + ForEach(this.product.privateArray, (item: string, index: number) => { + Text(`${index} ${item}`) + .fontSize(40) + }) + ForEach(Array.from(this.product.privateSet.entries()), (item: [string, string]) => { + Text(`${item[0]}`) + }) + ForEach(Array.from(this.product.privateMap.entries()), (item: [string, number]) => { + Text(`${item[0]}`) + Text(`${item[1]}`) + }) + Text(`Date: ${this.product.privateDate.toLocaleString()}`) + + // 刷新按钮 + Button('Add to Array').onClick(() => this.refreshAll()).id('btn') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize60.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize60.ets new file mode 100644 index 00000000..9f27b0e6 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize60.ets @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2025 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. + */ +type MixedType = number | boolean | string | null | undefined | (() => void); +enum LoginType_60 { pass = "密码登录", code = "验证码登录" } +// 父组件 +@Entry +@ComponentV2 +struct Index_op60 { + @Local count: number|null = null; + @Local message: string|undefined = undefined; + @Local flag: MixedType | LoginType_60 = 0; + // 刷新逻辑 + refreshValue() { + const current = this.flag; + if (typeof current === "number") { + this.flag = "文字"; + } else if (typeof current === "string") { + this.flag = true; + } else if (typeof current === "boolean") { + this.flag = () => console.log("函数执行"); + } else if (current instanceof Function) { + this.flag = null; + } else { + this.flag = LoginType_60.pass; // 枚举值 + } + } + build() { + Column() { + Text(`Local ${this.count}`) + Text(`Local ${this.message}`) + Text(`Local ${this.flag}`) + Button("change Local") + .onClick(()=>{ + // 对数据源的更改会同步给子组件 + if(!this.count) this.count=0; + if(!this.message) this.message="hello" + this.refreshValue() + }) + .id('btn') + Child60({ + count: this.count, + message: this.message, + flag: this.flag + }) + } + } +} +@ComponentV2 +struct Child60 { + @Require @Param count: number|null; + @Require @Param message: string|undefined; + @Require @Param flag: MixedType | LoginType_60; + build() { + Column() { + Text(`Param ${this.count}`) + Text(`Param ${this.message}`) + Text(`Param ${this.flag}`) + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize70.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize70.ets new file mode 100644 index 00000000..3a43fb1f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize70.ets @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2025 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. + */ + +// 父组件 +@Entry +@ComponentV2 +struct Index70 { + @Local count: number|null = null; + @Local message: string|undefined = undefined; + @Local flag: boolean = false; + build() { + Column() { + Text(`Local ${this.count}`) + Text(`Local ${this.message}`) + Text(`Local ${this.flag}`) + Button("change Local") + .onClick(()=>{ + // 对数据源的更改会同步给子组件 + if(!this.count) this.count=0; + if(!this.message) this.message="hello" + this.flag = !this.flag; + }) + .id('btn') + Child_70({ + count: this.count, + message: this.message, + flag: this.flag + }) + } + } +} +@ComponentV2 +struct Child_70 { + @Require @Param count: number|null; + @Require @Param message: string|undefined; + @Require @Param flag: boolean; + build() { + Column() { + Text(`Param ${this.count}`) + Text(`Param ${this.message}`) + Text(`Param ${this.flag}`) + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize80.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize80.ets new file mode 100644 index 00000000..954a6d6d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize80.ets @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2025 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. + */ + +@Entry +@ComponentV2 +struct ComplexStateExample { + // @Local 装饰的复杂类型变量 + @Local privateArray: string[] = ['A', 'B', 'C']; + @Local privateSet: Set = new Set(['X', 'Y']); + @Local privateMap: Map = new Map([['key1', 1], ['key2', 2]]); + @Local privateDate: Date = new Date(); + + // 刷新 @Local 变量的方法 + refreshAll() { + this.privateArray.push('D'); // 直接修改数组 + this.privateSet.add('Z'); + this.privateMap.set('key3', 3); + } + + build() { + Column({ space: 10 }) { + // 显示 @Local 变量 + Text(`Array: ${this.privateArray.join(',')}`) + Text(`Set: ${Array.from(this.privateSet).join(',')}`) + Text(`Map: ${ + Array.from(this.privateMap.entries()) + .map(entry => `${entry[0]}=${entry[1]}`) // 通过索引访问 key 和 value + .join(',') + }`) + Text(`Date: ${this.privateDate.toLocaleString()}`) + + // 刷新按钮 + Button('Add to Array').onClick(() => this.refreshAll()).id('btn') + + // 显示 @Param 变量(假设由父组件传入) + ChildComponent({ paramArray: this.privateArray, paramDate: this.privateDate }) + } + .padding(20) + } +} + +// 子组件接收 @Param 变量 +@ComponentV2 +struct ChildComponent { + @Param paramArray: string[] = []; + @Param paramDate: Date = new Date(); + + build() { + Column() { + Text(`Parent Array: ${this.paramArray.join(',')}`) + Text(`Parent Date: ${this.paramDate.toLocaleString()}`) + } + } +} \ No newline at end of file -- Gitee From 37f12c78666ce81e5f28304b12b61d91a2d8ec39 Mon Sep 17 00:00:00 2001 From: zhoudede Date: Fri, 8 Aug 2025 09:45:40 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoudede --- .../Statusmanagerv2Optimize260.ets | 45 +++++++++++++++ .../Statusmanagerv2Optimize270.ets | 46 +++++++++++++++ .../Statusmanagerv2Optimize280.ets | 38 +++++++++++++ .../Statusmanagerv2Optimize290.ets | 43 ++++++++++++++ .../Statusmanagerv2Optimize300.ets | 57 +++++++++++++++++++ .../Statusmanagerv2Optimize310.ets | 57 +++++++++++++++++++ .../Statusmanagerv2Optimize320.ets | 57 +++++++++++++++++++ .../Statusmanagerv2Optimize330.ets | 57 +++++++++++++++++++ .../Statusmanagerv2Optimize340.ets | 48 ++++++++++++++++ 9 files changed, 448 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize260.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize270.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize280.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize290.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize340.ets diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize260.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize260.ets new file mode 100644 index 00000000..abcf3a89 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize260.ets @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2025 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. + */ + +@ObservedV2 +class Name { + @Trace firstName: string = 'Li'; + @Trace lastName: string = 'Hua'; + + @Computed + get fullName() { + console.info('---------Computed----------'); + return this.firstName + ' ' + this.lastName; + } +} + +const name: Name = new Name(); + +@Entry +@ComponentV2 +struct Index_260 { + name1: Name = name; + + build() { + Column() { + Text(this.name1.fullName) + Text(this.name1.fullName) + Button('changed lastName').onClick(() => { + this.name1.lastName += 'a'; + }) + .id('btn') + } + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize270.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize270.ets new file mode 100644 index 00000000..0be53343 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize270.ets @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2025 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 { UIUtils } from '@kit.ArkUI'; +class Info { + id: number = 0; +} + +@Entry +@Component +struct Index { + observedObj: Info = UIUtils.makeObserved(new Info()); + build() { + Column() { + Text(`${this.observedObj.id}`) + .fontSize(50) + .onClick(() => { + // 通过getTarget获取其原始对象,将this.observedObj赋值为不可观察的数据 + let rawObj: Info= UIUtils.getTarget(this.observedObj); + // 不会触发UI刷新,但数据会正常赋值 + rawObj.id = 20; + }) + .id('btn1') + + Text(`${this.observedObj.id}`) + .fontSize(50) + .onClick(() => { + // 触发UI刷新,Text显示21 + this.observedObj.id++; + }) + .id('btn2') + } + } +} + diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize280.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize280.ets new file mode 100644 index 00000000..9a7a9f31 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize280.ets @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2025 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. + */ +class InnerClass_280 { + name: string; + constructor(name: string) { + this.name = name; + } +} + +@Entry +@ComponentV2 +struct MyComponent_280 { + @Local outerObj:InnerClass_280 = new InnerClass_280("初始值") ; + + build() { + Column() { + Text(`嵌套类属性: ${this.outerObj.name}`) + Button("修改嵌套属性") + .onClick(() => { + this.outerObj.name = "新值"; // 不会触发UI刷新 + }) + .id('btn1') + } + } +} + diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize290.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize290.ets new file mode 100644 index 00000000..714d8531 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize290.ets @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2025 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. + */ +@ObservedV2 +class InnerClass { + name: string; + @Trace len:number ; + constructor(name: string,len : number) { + this.name = name; + this.len = len; + } +} + +@Entry +@ComponentV2 +struct MyComponent { + @Local outerObj:InnerClass = new InnerClass("初始值",3) ; + + build() { + Column() { + Text(`嵌套类属性: ${this.outerObj.name}`) + Text(`嵌套类属性: ${this.outerObj.len}`) + Button("修改嵌套属性") + .onClick(() => { + this.outerObj.name = "新值"; // 不会触发UI刷新 + this.outerObj.len = 2; + }) + .id('btn1') + } + } +} + diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets new file mode 100644 index 00000000..1c117dfb --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2025 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. + */ +//使用以下ets +@ObservedV2 +class User_300 { + name: string; + age: number; + + constructor(name: string, age: number) { + this.name = name; + this.age = age; + } +} +@Entry +@ComponentV2 +struct Parent_300 { + + @Provider('data1') users1: User_300 = new User_300('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.age}`).fontSize(30) + + Divider() + Child_300() + Button('add new user') + .onClick(() => { + this.users1= new User_300('Molly', 19);//Provider + }) + .id('btn1') + + } + } +} + +@ComponentV2 +struct Child_300 { + @Consumer('data1') users1: User_300= new User_300('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.name}`).fontSize(30) + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets new file mode 100644 index 00000000..8591cf6d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2025 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. + */ +//使用以下ets +@ObservedV2 +class User_310 { + @Trace name: string; + age: number; + + constructor(name: string, age: number) { + this.name = name; + this.age = age; + } +} +@Entry +@ComponentV2 +struct Parent_310 { + + @Provider('data1') users1: User_310 = new User_310('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.age}`).fontSize(30) + + Divider() + Child_310() + Button('add new user') + .onClick(() => { + this.users1= new User_310('Molly', 19);//Provider + }) + .id('btn1') + + } + } +} + +@ComponentV2 +struct Child_310 { + @Consumer('data1') users1: User_310= new User_310('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.name}`).fontSize(30) + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets new file mode 100644 index 00000000..031522ec --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2025 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. + */ +//使用以下ets +@ObservedV2 +class User_320 { + name: string; + age: number; + + constructor(name: string, age: number) { + this.name = name; + this.age = age; + } +} +@Entry +@ComponentV2 +struct Parent_320 { + + @Provider('data1') users1: User_320 = new User_320('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.age}`).fontSize(30) + + Divider() + Child_320() + + } + } +} + +@ComponentV2 +struct Child_320 { + @Consumer('data1') users1: User_320= new User_320('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.name}`).fontSize(30) + Button('add new user') + .onClick(() => { + this.users1= new User_320('Molly', 19);//Provider + }) + .id('btn1') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets new file mode 100644 index 00000000..a1057e0a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2025 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. + */ +//使用以下ets +@ObservedV2 +class User { + @Trace name: string; + age: number; + + constructor(name: string, age: number) { + this.name = name; + this.age = age; + } +} +@Entry +@ComponentV2 +struct Parent { + + @Provider('data1') users1: User = new User('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.age}`).fontSize(30) + + Divider() + Childop330() + + } + } +} + +@ComponentV2 +struct Childop330 { + @Consumer('data1') users1: User= new User('XIAOL',18); + + build() { + Column() { + Text(`name: ${this.users1.name}`).fontSize(30) + Button('add new user') + .onClick(() => { + this.users1= new User('Molly', 19);//Provider + }) + .id('btn1') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize340.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize340.ets new file mode 100644 index 00000000..19f5e184 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize340.ets @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2025 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. + */ + +@ObservedV2 +class ClassB { + @Trace num1: number = 10; + num2: number = 20; +} + +@ObservedV2 +class ClassA { + b: ClassB = new ClassB(); +} + +@Entry +@ComponentV2 +struct Indexop340 { + @Local a: ClassA = new ClassA(); + + @Computed + get fullName():number { + console.info('---------Computed----------'); + return this.a.b.num1 + this.a.b.num2; + } + + build() { + Column() { + Text(`Trace属性计算: ${this.fullName}`) // 自动更新 + Button('changed lastName').onClick(() => { + this.a.b.num1 = 30; + this.a.b.num2 = 40; + }) + .id('btn') + } + } +} \ No newline at end of file -- Gitee From c68520018d6a4df623aca71b1a9eb45e2c750238 Mon Sep 17 00:00:00 2001 From: zhoudede Date: Fri, 8 Aug 2025 09:48:34 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoudede --- .../StatusmanagerComponentreuse.test.ets | 334 ++++++++++++++++++ .../Statusmanagerv2Optimize.test.ets | 137 ------- .../StatusmanagerComponentreuse10.ets} | 43 +-- .../StatusmanagerComponentreuse100.ets} | 43 +-- .../StatusmanagerComponentreuse110.ets} | 43 +-- .../StatusmanagerComponentreuse120.ets | 34 ++ .../StatusmanagerComponentreuse150.ets} | 47 +-- .../StatusmanagerComponentreuse20.ets | 34 ++ .../StatusmanagerComponentreuse30.ets | 34 ++ .../StatusmanagerComponentreuse40.ets | 32 ++ .../StatusmanagerComponentreuse50.ets | 38 ++ .../StatusmanagerComponentreuse60.ets | 34 ++ .../StatusmanagerComponentreuse70.ets | 38 ++ .../StatusmanagerComponentreuse80.ets | 38 ++ .../StatusmanagerComponentreuse90.ets | 38 ++ .../Statusmanagerv2Optimize240.ets | 62 ---- .../Statusmanagerv2Optimize250.ets | 63 ---- 17 files changed, 702 insertions(+), 390 deletions(-) create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/StatusmanagerComponentreuseTest/StatusmanagerComponentreuse.test.ets rename sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/{Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets => StatusmanagerComponentreuse/StatusmanagerComponentreuse10.ets} (50%) rename sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/{Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets => StatusmanagerComponentreuse/StatusmanagerComponentreuse100.ets} (50%) rename sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/{Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets => StatusmanagerComponentreuse/StatusmanagerComponentreuse110.ets} (50%) create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse120.ets rename sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/{Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets => StatusmanagerComponentreuse/StatusmanagerComponentreuse150.ets} (53%) create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse20.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse30.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse40.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse50.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse60.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse70.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse80.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse90.ets delete mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets delete mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/StatusmanagerComponentreuseTest/StatusmanagerComponentreuse.test.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/StatusmanagerComponentreuseTest/StatusmanagerComponentreuse.test.ets new file mode 100644 index 00000000..c1273d28 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/StatusmanagerComponentreuseTest/StatusmanagerComponentreuse.test.ets @@ -0,0 +1,334 @@ +/** + * Copyright (c) 2025 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, Level } 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 I18n from '@ohos.i18n'; +import { BusinessError } from '@kit.BasicServicesKit'; + +export default function StatusmanagerComponentreuse() { + + describe('StatusmanagerComponentreuse', () => { + 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_STATUSMANAGER_COMPONENTREUSE_0020 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0020 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0020', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0020 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse20") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0020 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0030 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0030 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0030', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0030 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse30") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0030 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0120 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0120 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0120', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0120 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse120") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0120 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0060 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0060 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0060', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0060 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse60") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0060 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0040 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0040 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0040', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0040 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse40") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0040 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0110 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0110 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0110', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0110 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse110") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0110 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0100 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0100 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0100', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0100 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse100") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0100 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0010 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0010 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0010', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0010 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse10") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0010 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0080 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0080 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0080', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0080 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse80") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0080 finish.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0050 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0050 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0050', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0050 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse50") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0050 finish.`); + done(); + }) + + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0090 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0090 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0090', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0090 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse90") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0090 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0070 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0070 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0070', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0070 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse70") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0070 finish.`); + done(); + }) + + /* + * @tc.number : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0150 + * @tc.name : SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0150 + * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR + * @tc.type : Function + * @tc.size : MediumTest + * @tc.level : 1 + */ + it('SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0150', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0150 start.`); + Settings.createWindow("testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse150") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('btn'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000) + await component.click(); + await driver.waitForIdle(500,2000) + windowSnap.screenShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_STATUSMANAGER_COMPONENTREUSE_0150 finish.`); + done(); + }) + }) +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets index a9c7aeb8..2d348c55 100644 --- a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets @@ -454,31 +454,6 @@ export default function Statusmanagerv2Optimize() { done(); }) - /* - * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240 - * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240 - * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR - * @tc.type : Function - * @tc.size : MediumTest - * @tc.level : 1 - */ - it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240', Level.LEVEL3, async (done: Function) => { - Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0240 start.`); - Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240") - let driver:Driver = Driver.create(); - // 通过ID定位(推荐) - let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) - await component.click(); - await driver.waitForIdle(500,2000) - // 通过ID定位(推荐) - let component_1 = await driver.waitForComponent(ON.id('btn2'), 1000); // 显式等待组件出现[6](@ref) - await component_1.click(); - await driver.waitForIdle(500,2000) - windowSnap.screenShot(); - await Utils.sleep(1000); - done(); - }) - /* * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0270 * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0270 @@ -504,31 +479,6 @@ export default function Statusmanagerv2Optimize() { done(); }) - /* - * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250 - * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250 - * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR - * @tc.type : Function - * @tc.size : MediumTest - * @tc.level : 1 - */ - it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250', Level.LEVEL3, async (done: Function) => { - Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0250 start.`); - Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250") - let driver:Driver = Driver.create(); - // 通过ID定位(推荐) - let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) - await component.click(); - await driver.waitForIdle(500,2000) - // 通过ID定位(推荐) - let component_1 = await driver.waitForComponent(ON.id('btn2'), 1000); // 显式等待组件出现[6](@ref) - await component_1.click(); - await driver.waitForIdle(500,2000) - windowSnap.screenShot(); - await Utils.sleep(1000); - done(); - }) - /* * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0280 @@ -574,93 +524,6 @@ export default function Statusmanagerv2Optimize() { }) - /* - * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300 - * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300 - * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR - * @tc.type : Function - * @tc.size : MediumTest - * @tc.level : 1 - */ - it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300', Level.LEVEL3, async (done: Function) => { - Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0300 start.`); - Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300") - let driver:Driver = Driver.create(); - // 通过ID定位(推荐) - let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) - await component.click(); - await driver.waitForIdle(500,2000) - windowSnap.screenShot(); - await Utils.sleep(1000); - done(); - }) - - - /* - * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310 - * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310 - * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR - * @tc.type : Function - * @tc.size : MediumTest - * @tc.level : 1 - */ - it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310', Level.LEVEL3, async (done: Function) => { - Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0310 start.`); - Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310") - let driver:Driver = Driver.create(); - // 通过ID定位(推荐) - let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) - await component.click(); - await driver.waitForIdle(500,2000) - windowSnap.screenShot(); - await Utils.sleep(1000); - done(); - }) - - /* - * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320 - * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320 - * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR - * @tc.type : Function - * @tc.size : MediumTest - * @tc.level : 1 - */ - it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320', Level.LEVEL3, async (done: Function) => { - Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0320 start.`); - Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320") - let driver:Driver = Driver.create(); - // 通过ID定位(推荐) - let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) - await component.click(); - await driver.waitForIdle(500,2000) - windowSnap.screenShot(); - await Utils.sleep(1000); - done(); - }) - - - /* - * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330 - * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330 - * @tc.desc : Counter is placed on the mirror page in Chinese mode, and the direction is set to LTR - * @tc.type : Function - * @tc.size : MediumTest - * @tc.level : 1 - */ - it('SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330', Level.LEVEL3, async (done: Function) => { - Logger.info('TEST', `SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0330 start.`); - Settings.createWindow("testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330") - let driver:Driver = Driver.create(); - // 通过ID定位(推荐) - let component = await driver.waitForComponent(ON.id('btn1'), 1000); // 显式等待组件出现[6](@ref) - await component.click(); - await driver.waitForIdle(500,2000) - windowSnap.screenShot(); - await Utils.sleep(1000); - done(); - }) - - /* * @tc.number : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0340 * @tc.name : SUB_ACE_STATUSMANAGERV2_OPTIMIZE_0340 diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse10.ets similarity index 50% rename from sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets rename to sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse10.ets index 031522ec..2ed08c1a 100644 --- a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize320.ets +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse10.ets @@ -12,46 +12,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -//使用以下ets -@ObservedV2 -class User_320 { - name: string; - age: number; - - constructor(name: string, age: number) { - this.name = name; - this.age = age; - } -} @Entry @ComponentV2 -struct Parent_320 { - - @Provider('data1') users1: User_320 = new User_320('XIAOL',18); - +struct Index_10 { build() { Column() { - Text(`name: ${this.users1.age}`).fontSize(30) - - Divider() - Child_320() - + ReusableV2Component_10() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_10() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_10() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId } } } - +@ReusableV2 @ComponentV2 -struct Child_320 { - @Consumer('data1') users1: User_320= new User_320('XIAOL',18); - +struct ReusableV2Component_10 { build() { - Column() { - Text(`name: ${this.users1.name}`).fontSize(30) - Button('add new user') - .onClick(() => { - this.users1= new User_320('Molly', 19);//Provider - }) - .id('btn1') - } + Text('HELLO').onClick(()=>{}).id('btn') } -} \ No newline at end of file +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse100.ets similarity index 50% rename from sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets rename to sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse100.ets index 1c117dfb..01c4c53f 100644 --- a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize300.ets +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse100.ets @@ -12,46 +12,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -//使用以下ets -@ObservedV2 -class User_300 { - name: string; - age: number; - - constructor(name: string, age: number) { - this.name = name; - this.age = age; - } -} @Entry @ComponentV2 -struct Parent_300 { - - @Provider('data1') users1: User_300 = new User_300('XIAOL',18); - +struct Index_100 { build() { Column() { - Text(`name: ${this.users1.age}`).fontSize(30) - - Divider() - Child_300() - Button('add new user') - .onClick(() => { - this.users1= new User_300('Molly', 19);//Provider - }) - .id('btn1') - + ReusableV2Component_100() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_100() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_100() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId } } } - +@ReusableV2 @ComponentV2 -struct Child_300 { - @Consumer('data1') users1: User_300= new User_300('XIAOL',18); - +struct ReusableV2Component_100 { build() { - Column() { - Text(`name: ${this.users1.name}`).fontSize(30) - } + Text('HELLO').onClick(()=>{}).id('btn') } -} \ No newline at end of file +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse110.ets similarity index 50% rename from sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets rename to sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse110.ets index 8591cf6d..b5353d46 100644 --- a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize310.ets +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse110.ets @@ -12,46 +12,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -//使用以下ets -@ObservedV2 -class User_310 { - @Trace name: string; - age: number; - - constructor(name: string, age: number) { - this.name = name; - this.age = age; - } -} @Entry @ComponentV2 -struct Parent_310 { - - @Provider('data1') users1: User_310 = new User_310('XIAOL',18); - +struct Index_110 { build() { Column() { - Text(`name: ${this.users1.age}`).fontSize(30) - - Divider() - Child_310() - Button('add new user') - .onClick(() => { - this.users1= new User_310('Molly', 19);//Provider - }) - .id('btn1') - + ReusableV2Component_110() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_110() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_110() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId } } } - +@ReusableV2 @ComponentV2 -struct Child_310 { - @Consumer('data1') users1: User_310= new User_310('XIAOL',18); - +struct ReusableV2Component_110 { build() { - Column() { - Text(`name: ${this.users1.name}`).fontSize(30) - } + Button().onClick(()=>{}).id('btn') } -} \ No newline at end of file +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse120.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse120.ets new file mode 100644 index 00000000..fa3a9070 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse120.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_120 { + build() { + Column() { + ReusableV2Component_120() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_120() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_120() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_120 { + build() { + Button().onClick(()=>{}).id('btn') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse150.ets similarity index 53% rename from sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets rename to sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse150.ets index a1057e0a..21b8b37b 100644 --- a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize330.ets +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse150.ets @@ -12,46 +12,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -//使用以下ets -@ObservedV2 -class User { - @Trace name: string; - age: number; - - constructor(name: string, age: number) { - this.name = name; - this.age = age; - } -} @Entry @ComponentV2 -struct Parent { - - @Provider('data1') users1: User = new User('XIAOL',18); - +struct ReusableConditionalExample { + @Local condition: boolean = true; build() { Column() { - Text(`name: ${this.users1.age}`).fontSize(30) - - Divider() - Childop330() - + Button('回收/复用').onClick(()=>{this.condition=!this.condition;}).id('btn') // 点击切换回收/复用状态 + if (this.condition) { + ReusableV2Component_re150() + } } } } +// 可复用组件定义 +@ReusableV2 @ComponentV2 -struct Childop330 { - @Consumer('data1') users1: User= new User('XIAOL',18); +struct ReusableV2Component_re150 { + @Local message: string = 'Hello World'; + aboutToRecycle() { + console.log('ReusableV2Component aboutToRecycle'); // 回收时被调用 + } + aboutToReuse() { + console.log('ReusableV2Component aboutToReuse'); // 复用时被调用 + } build() { Column() { - Text(`name: ${this.users1.name}`).fontSize(30) - Button('add new user') - .onClick(() => { - this.users1= new User('Molly', 19);//Provider - }) - .id('btn1') + Text(this.message) } } -} \ No newline at end of file +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse20.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse20.ets new file mode 100644 index 00000000..60333c57 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse20.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_20 { + build() { + Column() { + ReusableV2Component_20() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_20() + .reuse({reuseId: () => '1233'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_20() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_20 { + build() { + Button().onClick(()=>{}).id('btn') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse30.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse30.ets new file mode 100644 index 00000000..c285c8b6 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse30.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_V2_30 { + build() { + Column() { + ReusableV2Component_V2_30() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_V2_30() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_V2_30() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_V2_30 { + build() { + Button().onClick(()=>{}).id('btn') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse40.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse40.ets new file mode 100644 index 00000000..3e96528a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse40.ets @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_re40 { + build() { + Column() { + ReusableV2Component_40() + ReusableV2Component_40() + ReusableV2Component_40() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_40 { + build() { + Button().onClick(()=>{}).id('btn') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse50.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse50.ets new file mode 100644 index 00000000..82c6a02c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse50.ets @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_50 { + build() { + Column() { + ReusableV2Component_50() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_50() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_50() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_50 { + duration: number = 3000 // 动画时长 + build() { + Text('HELLO').onClick(()=>{}).id('btn').transition(TransitionEffect.OPACITY.animation({ + duration: this.duration, + curve: Curve.EaseInOut // 缓入缓出曲线[8](@ref) + })) + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse60.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse60.ets new file mode 100644 index 00000000..87f139a3 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse60.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_re60 { + build() { + Column() { + ReusableV2Component_60() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_60() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_60() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_60 { + build() { + Button().onClick(()=>{}).id('btn') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse70.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse70.ets new file mode 100644 index 00000000..d848f80a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse70.ets @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_70 { + build() { + Column() { + ReusableV2Component_70() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_70() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_70() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_70 { + duration: number = 3000 // 动画时长 + build() { + Text('HELLO').onClick(()=>{}).id('btn').transition(TransitionEffect.OPACITY.animation({ + duration: this.duration, + curve: Curve.EaseInOut // 缓入缓出曲线[8](@ref) + })) + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse80.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse80.ets new file mode 100644 index 00000000..a5b3a6a2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse80.ets @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_80 { + build() { + Column() { + ReusableV2Component_80() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_80() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_80() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_80 { + duration: number = 3000 // 动画时长 + build() { + Text('HELLO').onClick(()=>{}).id('btn').transition(TransitionEffect.OPACITY.animation({ + duration: this.duration, + curve: Curve.EaseInOut // 缓入缓出曲线[8](@ref) + })) + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse90.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse90.ets new file mode 100644 index 00000000..b2bbc8d0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse90.ets @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2025 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. + */ +@Entry +@ComponentV2 +struct Index_90 { + build() { + Column() { + ReusableV2Component_90() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_90() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_90() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_90 { + duration: number = 3000 // 动画时长 + build() { + Button('HELLO').onClick(()=>{}).id('btn').transition(TransitionEffect.OPACITY.animation({ + duration: this.duration, + curve: Curve.EaseInOut // 缓入缓出曲线[8](@ref) + })) + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets deleted file mode 100644 index 6e3d2b4b..00000000 --- a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize240.ets +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2025 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. - */ - -//使用以下ets -@ObservedV2 -class User_240 { - @Trace name: string; - @Trace age: number; - - constructor(name: string, age: number) { - this.name = name; - this.age = age; - } -} -@Entry -@ComponentV2 -struct Parent_240 { - - @Provider('data1') users1: User_240 = new User_240('XIAOL',18); - - build() { - Column() { - Text(`name: ${this.users1.name}`).fontSize(30) - Child_240() - Button('add new user') - .onClick(() => { - this.users1= new User_240('Molly', 19);//Provider - }) - .id('btn1') - - Button('change name') - .onClick(() => { - this.users1.name = 'Shelly';//Trace - }) - .id('btn2') - } - } -} - -@ComponentV2 -struct Child_240 { - @Consumer('data1') users1: User_240= new User_240('XIAOL',18); - - build() { - Column() { - Text(`name: ${this.users1.age}`).fontSize(30) - Divider() - } - } -} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets deleted file mode 100644 index 8a1340fa..00000000 --- a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize250.ets +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2025 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. - */ -//使用以下ets -@ObservedV2 -class User_250 { - @Trace name: string; - @Trace age: number; - - constructor(name: string, age: number) { - this.name = name; - this.age = age; - } -} -@Entry -@ComponentV2 -struct Parent_250 { - - @Provider('data1') users1: User_250 = new User_250('XIAOL',18); - - build() { - Column() { - Text(`name: ${this.users1.age}`).fontSize(30) - - Divider() - Child_250() - - } - } -} - -@ComponentV2 -struct Child_250 { - @Consumer('data1') users1: User_250= new User_250('XIAOL',18); - - build() { - Column() { - Text(`name: ${this.users1.name}`).fontSize(30) - Button('add new user') - .onClick(() => { - this.users1= new User_250('Molly', 19);//Provider - }) - .id('btn1') - - Button('change name') - .onClick(() => { - this.users1.name = 'Shelly';//Trace - }) - .id('btn2') - } - } -} \ No newline at end of file -- Gitee From bc44fa7b64f1ab0b5f5a4a1ce6d4bcc84282bd0d Mon Sep 17 00:00:00 2001 From: zhoudede Date: Thu, 14 Aug 2025 10:41:45 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8B50?= =?UTF-8?q?=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoudede --- .../SnapshotAttribute.test.ets | 1658 +++++++++++++++++ 1 file changed, 1658 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/SnapshotAttributeTest/SnapshotAttribute.test.ets diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/SnapshotAttributeTest/SnapshotAttribute.test.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/SnapshotAttributeTest/SnapshotAttribute.test.ets new file mode 100644 index 00000000..8720a36f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/SnapshotAttributeTest/SnapshotAttribute.test.ets @@ -0,0 +1,1658 @@ +/** + * Copyright (c) 2025 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, Level } 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 I18n from '@ohos.i18n'; +import { BusinessError } from '@kit.BasicServicesKit'; + + +export default function SnapshotAttribute() { + + describe('SnapshotAttribute', () => { + 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_SNAPSHOT_ATTRIBUTE_0230 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0230 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0230', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0230 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel230") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('button'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_Routing_SUPPORTSTAGE_INTERFACE_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0690 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0690 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0690', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0690 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel690") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0690 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0290 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0290 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0290', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0290 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel290") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0790 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0790 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0790', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0790 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel790") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0790 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0200 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0200 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0200', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0200 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel200") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0200 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0720 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0720 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0720', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0720 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel720") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0720 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0260 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0260 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0260', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0260 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel260") + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0740 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0740 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0740', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0740 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel740") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0740 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0220 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0220 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0220', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0220 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel220") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('button'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0770 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0770 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0770', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0770 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel770") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0770 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0280 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0280 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0280', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0280 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel280") + windowSnap.snapShot(); + await Utils.sleep(10000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0280 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0270 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0270 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0270', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0270 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel270") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0270 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0780 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0780 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0780', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0780 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel780") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0780 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0760 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0760 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0760', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0760 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel760") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0760 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0330 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0330 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0330', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0330 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel330") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0830 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0830 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0830', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0830 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel830") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0830 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0350 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0350 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0350', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0350 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel350") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0350 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0840 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0840 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0840', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0840 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel840") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0840 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0300 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0300 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0300', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0300 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel300") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0300 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0250 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0250 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0250', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0250 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel250") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0250 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0810 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0810 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0810', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0810 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel810") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0810 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0750 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0750 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0750', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0750 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel750") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0750 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0320 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0320 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0320', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0320 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel320") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0800 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0800 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0800', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0800 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel800") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0800 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0340 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0340 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0340', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0340 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel340") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0340 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0850 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0850 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0850', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0850 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel850") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0850 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0310 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0310 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0310', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0310 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel310") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0310 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0820 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0820 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0820', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0820 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel820") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0820 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0360 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0360 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0360', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0360 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel360") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0860 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0860 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0860', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0860 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel860") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0860 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0240 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0240 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0240', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0240 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel240") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0730 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0730 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0730', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0730 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel730") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0730 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0400 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0400 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0400', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0400 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel400") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0400 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0880 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0880 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0880', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0880 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel880") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0880 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0370 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0370 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0370', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0370 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel370") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0370 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0890 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0890 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0890', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0890 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel890") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0890 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0390 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0390 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0390', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0390 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel390") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0390 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0870 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0870 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0870', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0870 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel870") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0870 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0380 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0380 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0380', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0380 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel380") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0380 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0900 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0900 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0900', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0900 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel900") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0900 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0430 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0430 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0430', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0430 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel430") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0430 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0910 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0910 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0910', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0910 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel910") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0910 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0460 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0460 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0460', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0460 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel460") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0460 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0450 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0450 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0450', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0450 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel450") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0450 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0410 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0410 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0410', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0410 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel410") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0410 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0440 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0440 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0440', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0440 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel440") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0440 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0920 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0920 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0920', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0920 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel920") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0920 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0470 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0470 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0470', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0470 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel470") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0470 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0560 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0560 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0560', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0560 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel560") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0560 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0480 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0480 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0480', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0480 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel480") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0480 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0010 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0010 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0010', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0010 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel10") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0010 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0530 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0530 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0530', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0530 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel530") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0530 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0490 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0490 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0490', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0490 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel490") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0490 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0040 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0040 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0040', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0040 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel40") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0040 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0520 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0520 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0520', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0520 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel520") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0520 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0030 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0030 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0030', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0030 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel30") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0030 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0570 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0570 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0570', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0570 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel570") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0570 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0150 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0150 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0150', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0150 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel150") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0150 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0620 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0620 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0620', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0620 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel620") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0620 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0020 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0020 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0020', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0020 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel20") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0020 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0500 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0500 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0500', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0500 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel500") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0500 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0100 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0100 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0100', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0100 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel100") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0100 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0580 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0580 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0580', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0580 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel580") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0580 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0140 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0140 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0140', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0140 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel140") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0140 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0590 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0590 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0590', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0590 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel590") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0590 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0110 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0110 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0110', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0110 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel110") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0110 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0540 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0540 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0540', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0540 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel540") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0540 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0120 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0120 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0120', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0120 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel120") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0120 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0600 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0600 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0600', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0600 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel600") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0600 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0050 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0050 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0050', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0050 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel50") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0050 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0550 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0550 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0550', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0550 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel550") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0550 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0060 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0060 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0060', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0060 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel60") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0060 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0610 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0610 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0610', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0610 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel610") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0610 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0090 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0090 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0090', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0090 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel90") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0090 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0510 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0510 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0510', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0510 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel510") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0510 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0130 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0130 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0130', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0130 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel130") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0130 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0630 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0630 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0630', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0630 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel630") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0630 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0160 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0160 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0160', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0160 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel160") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0160 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0670 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0670 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0670', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0670 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel670") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0670 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0070 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0070 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0070', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0070 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel70") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0070 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0640 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0640 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0640', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0640 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel640") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0640 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0080 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0080 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0080', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0080 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel80") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0080 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0680 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0680 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0680', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0680 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel680") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0680 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0180 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0180 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0180', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0180 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel180") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0180 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0700 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0700 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0700', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0700 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel700") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0700 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0170 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0170 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0170', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0700 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel170") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0170 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0660 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0660 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0660', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0660 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel660") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0660 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0190 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0190 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0190', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0190 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel190") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0190 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0650 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0650 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0650', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0650 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel650") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0650 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0210 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0210 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0210', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0210 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel210") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0210 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshotlevel710") + windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UNIQUEID_GET_SNAPSHOT_002', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UNIQUEID_GET_SNAPSHOT_002 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshot002") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('button'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000); + await component.click(); + await driver.waitForIdle(500,2000); + await component.click(); + await driver.waitForIdle(500,2000); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UNIQUEID_GET_SNAPSHOT_002 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 + * @tc.name SUB_ACE_UI_SNAPSHOT_ATTRIBUTE_0710 + * @tc.desc ProgressLinear sets the strokeRadius property + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UNIQUEID_GET_SNAPSHOT_001', Level.LEVEL3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UNIQUEID_GET_SNAPSHOT_001 start.`); + Settings.createWindow("testability/pages/SnapshotAttribute/Snapshot001") + let driver:Driver = Driver.create(); + // 通过ID定位(推荐) + let component = await driver.waitForComponent(ON.id('button'), 1000); // 显式等待组件出现[6](@ref) + await component.click(); + await driver.waitForIdle(500,2000); + await component.click(); + await driver.waitForIdle(500,2000); + await component.click(); + await driver.waitForIdle(500,2000); + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UNIQUEID_GET_SNAPSHOT_001 finish.`); + done(); + }) + }) +} -- Gitee From 037f0698d77c0ef420c39ffe10974598e3c791d3 Mon Sep 17 00:00:00 2001 From: zhoudede Date: Thu, 14 Aug 2025 10:57:34 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=89=80=E9=9C=80ets=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoudede --- .../pages/SnapshotAttribute/Snapshot001.ets | 75 +++++++++++++++++++ .../SnapshotAttribute/Snapshotlevel10.ets | 34 +++++++++ .../SnapshotAttribute/Snapshotlevel100.ets | 33 ++++++++ .../SnapshotAttribute/Snapshotlevel110.ets | 33 ++++++++ .../SnapshotAttribute/Snapshotlevel120.ets | 33 ++++++++ .../SnapshotAttribute/Snapshotlevel130.ets | 33 ++++++++ .../SnapshotAttribute/Snapshotlevel140.ets | 33 ++++++++ .../SnapshotAttribute/Snapshotlevel150.ets | 34 +++++++++ .../SnapshotAttribute/Snapshotlevel160.ets | 34 +++++++++ .../SnapshotAttribute/Snapshotlevel170.ets | 37 +++++++++ .../SnapshotAttribute/Snapshotlevel180.ets | 37 +++++++++ .../SnapshotAttribute/Snapshotlevel20.ets | 34 +++++++++ .../SnapshotAttribute/Snapshotlevel30.ets | 34 +++++++++ .../SnapshotAttribute/Snapshotlevel40.ets | 32 ++++++++ .../SnapshotAttribute/Snapshotlevel50.ets | 31 ++++++++ .../SnapshotAttribute/Snapshotlevel60.ets | 31 ++++++++ .../SnapshotAttribute/Snapshotlevel70.ets | 31 ++++++++ .../SnapshotAttribute/Snapshotlevel80.ets | 41 ++++++++++ .../SnapshotAttribute/Snapshotlevel90.ets | 31 ++++++++ 19 files changed, 681 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshot001.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel10.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel100.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel110.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel120.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel130.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel140.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel150.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel160.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel170.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel180.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel20.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel30.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel40.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel50.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel60.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel70.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel80.ets create mode 100644 sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel90.ets diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshot001.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshot001.ets new file mode 100644 index 00000000..e75c1bfa --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshot001.ets @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; +import { JSON } from '@kit.ArkTS'; + +@Entry +@Component +struct SnapshotExample001 { + @State pixmap: image.PixelMap | undefined = undefined + // 显式声明联合类型 + boolArray: (boolean | undefined)[] = [true, false, undefined]; + index:number = 0 + myScale:number = 1 + + build() { + Column() { + // 创建超出屏幕的List组件 + List() { + ListItem() { + Text('Hello world') + .width(80) + .height(80) + .margin({ left: -20 }) + .id("targetComponent") // 为需要截图的组件设置id + } + } + .height(300) + .width('100%') + + // 显示截图的Image组件 + Image(this.pixmap) + .width(200) + .height(200) + .border({ color: Color.Black, width: 2 }) + .margin(5) + + // 截图按钮 + Button("点击截图") + .onClick(() => { + // 获取UIContext并调用组件截图方法 + const uiContext = this.getUIContext() + uiContext.getComponentSnapshot().get("targetComponent", + (error: Error, pixmap: image.PixelMap) => { + if (error) { + console.log("截图错误: " + JSON.stringify(error)) + return + } + console.log("截图成功") + this.pixmap = pixmap + }, + { scale: this.myScale, waitUntilRenderFinished: this.boolArray[this.index] } + ) + this.myScale +=1 + this.index+=1 + }) + .id('button') + .margin(10) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel10.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel10.ets new file mode 100644 index 00000000..62eb0451 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel10.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute10 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .foregroundColor(Color.Brown) + .position({ x: 30, y: 10 }) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel100.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel100.ets new file mode 100644 index 00000000..dd103853 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel100.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute100 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .width(50) + .height(50) + .backgroundBrightness({rate:0.5,lightUpDegree:0.5}) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel110.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel110.ets new file mode 100644 index 00000000..47e071ea --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel110.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute110 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .width(50) + .height(50) + .opacity(0.9) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel120.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel120.ets new file mode 100644 index 00000000..78b521ae --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel120.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute120 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .visibility(Visibility.Hidden) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel130.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel130.ets new file mode 100644 index 00000000..e0dd5ac4 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel130.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute130 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .visibility(Visibility.None) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel140.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel140.ets new file mode 100644 index 00000000..769814fc --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel140.ets @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute140 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .visibility(Visibility.Visible) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel150.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel150.ets new file mode 100644 index 00000000..c64f7edc --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel150.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute150 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .foregroundColor(Color.Brown) + .enabled(false) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel160.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel160.ets new file mode 100644 index 00000000..d5ed9851 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel160.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute160 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .foregroundColor(Color.Brown) + .enabled(true) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel170.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel170.ets new file mode 100644 index 00000000..c5801584 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel170.ets @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute170 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .foregroundColor(Color.Brown) + .overlay("Winter is a beautiful season, especially when it snows.", { + align: Alignment.Bottom, + offset: { x: 0, y: -15 } + }) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel180.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel180.ets new file mode 100644 index 00000000..a34328f1 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel180.ets @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute180 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .foregroundColor(Color.Brown) + .overlay("Winter is a beautiful season, especially when it snows.", { + align: Alignment.Bottom, + offset: { x: 0, y: -15 } + }) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel20.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel20.ets new file mode 100644 index 00000000..bd4f27dc --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel20.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute20 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .foregroundColor(Color.Brown) + .grayscale(20) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel30.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel30.ets new file mode 100644 index 00000000..0f36c336 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel30.ets @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute30 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .padding({left:5,right:5,top:5,bottom:5}) + .margin({left:5,right:5,top:5,bottom:5}) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel40.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel40.ets new file mode 100644 index 00000000..685dd780 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel40.ets @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute40 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .width(50) + .height(50) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel50.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel50.ets new file mode 100644 index 00000000..50af65de --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel50.ets @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute50 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .size({width:200,height:300}) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel60.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel60.ets new file mode 100644 index 00000000..d758fee6 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel60.ets @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute60 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .offset({left:50,right:100}) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel70.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel70.ets new file mode 100644 index 00000000..2b8e9d5c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel70.ets @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute70 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .border({ width: 5, color: 0x317AF7, radius: 10, style: BorderStyle.Dotted }) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel80.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel80.ets new file mode 100644 index 00000000..a49fe3ee --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel80.ets @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute80 { + col:Color = Color.Brown; + + build() { + Column() { + Text('This is gradient color.').textAlign(TextAlign.Center).height(50).width(200) + .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 + }) + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel90.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel90.ets new file mode 100644 index 00000000..cf8aa484 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshotlevel90.ets @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2025 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 { image } from '@kit.ImageKit'; + +@Entry +@Component +struct SnapshotAttribute90 { + col:Color = Color.Brown; + + build() { + Column() { + Text('Hello World') + .backgroundBrightness({rate:0.5,lightUpDegree:0.5}) // 背景提亮效果 + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Center) + } +} \ No newline at end of file -- Gitee