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 0000000000000000000000000000000000000000..8720a36f89cf69378b37c3e7a6b3993fe2a3fe71 --- /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(); + }) + }) +} 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 0000000000000000000000000000000000000000..c1273d286fc86e1e552072ac6fac307fe3a04ab4 --- /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 new file mode 100644 index 0000000000000000000000000000000000000000..2d348c55fb878b5ab7c67f45a420c7a3282f2f20 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/test/Statusmanagerv2OptimizeTest/Statusmanagerv2Optimize.test.ets @@ -0,0 +1,549 @@ +/** + * 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_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_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_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/SnapshotAttribute/Snapshot001.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/SnapshotAttribute/Snapshot001.ets new file mode 100644 index 0000000000000000000000000000000000000000..e75c1bfac9bbc49dcc540a0450ef6db39815688f --- /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 0000000000000000000000000000000000000000..62eb0451cbe13cf42e8ae85f63bbe7750cde5ead --- /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 0000000000000000000000000000000000000000..dd10385396883ef57de630920dc8cc63e91f4013 --- /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 0000000000000000000000000000000000000000..47e071eaccc67f253b289b5a4b56d47efa76537e --- /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 0000000000000000000000000000000000000000..78b521ae098ed6d49cdd50b7d4b2b2baacfb45e1 --- /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 0000000000000000000000000000000000000000..e0dd5ac4501d594e88685970fb6829b081f839ed --- /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 0000000000000000000000000000000000000000..769814fcff1795c6cf1d9136fde52fc95e5407a5 --- /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 0000000000000000000000000000000000000000..c64f7edc161675aeb010de05c23511362bb5c558 --- /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 0000000000000000000000000000000000000000..d5ed98519ca395a44a0242c91dd0c7461d613d7e --- /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 0000000000000000000000000000000000000000..c58015848e41f86271469587d021aba05a2d6c89 --- /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 0000000000000000000000000000000000000000..a34328f129e9274cd665670653bb62ce114a048a --- /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 0000000000000000000000000000000000000000..bd4f27dc7485a18d8542a7889b266b22ca19b68e --- /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 0000000000000000000000000000000000000000..0f36c336bb47d8b726942cc46bb2f2c7cd5f0082 --- /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 0000000000000000000000000000000000000000..685dd780335861dda0da704557b6b479cd90e867 --- /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 0000000000000000000000000000000000000000..50af65de80d2c748999127628a2da7715c949957 --- /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 0000000000000000000000000000000000000000..d758fee6cb0f5e1eb75d1f44d2b439030f1c366f --- /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 0000000000000000000000000000000000000000..2b8e9d5c16ea1343b3297469c0ff3f63e649cf28 --- /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 0000000000000000000000000000000000000000..a49fe3eefd1eb4f30ceb9120e24910a177be9639 --- /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 0000000000000000000000000000000000000000..cf8aa4844bccda0c4b92d5fc054e2accd05bd9a2 --- /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 diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse10.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse10.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ed08c1a7c45debbb0ca7191691e4e901461b07e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse10.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_10 { + build() { + Column() { + ReusableV2Component_10() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_10() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_10() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_10 { + build() { + Text('HELLO').onClick(()=>{}).id('btn') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse100.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse100.ets new file mode 100644 index 0000000000000000000000000000000000000000..01c4c53fedde22b8da76ca7f19645cce3d2e286f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse100.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_100 { + build() { + Column() { + ReusableV2Component_100() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_100() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_100() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_100 { + build() { + Text('HELLO').onClick(()=>{}).id('btn') + } +} diff --git a/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse110.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse110.ets new file mode 100644 index 0000000000000000000000000000000000000000..b5353d46ed6392ed27c0b35f7ab9a5021333e21b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse110.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_110 { + build() { + Column() { + ReusableV2Component_110() + .reuse({reuseId: () => 'reuseComponent'}) // 使用'reuseComponent'作为reuseId + ReusableV2Component_110() + .reuse({reuseId: () => 'reuseComponent'}) // 使用空字符串将默认使用组件名'ReusableV2Component'作为reuseId + ReusableV2Component_110() // 未指定reuseId将默认使用组件名'ReusableV2Component'作为reuseId + } + } +} +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_110 { + build() { + Button().onClick(()=>{}).id('btn') + } +} 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 0000000000000000000000000000000000000000..fa3a90700da82749fb7a7031b659fe0cd2412a0c --- /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/StatusmanagerComponentreuse/StatusmanagerComponentreuse150.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse150.ets new file mode 100644 index 0000000000000000000000000000000000000000..21b8b37b6ba1725d22013766ab837497eb753e3f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/StatusmanagerComponentreuse/StatusmanagerComponentreuse150.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. + */ +@Entry +@ComponentV2 +struct ReusableConditionalExample { + @Local condition: boolean = true; + build() { + Column() { + Button('回收/复用').onClick(()=>{this.condition=!this.condition;}).id('btn') // 点击切换回收/复用状态 + if (this.condition) { + ReusableV2Component_re150() + } + } + } +} + +// 可复用组件定义 +@ReusableV2 +@ComponentV2 +struct ReusableV2Component_re150 { + + @Local message: string = 'Hello World'; + aboutToRecycle() { + console.log('ReusableV2Component aboutToRecycle'); // 回收时被调用 + } + aboutToReuse() { + console.log('ReusableV2Component aboutToReuse'); // 复用时被调用 + } + build() { + Column() { + Text(this.message) + } + } +} 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 0000000000000000000000000000000000000000..60333c57e6d91a854c0300ee061f24e1db128cf6 --- /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 0000000000000000000000000000000000000000..c285c8b65813e86e278a317f3e94c27132b33887 --- /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 0000000000000000000000000000000000000000..3e96528ac7b0348ae12718803305e5d19f0cf62a --- /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 0000000000000000000000000000000000000000..82c6a02c14ecb226ac20ea110a4ab7e449694832 --- /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 0000000000000000000000000000000000000000..87f139a378566d0f59fd1f5ca55956e85f4baf83 --- /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 0000000000000000000000000000000000000000..d848f80a7e544ff0e6b60f628901d314027da895 --- /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 0000000000000000000000000000000000000000..a5b3a6a25cb888580e31790d4bd874c4d1ce724d --- /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 0000000000000000000000000000000000000000..b2bbc8d0d9cf9d2c8d1c3b7e35fb2f91397eafea --- /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/Statusmanagerv2Optimize100.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize100.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac993714776328d4963781c181488d6df38e6706 --- /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 0000000000000000000000000000000000000000..2d7cef0be3aa2dffc428a979c2653fe230d710af --- /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 0000000000000000000000000000000000000000..532b30a6c4edfb78b12160cc054bab18db886582 --- /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 0000000000000000000000000000000000000000..4a71020f2f228c52b7784d875c016606ad5bd5f7 --- /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 0000000000000000000000000000000000000000..21a8c798f9b7d13fa31a00318a6fc95b070abc59 --- /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 0000000000000000000000000000000000000000..e29c4654020101395625407ef829ec38c1bcde01 --- /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 0000000000000000000000000000000000000000..9248dbae3727dff43f76e497440d1fa0164a70b0 --- /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 0000000000000000000000000000000000000000..404f5928bd4a595102bc5554526a5225ab1d1c81 --- /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 0000000000000000000000000000000000000000..ff445edff708a6c4c5e2eaf71ef46b6844d292e3 --- /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 0000000000000000000000000000000000000000..b84ab0b9e209ad16d94f0f37a9f2d37965c2f875 --- /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 0000000000000000000000000000000000000000..208601d2ba9fc8ea70543d401c6bb388cc6d3e07 --- /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 0000000000000000000000000000000000000000..504ef23778ce7c14d56ed76e4d93f8ec9e467d4e --- /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 0000000000000000000000000000000000000000..1678481606884eec63d7345148d5b1630db8f5a1 --- /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/Statusmanagerv2Optimize260.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize260.ets new file mode 100644 index 0000000000000000000000000000000000000000..abcf3a897d04928bcbd21f29b37b3961915896e0 --- /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 0000000000000000000000000000000000000000..0be53343ca17dbbd76b7cb2c33f121cc869c2c20 --- /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 0000000000000000000000000000000000000000..9a7a9f3135be45bd3e432a236197edb8b0c82756 --- /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 0000000000000000000000000000000000000000..714d85319f36329bf35bac34767806bdda5ffadd --- /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/Statusmanagerv2Optimize30.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize30.ets new file mode 100644 index 0000000000000000000000000000000000000000..c6d27bd023cea4f4ba5eca6e2972529adf616996 --- /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/Statusmanagerv2Optimize340.ets b/sample/ui_compare/uiCompareTest_09/entry/src/ohosTest/ets/testability/pages/Statusmanagerv2Optimize/Statusmanagerv2Optimize340.ets new file mode 100644 index 0000000000000000000000000000000000000000..19f5e184939dfe21f49453fc1636eca11dc35b1d --- /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 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 0000000000000000000000000000000000000000..21401ae89b7511325751bff427ff8eabc82a6346 --- /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 0000000000000000000000000000000000000000..9f27b0e6528a83da515ad548b40acb6c9ce5bd1e --- /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 0000000000000000000000000000000000000000..3a43fb1f4f5c03b2c9c985056492bf03767c061a --- /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 0000000000000000000000000000000000000000..954a6d6db58d959d9a13aa9ead69842c668ab657 --- /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