diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/test/ProgressBuilderTest/ProgressBuilder.test.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/test/ProgressBuilderTest/ProgressBuilder.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..765d3b3f1d02ce35c6c155120e6bc832b3c360df --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/test/ProgressBuilderTest/ProgressBuilder.test.ets @@ -0,0 +1,1280 @@ +/** + * 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'; + +export default function ProgressBuilder() { + + describe('ProgressBuilder', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0110 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0110 + * @tc.type : Dynamically toggle the values of color, backgroundColor, and style + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0110', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0110 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0110") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0110_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0110_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + let Button3: Component = await driver.waitForComponent(ON.id('ProgressBuilder0110_003'),1000); + await Button3.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0110 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0620 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0620 + * @tc.type : Dynamically toggle the values of color, backgroundColor, and style + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0620', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0620 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0620") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0620 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0370 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0370 + * @tc.type : Set the value parameter of the Progress component interface Progress(options: ProgressOptions) to an abnormal value { value: null }, and pass value: 30 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0370', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0370 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0370") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0370 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0580 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0580 + * @tc.type : Set a developer-defined parameter {boolean} for the Progress component. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0580', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0580 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0580") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0580_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0580_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0580 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0520 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0520 + * @tc.type : Set the enable parameter of the Progress component to an exceptional value {null}. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0520', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0520 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0520") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0520_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0520_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0520 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0060 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0060 + * @tc.type : The enable parameter of the Progress component is not set. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0060', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0060 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0060") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0060_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0060_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0060 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0450 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0450 + * @tc.type : Set the parameters of the Progress component interface Progress(options: ProgressOptions) to normal values {value: 80, total: 50.3}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0450', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0450 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0450") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0450 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0290 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0290 + * @tc.type : Set the value property of the Progress component to a normal value {value: 100}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0290', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0290 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0290") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0290 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0500 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0500 + * @tc.type : Set the value property of the Progress component to a normal value {value:10, total:0}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0500', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0500 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0500") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0500 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0240 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0240 + * @tc.type : Set the value property of the Progress component to a normal value {value:null}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0240', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0240 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0240") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0240 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0570 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0570 + * @tc.type : Set the total parameter of the Progress component to a normal value {value: 80, total: 50}, pass value and total through the builder, and set the component's own specific properties (such as color, backgroundColor, and style) on the Progress component itself. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0570', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0570 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0570") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0570 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0260 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0260 + * @tc.type : Set the value property of the Progress component to a normal value {value: -10}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0260', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0260 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0260") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0260 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0130 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0130 + * @tc.type : Dynamically switch the value of total. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0130', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0130 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0130") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0130_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0130_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0130 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0230 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0230 + * @tc.type : Set the value property of the Progress component to an exceptional value {value: 150}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0230', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0230 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0230") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0230 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0380 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0380 + * @tc.type : In the Progress component interface Progress(options: ProgressOptions), set the value parameter to an abnormal value {value: undefined}, and pass value: 30 to contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0380', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0380 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0380") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0380 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0480 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0480 + * @tc.type : Set the value property of the Progress component to an exceptional value {value:80, total:50.3}, and pass value: 80 and total: 30 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0480', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0480 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0480") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0480 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0070 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0070 + * @tc.type : Set the width and height of the Progress component to be larger than the builder area. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0070', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0070 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0070") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0070 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0190 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0190 + * @tc.type : Support common events. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0190', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0190 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0190") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0190_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0190 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0460 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0460 + * @tc.type : Set the parameters of the Progress component interface Progress(options: ProgressOptions) to normal values {value: 80, total: 50.3}, and pass value: 30 and total: 80.5 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0460', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0460 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0460") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0460 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0080 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0080 + * @tc.type : Set the width and height of the Progress component to be smaller than the builder area. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0080', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0080 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0080") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0080_001'),1000); + await Button1.click(); + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0080 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0040 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0040 + * @tc.type : Place an empty builder inside contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0040', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0040 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0040") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0040 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0310 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0310 + * @tc.type : Set the type parameter of the Progress component interface Progress(options: ProgressOptions) to a normal value Capsule, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0310', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0310 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0310") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0310 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0600 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0600 + * @tc.type : Set a developer-defined parameter {string} for the Progress component. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0600', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0600 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0600") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0600_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0600_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0600 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0030 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0030 + * @tc.type : Set contentModifier to undefined/null/not set. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0030', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0030 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0030") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0030 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0440 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0440 + * @tc.type : When setting the Progress component interface Progress(options: ProgressOptions), the parameters are set to normal values {value: 10, total: 150}, and the contentModifier is passed with value: 30 and total: 80. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0440', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0440 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0440") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0440 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0250 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0250 + * @tc.type : When setting the Progress component interface Progress(options: ProgressOptions), the parameters are set to undefined, and the contentModifier is passed with value: 30 and total: 80. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0250', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0250 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0250") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0250 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0530 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0530 + * @tc.type : Set the enable parameter of the Progress component to an abnormal value {undefined}. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0530', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0530 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0530") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0530_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0530_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0530 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0160 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0160 + * @tc.type : Dynamically switch the value of value. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0160', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0160 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0160") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0160_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0160_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0160 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0330 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0330 + * @tc.type : Set the type parameter of the Progress component interface Progress(options: ProgressOptions) to the normal value Linear, and pass value: 30 and total: 80 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0330', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0330 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0330") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0330 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0550 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0550 + * @tc.type : Set the enable parameter of the Progress component to the normal value {true}. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0550', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0550 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0550") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0550_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0550_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0550 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0020 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0020 + * @tc.type : The contentModifier dynamically switches between normal values and undefined or null. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0020', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0020 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0020") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0020_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0020_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0020 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0410 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0410 + * @tc.type : Set the value parameter in the Progress component interface Progress(options: ProgressOptions) to the normal value {value: 1.5}, and pass value: 30 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0410', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0410 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0410") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0410 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0590 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0590 + * @tc.type : Set the developer-defined parameter {number()[]} for the Progress component. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0590', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0590 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0590") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0590_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0590_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0590 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0150 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0150 + * @tc.type : Dynamically switch the value property. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0150', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0150 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0150") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0150_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0150_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0150 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0470 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0470 + * @tc.type : Set the parameters in the Progress component interface Progress(options: ProgressOptions) to the normal values {value: 80, total: 50.3}, and pass value: 80 and total: -30 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0470', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0470 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0470") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0470 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0090 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0090 + * @tc.type : Combine with the Radio component. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0090', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0090 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0090") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0090_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0090_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0090 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0350 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0350 + * @tc.type : Set the type parameter in the Progress component interface Progress(options: ProgressOptions) to the normal value ScaleRing, and pass value: 30 and total: 80 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0350', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0350 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0350") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0350 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0430 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0430 + * @tc.type : Set the value parameter in the Progress component interface Progress(options: ProgressOptions) to the normal value {value: 50}, and pass value: 30 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0430', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0430 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0430") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0430 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0220 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0220 + * @tc.type : Is animation supported? + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0220', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0220 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0220") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0220 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0340 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0340 + * @tc.type : Set the type parameter in the Progress component interface Progress(options: ProgressOptions) to the normal value Ring, and pass value: 30 and total: 80 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0340', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0340 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0340") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0340 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0490 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0490 + * @tc.type : Set the parameters in the Progress component interface Progress(options: ProgressOptions) to the normal values {value: 80, total: 50}, and pass value: 30 and total: 80 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0490', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0490 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0490") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0490 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0510 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0510 + * @tc.type : Set the parameters in the Progress component interface Progress(options: ProgressOptions) to the normal values {value: 80, total: -50}, and pass value: 30 and total: 80 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0510', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0510 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0510") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0510 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0420 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0420 + * @tc.type : Set the value parameter in the Progress component interface Progress(options: ProgressOptions) to the normal value {value: 100}, and pass value: 30 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0420', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0420 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0420") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0420 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0610 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0610 + * @tc.type : Set multiple contentModifiers. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0610', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0610 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0610") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0610 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0360 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0360 + * @tc.type : Set the value parameter in the Progress component interface Progress(options: ProgressOptions) to the abnormal value {value: 150}, and pass value: 30 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0360', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0360 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0360") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0360 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0170 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0170 + * @tc.type : Dynamically switch animations. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0170', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0170 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0170") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0170_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0170_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0170 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0540 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0540 + * @tc.type : Set the enable parameter of the Progress component to the normal value {false}. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0540', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0540 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0540") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0540_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0540_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0540 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0120 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0120 + * @tc.type : Dynamically switch the value of contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0120', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0120 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0120") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0120_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0120_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0120 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0270 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0270 + * @tc.type : Set the value property of the Progress component to the normal value {value: 0}, and pass value: 30 and total: 80 to the contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0270', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0270 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0270") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0270 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0050 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0050 + * @tc.type : The effect order of setting both the parameter “value” and the attribute “value” for the “Progress” element is being tested. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0050', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0050 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0050") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0050 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0390 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0390 + * @tc.type : Set the value parameter in the Progress component interface Progress(options: ProgressOptions) to a normal value {value: -10}, and pass value: 30 to contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0390', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0390 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0390") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0390 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0320 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0320 + * @tc.type : Set the type parameter in the Progress component interface Progress(options: ProgressOptions) to the normal value Eclipse, and pass value: 30 and total: 80 to contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0320', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0320 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0320") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0320 finish.`); + done() + }) + + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0140 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0140 + * @tc.type : Dynamically switch the type parameter. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0140', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0140 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0140") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + let Button1: Component = await driver.waitForComponent(ON.id('ProgressBuilder0140_001'),1000); + await Button1.click(); + await driver.waitForIdle(500,2000) + let Button2: Component = await driver.waitForComponent(ON.id('ProgressBuilder0140_002'),1000); + await Button2.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0140 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0560 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0560 + * @tc.type : Set the Progress component's total parameter to a normal value {value: 80, total: 50}, and pass color through builder without passing value or total. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0560', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0560 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0560") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0560 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0280 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0280 + * @tc.type : Set the value property of the Progress component to a normal value {value: 1.5}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0280', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0280 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0280") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0280 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0400 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0400 + * @tc.type : Set the value parameter in the Progress component interface Progress(options: ProgressOptions) to a normal value {value: 0}, and pass value: 30 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0400', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0400 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0400") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0400 finish.`); + done() + }) + + + /* + * @tc.number : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0300 + * @tc.name : SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0300 + * @tc.type : Set the value property of the Progress component to a normal value {value: 50}, and pass value: 30 and total: 80 through contentModifier. + * @tc.size : MediumTest + * @tc.level : 2 + */ + it('SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0300', Level.LEVEL2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0300 start.`); + Settings.createWindow("testability/pages/ProgressBuilder/ProgressBuilder0300") + let driver: Driver = Driver.create(); + await driver.waitForIdle(500,2000) + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_INFOMATION_PROGRESS_BUILDER_0300 finish.`); + done() + }) + + + + + + + }) +} diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0020.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..e97b23f0a0cbec9ed28afc44127213adf184fe12 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0020.ets @@ -0,0 +1,100 @@ +/** + * 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 MyProgressModifier23 implements ContentModifier { + value: number|null|undefined = 30; + tot: number|null|undefined = 80 + + constructor(value: number|null|undefined,tot:number|null|undefined) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg23); + } +} + +@Builder +function myProg23(config: ProgressConfiguration) { + Image($r('app.media.icon')) + .width(200) + .height(200) + .border({width:2,color:Color.Pink}) +} + +@Entry +@Component +struct ProgressBuilder0020 { + @State condition1 : undefined|null|number = 30 + @State condition2 : undefined|null|number = 80 + modifier = new MyProgressModifier23(this.condition1,this.condition2); + @State myModifier: (MyProgressModifier23 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 2, + total: 80, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .width(500) + .height(50) + Button('change1') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin({ + top:200, + left:0, + right:0, + bottom:10 + }) + .id('ProgressBuilder0020_001') + .onClick(() => { + this.condition1 = undefined + this.condition2 = undefined + }) + Button('chang2') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin({ + top:10, + left:0, + right:0, + bottom:0 + }) + .id('ProgressBuilder0020_002') + .onClick(() => { + this.condition1 = null + this.condition2 = null + }) + } + .width('100%') + .height('100%') + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0030.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..37e2c3c602ccbf8b6c867a95e832afecbca69568 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0030.ets @@ -0,0 +1,65 @@ +/** + * 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 MyProgressModifier18 implements ContentModifier { + value: number|null|undefined = 80; + tot: number|null|undefined = 30 + + constructor(value: number|null|undefined,tot:number|null|undefined) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg18); + } +} + +@Builder +function myProg18(config: ProgressConfiguration) { +} + +@Entry +@Component +struct ProgressBuilder0030 { + modifier = new MyProgressModifier18(null,null); + @State myModifier: (MyProgressModifier18 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 2, + total: 80, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .width(500) + .height(50) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0040.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..75c917c8250877395c6b6cef8ad2715e9403ecda --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0040.ets @@ -0,0 +1,65 @@ +/** + * 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 MyProgressModifier16 implements ContentModifier { + value: number = 80; + tot: number = 30 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg16); + } +} + +@Builder +function myProg16(config: ProgressConfiguration) { +} + +@Entry +@Component +struct ProgressBuilder0040 { + modifier = new MyProgressModifier16(80,30); + @State myModifier: (MyProgressModifier16 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 2, + total: 80, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .width(500) + .height(50) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0050.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..2502f5ee49b7cda8b91cb7164323610c569e536e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0050.ets @@ -0,0 +1,78 @@ +/** + * 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 MyProgressModifier41 implements ContentModifier { + value: number = 30; + + constructor(value: number) { + this.value = value; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg41); + } +} + +@Builder +function myProg41(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier41).value, // 30 + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height('100%') +} + +@Entry +@Component +struct ProgressBuilder0050 { + modifier = new MyProgressModifier41(30); + @State myModifier: (MyProgressModifier41 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 0, + total: 50.3, + type: ProgressType.Linear }) + .value(50) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .width(500) + .height(50) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0060.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..248beb8c0ecdb278df2834d26f810e9125c2e399 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0060.ets @@ -0,0 +1,74 @@ +/** + * 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 +@Component +struct ProgressBuilder0060 { + @State color: ResourceColor | LinearGradient = Color.Pink; + @State backcolor: ResourceColor = Color.Blue; + @State scanEffects: boolean[] = [false, true]; // 自定义布尔数组参数 + @State wid:Length = 20 + @State rad:PX | VP | LPX | Resource = 5 + @State style: ProgressStyleOptions | CapsuleStyleOptions | RingStyleOptions | LinearStyleOptions | ScaleRingStyleOptions | EclipseStyleOptions = { strokeWidth: this.wid, strokeRadius:this.rad }; + + + + build() { + Column({ space: 15 }) { + Text('Loading Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 50, total: 50, type: ProgressType.Linear }) + .width(100) + .color(this.color) + .style(this.style) + .backgroundColor(this.backcolor) + Text('Scan Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 50, total: 50, type: ProgressType.Linear }) + .width(100) + .color(this.color) + .style(this.style) + .backgroundColor(this.backcolor) + Button('Toggle Scan Effect 1') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0060_001') + .onClick(() => { + this.wid = 30 + this.rad = 10 + this.style = { strokeWidth: this.wid, strokeRadius:this.rad }; + }) + Button('Toggle Scan Effect 2') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0060_002') + .onClick(() => { + this.wid = 10 + this.rad = 2 + this.style = { strokeWidth: this.wid, strokeRadius:this.rad }; + }) + }.width('100%').padding({ top: 5 }) + } +} + + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0070.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c5a8699bdaf8bf309f5ee72246f096d219a0ce0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0070.ets @@ -0,0 +1,80 @@ +/** + * 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 MyProgressModifier12 implements ContentModifier { + value: number = 80; + tot: number = 30 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg12); + } +} + +@Builder +function myProg12(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier12).value, // 30 + total: (config.contentModifier as MyProgressModifier12).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width(300) + .height(20) +} + +@Entry +@Component +struct ProgressBuilder0070 { + modifier = new MyProgressModifier12(80,30); + @State myModifier: (MyProgressModifier12 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .width(500) + .height(50) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0080.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1b7abe936b7da8a19c74fc5db0d7e99fc9ad010 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0080.ets @@ -0,0 +1,84 @@ +/** + * 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 MyProgressModifier15 implements ContentModifier { + value: number = 80; + tot: number = 30 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg15); + } +} + +@Builder +function myProg15(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier15).value, // 30 + total: (config.contentModifier as MyProgressModifier15).tot, + type: ProgressType.Linear + }) + .width(500) + .height(30) +} + +@Entry +@Component +struct ProgressBuilder0080 { + modifier = new MyProgressModifier15(80,30); + @State myModifier: (MyProgressModifier15 | undefined) = this.modifier; + @State col:ResourceColor = Color.White + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(this.col) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .width(300) + .height(20) + .margin(50) + Button('other') + .id('ProgressBuilder0080_001') + .fontSize(20) + .backgroundColor(Color.Pink) + .fontColor(Color.Red) + .padding(5) + .borderRadius(8) + .onClick(()=>{ + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0090.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d029a005645b8495c9e3899f7298e1a07df997a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0090.ets @@ -0,0 +1,141 @@ +/** + * 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 MyProgressModifier27 implements ContentModifier { + color: Color = Color.White; + + constructor(color: Color) { + this.color = color; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg27); + } +} + +@Builder +function myProg27(config: ProgressConfiguration) { + Column({ space: 30 }) { + Text("当前进度:" + config.value + "/" + config.total).fontSize(20) + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 1 ? (config.contentModifier as MyProgressModifier27).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 2 ? (config.contentModifier as MyProgressModifier27).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 3 ? (config.contentModifier as MyProgressModifier27).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + }.width('100%') + } + }.margin({ bottom: 100 }) + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Column() { + Text('Radio1') + Radio({ value: 'Radio1', group: 'radioGroup' }).checked(true) + .radioStyle({ + checkedBackgroundColor: Color.Pink + }) + .height(50) + .width(50) + .onChange((isChecked: boolean) => { + console.info('Radio1 status is ' + isChecked); + }) + } + Column() { + Text('Radio2') + Radio({ value: 'Radio2', group: 'radioGroup' }).checked(false) + .radioStyle({ + checkedBackgroundColor: Color.Pink + }) + .height(50) + .width(50) + .onChange((isChecked: boolean) => { + console.info('Radio2 status is ' + isChecked); + }) + } + Column() { + Text('Radio3') + Radio({ value: 'Radio3', group: 'radioGroup' }).checked(false) + .radioStyle({ + checkedBackgroundColor: Color.Pink + }) + .height(50) + .width(50) + .onChange((isChecked: boolean) => { + console.info('Radio3 status is ' + isChecked); + }) + } + }.padding({ top: 30 }) +} + +@Entry +@Component +struct ProgressBuilder0090 { + @State currentValue: number = 0; + modifier = new MyProgressModifier27(Color.Red); + @State myModifier: (MyProgressModifier27 | undefined) = this.modifier; + + build() { + Column() { + Progress({ value: this.currentValue, total: 3, type: ProgressType.Ring }).contentModifier(this.modifier) + Button('Progress++') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0090_001') + .onClick(() => { + if (this.currentValue < 3) { + this.currentValue += 1; + } + }) + Button('Progress--') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0090_002') + .onClick(() => { + if (this.currentValue > 0) { + this.currentValue -= 1; + } + }) + }.width('100%').height('100%') + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0110.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..401cfd0030c818c738caededabe8d97f3ed35db0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0110.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. + */ + + + + +@Entry +@Component +struct ProgressBuilder0110 { + @State color:ResourceColor | LinearGradient = Color.Pink + @State style:ProgressStyleOptions | CapsuleStyleOptions | + RingStyleOptions | LinearStyleOptions | + ScaleRingStyleOptions | EclipseStyleOptions = { strokeWidth: 20, status: ProgressStatus.LOADING } + @State backcolor:ResourceColor = Color.Blue + build() { + Column({ space: 15 }) { + Text('Loading Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 0, total: 100, type: ProgressType.Ring }) + .width(100) + .color(this.color) + .style(this.style) + .backgroundColor(this.backcolor) + Text('Scan Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 30, total: 100, type: ProgressType.Ring }) + .width(100) + .color(this.color) + .style(this.style) + .backgroundColor(this.backcolor) + Button('color') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0110_001') + .onClick(() => { + this.color = Color.Green + }) + Button('style') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0110_002') + .onClick(() => { + this.style = { strokeWidth: 20, enableScanEffect: true } + }) + Button('backcolor') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0110_003') + .onClick(() => { + this.backcolor = Color.Orange + }) + }.width('100%').padding({ top: 5 }) + } +} + + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0120.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..129f3ff41d36c8a6a87396dfa05b9c7608dca010 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0120.ets @@ -0,0 +1,98 @@ +/** + * 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 MyProgressModifier39 implements ContentModifier { + color: Color = Color.White; + + constructor(color: Color) { + this.color = color; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg39); + } +} + +@Builder +function myProg39(config: ProgressConfiguration) { + Column({ space: 30 }) { + Text("当前进度:" + config.value + "/" + config.total).fontSize(20) + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 1 ? (config.contentModifier as MyProgressModifier39).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 2 ? (config.contentModifier as MyProgressModifier39).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 3 ? (config.contentModifier as MyProgressModifier39).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + }.width('100%') + } + }.margin({ bottom: 100 }) +} + +@Entry +@Component +struct ProgressBuilder0120 { + @State currentValue: number = 0; + @State currentotal: number = 3; + modifier = new MyProgressModifier39(Color.Red); + @State myModifier: (MyProgressModifier39 | undefined) = this.modifier; + + build() { + Column() { + Progress({ value: this.currentValue, total: this.currentotal, type: ProgressType.Ring }).contentModifier(this.modifier) + Button('Progress++') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0120_001') + .onClick(() => { + this.currentValue += 3 + }) + Button('Progress--') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0120_002') + .onClick(() => { + this.currentValue -= 1 + }) + }.width('100%').height('100%') + } +} + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0130.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..475ef574af58b3553e4fa07b0d076b188733315e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0130.ets @@ -0,0 +1,98 @@ +/** + * 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 MyProgressModifier9 implements ContentModifier { + color: Color = Color.White; + + constructor(color: Color) { + this.color = color; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg9); + } +} + +@Builder +function myProg9(config: ProgressConfiguration) { + Column({ space: 30 }) { + Text("当前进度:" + config.value + "/" + config.total).fontSize(20) + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 1 ? (config.contentModifier as MyProgressModifier9).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 2 ? (config.contentModifier as MyProgressModifier9).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 3 ? (config.contentModifier as MyProgressModifier9).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + }.width('100%') + } + }.margin({ bottom: 100 }) +} + +@Entry +@Component +struct ProgressBuilder0130 { + @State currentValue: number = 0; + @State currentotal: number = 3; + modifier = new MyProgressModifier9(Color.Red); + @State myModifier: (MyProgressModifier9 | undefined) = this.modifier; + + build() { + Column() { + Progress({ value: this.currentValue, total: this.currentotal, type: ProgressType.Ring }).contentModifier(this.modifier) + Button('Progress++') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0130_001') + .onClick(() => { + this.currentotal += 1 + }) + Button('Progress--') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0130_002') + .onClick(() => { + this.currentotal -= 1 + }) + }.width('100%').height('100%') + } +} + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0140.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..28359857286a8fb3cc448bf90f65e4bb252ba982 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0140.ets @@ -0,0 +1,89 @@ +/** + * 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 +@Component +struct ProgressBuilder0140 { + @State color:ResourceColor | LinearGradient = Color.Pink + @State style:ProgressStyleOptions | CapsuleStyleOptions | + RingStyleOptions | LinearStyleOptions | + ScaleRingStyleOptions | EclipseStyleOptions = { strokeWidth: 20, status: ProgressStatus.LOADING } + @State backcolor:ResourceColor = Color.Blue + @State type1:ProgressType = ProgressType.Linear + @State type2:ProgressType = ProgressType.Ring + build() { + Column({ space: 15 }) { + Text('Loading Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 0, total: 100, type: this.type1 }) + .width(100) + .color(this.color) + .style(this.style) + .privacySensitive(true) + .style({ + showDefaultPercentage:true + }) + .backgroundColor(this.backcolor) + Text('Scan Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 30, total: 100, type: this.type2 }) + .width(100) + .color(this.color) + .style(this.style) + .backgroundColor(this.backcolor) + .privacySensitive(true) + .style({ + showDefaultPercentage:true + }) + Button('color') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0140_001') + .onClick(() => { + this.color = Color.Green + this.type1 = ProgressType.Ring + this.type2 = ProgressType.Eclipse + }) + Button('style') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0140_002') + .onClick(() => { + this.style = { strokeWidth: 20, enableScanEffect: true } + this.type1 = ProgressType.Eclipse + this.type2 = ProgressType.Capsule + }) + Button('backcolor') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0140_003') + .onClick(() => { + this.backcolor = Color.Orange + }) + }.width('100%').padding({ top: 5 }) + } +} + + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0150.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..44e80a2230341de3fcf9c5c6b2b7e0680559365c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0150.ets @@ -0,0 +1,105 @@ +/** + * 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 MyProgressModifier25 implements ContentModifier { + color: Color = Color.White; + + constructor(color: Color) { + this.color = color; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg25); + } +} + +@Builder +function myProg25(config: ProgressConfiguration) { + Column({ space: 30 }) { + Text("当前进度:" + config.value + "/" + config.total).fontSize(20) + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 1 ? (config.contentModifier as MyProgressModifier25).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 2 ? (config.contentModifier as MyProgressModifier25).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 3 ? (config.contentModifier as MyProgressModifier25).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + }.width('100%') + } + }.margin({ bottom: 100 }) +} + +@Entry +@Component +struct ProgressBuilder0150 { + @State currentValue: number = 0; + modifier = new MyProgressModifier25(Color.Red); + @State myModifier: (MyProgressModifier25 | undefined) = this.modifier; + + build() { + Column() { + Progress({ value: 2, total: 3, type: ProgressType.Ring }) + .contentModifier(this.modifier) + .value(this.currentValue) + Button('Progress++') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0150_001') + .onClick(() => { + if (this.currentValue < 3) { + this.currentValue += 3; + } + }) + Button('Progress--') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0150_002') + .onClick(() => { + if (this.currentValue > 0) { + this.currentValue -= 1; + } + }) + }.width('100%').height('100%') + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0160.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d9f05ac88a1263ba38cde80d7fcdef9623f03b3 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0160.ets @@ -0,0 +1,103 @@ +/** + * 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 MyProgressModifier21 implements ContentModifier { + color: Color = Color.White; + + constructor(color: Color) { + this.color = color; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg21); + } +} + +@Builder +function myProg21(config: ProgressConfiguration) { + Column({ space: 30 }) { + Text("当前进度:" + config.value + "/" + config.total).fontSize(20) + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 1 ? (config.contentModifier as MyProgressModifier21).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 2 ? (config.contentModifier as MyProgressModifier21).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + Path() + .width('30%') + .height('30%') + .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') + .fill(config.enabled && config.value >= 3 ? (config.contentModifier as MyProgressModifier21).color : + Color.White) + .stroke(Color.Black) + .strokeWidth(3) + }.width('100%') + } + }.margin({ bottom: 100 }) +} + +@Entry +@Component +struct ProgressBuilder0160 { + @State currentValue: number = 0; + modifier = new MyProgressModifier21(Color.Red); + @State myModifier: (MyProgressModifier21 | undefined) = this.modifier; + + build() { + Column() { + Progress({ value: this.currentValue, total: 3, type: ProgressType.Ring }).contentModifier(this.modifier) + Button('Progress++') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0160_001') + .onClick(() => { + if (this.currentValue < 3) { + this.currentValue += 1; + } + }) + Button('Progress--') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0160_002') + .onClick(() => { + if (this.currentValue > 0) { + this.currentValue -= 1; + } + }) + }.width('100%').height('100%') + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0170.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..52d546617a9714ddb8ba819b2696afc1031bb974 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0170.ets @@ -0,0 +1,73 @@ +/** + * 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 +@Component +struct ProgressBuilder0170 { + @State type1: ProgressType = ProgressType.Eclipse + @State type2: ProgressType = ProgressType.Capsule + @State status1: ProgressStatus = ProgressStatus.LOADING + @State status2: ProgressStatus = ProgressStatus.PROGRESSING + @State enable: boolean = true + + build() { + Column({ space: 15 }) { + Text('Loading Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 50, total: 100, type: this.type1 }) + .width(100).color(Color.Blue) + .style({ strokeWidth: 20, status: this.status1 }) + + Text('Scan Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') + Progress({ value: 90, total: 100, type: this.type2 }) + .width(100).color(Color.Orange) + .style({ strokeWidth: 20, enableScanEffect: this.enable, status: this.status2 }) + Button('Toggle Scan Effect 1') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0170_001') + .onClick(() => { + this.type1 = ProgressType.Ring + this.status1 = ProgressStatus.PROGRESSING + this.type2 = ProgressType.ScaleRing + this.status2 = ProgressStatus.LOADING + }) + Button('Toggle Scan Effect 2') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0170_002') + .onClick(() => { + this.type1 = ProgressType.Capsule + this.status1 = ProgressStatus.LOADING + this.type2 = ProgressType.Ring + this.status2 = ProgressStatus.PROGRESSING + this.enable = false + }) + }.width('100%').padding({ top: 5 }) + } +} + + + + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0190.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..b28454b8232fd89c7d404c9f3970e6383688f416 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0190.ets @@ -0,0 +1,83 @@ +/** + * 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 MyProgressModifier13 implements ContentModifier { + value: number = 80; + tot: number = 30 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg13); + } +} + +@Builder +function myProg13(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier13).value, // 30 + total: (config.contentModifier as MyProgressModifier13).tot, + type: ProgressType.Linear + }) + .width(300) + .height(20) +} + +@Entry +@Component +struct ProgressBuilder0190 { + modifier = new MyProgressModifier13(80,30); + @State myModifier: (MyProgressModifier13 | undefined) = this.modifier; + @State color:ResourceColor = Color.Gray + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(this.color) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .width(500) + .height(50) + Button('change') + .borderRadius(8) + .backgroundColor(0x317aff) + .width(100) + .margin(8) + .id('ProgressBuilder0190_001') + .onClick(() => { + this.color = Color.Red + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0220.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac376de6b1d32be895f93505a605c02cf032142e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0220.ets @@ -0,0 +1,98 @@ +/** + * 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 MyProgressModifier30 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg30); + } +} + +@Builder +function myProg30(config: ProgressConfiguration) { + Column(){ + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier30).value, // 30 + total: (config.contentModifier as MyProgressModifier30).tot, + type: ProgressType.Ring + }) + .style({strokeWidth:30,status: ProgressStatus.LOADING}) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .width('30%') + .height('30%') + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier30).value, // 30 + total: (config.contentModifier as MyProgressModifier30).tot, + type: ProgressType.Ring + }) + .style({strokeWidth:30,status: ProgressStatus.LOADING}) + .color(Color.Blue) + .backgroundColor(Color.Gray) + .width('30%') + .height('30%') + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier30).value, // 30 + total: (config.contentModifier as MyProgressModifier30).tot, + type: ProgressType.Ring + }) + .style({strokeWidth:30,status: ProgressStatus.LOADING}) + .color(Color.Yellow) + .backgroundColor(Color.Brown) + .width('30%') + .height('30%') + } +} + +@Entry +@Component +struct ProgressBuilder0220 { + modifier = new MyProgressModifier30(30,80); + @State myModifier: (MyProgressModifier30 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 150, + total: 50, + type: ProgressType.Ring }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,status: ProgressStatus.LOADING}) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0230.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..fef09a5f8538e1d1741abf9ed2982c2d44dd6b5c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0230.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. + */ + + + +class MyProgressModifier10 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg10); + } +} + +@Builder +function myProg10(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier10).value, // 30 + total: (config.contentModifier as MyProgressModifier10).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) +} + +@Entry +@Component +struct ProgressBuilder0230 { + modifier = new MyProgressModifier10(30,80); + @State myModifier: (MyProgressModifier10 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 150, + total: 50, + type: ProgressType.Linear }) + .value(150) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0240.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b5a8ac378f42e9a8e91973d878d2cec545b452b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0240.ets @@ -0,0 +1,77 @@ +/** + * 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 MyProgressModifier6 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg6); + } +} + +@Builder +function myProg6(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier6).value, // 30 + total: (config.contentModifier as MyProgressModifier6).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0240 { + modifier = new MyProgressModifier6(30,80); + @State myModifier: (MyProgressModifier6 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: null, + total: 0, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .value(null) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0250.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..ddc4469725ad6e84c63cd8b401efb39436a48f9f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0250.ets @@ -0,0 +1,77 @@ +/** + * 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 MyProgressModifier20 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg20); + } +} + +@Builder +function myProg20(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier20).value, // 30 + total: (config.contentModifier as MyProgressModifier20).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0250 { + modifier = new MyProgressModifier20(30,80); + @State myModifier: (MyProgressModifier20 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 undefined(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: undefined, + total: 150, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .value(undefined) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0260.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..eadcdd5116d688de3b3c9b8700e486e8ee4d5d5d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0260.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. + */ + + + +class MyProgressModifier8 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg8); + } +} + +@Builder +function myProg8(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier8).value, // 30 + total: (config.contentModifier as MyProgressModifier8).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) +} + +@Entry +@Component +struct ProgressBuilder0260 { + modifier = new MyProgressModifier8(30,80); + @State myModifier: (MyProgressModifier8 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: -10, + total: 50, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + .value(-10) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0270.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..42848101efe5c370ef5f037260610b79da4b570a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0270.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. + */ + + + +class MyProgressModifier40 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg40); + } +} + +@Builder +function myProg40(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier40).value, // 30 + total: (config.contentModifier as MyProgressModifier40).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) +} + +@Entry +@Component +struct ProgressBuilder0270 { + modifier = new MyProgressModifier40(30,80); + @State myModifier: (MyProgressModifier40 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 0, + total: 50, + type: ProgressType.Linear }) + .value(0) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0280.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..471e90dfcebe61ff8f25135a238f30c546221b08 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0280.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. + */ + + + +class MyProgressModifier45 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg45); + } +} + +@Builder +function myProg45(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier45).value, // 30 + total: (config.contentModifier as MyProgressModifier45).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) +} + +@Entry +@Component +struct ProgressBuilder0280 { + modifier = new MyProgressModifier45(30,80); + @State myModifier: (MyProgressModifier45 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 0, + total: 50, + type: ProgressType.Linear }) + .value(1.5) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0290.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c47cff1e177591c571f311bb81b27c93c009841 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0290.ets @@ -0,0 +1,76 @@ +/** + * 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 MyProgressModifier4 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg4); + } +} + +@Builder +function myProg4(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier4).value, // 30 + total: (config.contentModifier as MyProgressModifier4).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0290 { + modifier = new MyProgressModifier4(30,80); + @State myModifier: (MyProgressModifier4 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 100, + type: ProgressType.Capsule }) + .contentModifier(this.modifier) + .value(100) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0300.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..539cc0353308c230bf4ee795a84f97f6a9996fc0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0300.ets @@ -0,0 +1,76 @@ +/** + * 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 MyProgressModifier47 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg47); + } +} + +@Builder +function myProg47(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier47).value, // 30 + total: (config.contentModifier as MyProgressModifier47).tot, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0300 { + modifier = new MyProgressModifier47(30,80); + @State myModifier: (MyProgressModifier47 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 100, + type: ProgressType.Capsule }) + .contentModifier(this.modifier) + .value(50) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0310.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..1aa5f4c8a4206bbb8f1aac320f9e1687f8510836 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0310.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. + */ + + + +class MyProgressModifier17 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg17); + } +} + +@Builder +function myProg17(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier17).value, // 30 + total: (config.contentModifier as MyProgressModifier17).tot, + type: ProgressType.Capsule + }) +} + +@Entry +@Component +struct ProgressBuilder0310 { + modifier = new MyProgressModifier17(30,80); + @State myModifier: (MyProgressModifier17 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Capsule }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0320.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4556dc69768d1f274ee00d4634a67cd70333f12 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0320.ets @@ -0,0 +1,70 @@ +/** + * 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 MyProgressModifier43 implements ContentModifier { + value: number = 30; + total: number = 80; + + constructor(value: number,total: number) { + this.value = value; + this.total = total + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg43); + } +} + +@Builder +function myProg43(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier43).value, // 30 + total: 100, + type: ProgressType.Eclipse + }) + .privacySensitive(true) + .width('100%') + .height('100%') + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0320 { + modifier = new MyProgressModifier43(30,80); + @State myModifier: (MyProgressModifier43 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: -10, + total: 100, + type: ProgressType.Eclipse }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0330.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..40108f86aa4d4ab3b764d66ddf5dfcd7333a5908 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0330.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. + */ + + + +class MyProgressModifier22 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg22); + } +} + +@Builder +function myProg22(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier22).value, // 30 + total: (config.contentModifier as MyProgressModifier22).tot, + type: ProgressType.Linear + }) +} + +@Entry +@Component +struct ProgressBuilder0330 { + modifier = new MyProgressModifier22(30,80); + @State myModifier: (MyProgressModifier22 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0340.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..84a004431d2e04a4d9ca622e17e500d681d86ab0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0340.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. + */ + + + +class MyProgressModifier31 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg31); + } +} + +@Builder +function myProg31(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier31).value, // 30 + total: (config.contentModifier as MyProgressModifier31).tot, + type: ProgressType.Ring + }) +} + +@Entry +@Component +struct ProgressBuilder0340 { + modifier = new MyProgressModifier31(30,80); + @State myModifier: (MyProgressModifier31 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Ring }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0350.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..b8c97b5bdc6f438830e6970c5d203c1eb401ef50 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0350.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. + */ + + + +class MyProgressModifier28 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg28); + } +} + +@Builder +function myProg28(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier28).value, // 30 + total: (config.contentModifier as MyProgressModifier28).tot, + type: ProgressType.ScaleRing + }) +} + +@Entry +@Component +struct ProgressBuilder0350 { + modifier = new MyProgressModifier28(30,80); + @State myModifier: (MyProgressModifier28 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.ScaleRing }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0360.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..36eb470d54402ebe52182f60abbff4ecbd7233f9 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0360.ets @@ -0,0 +1,65 @@ +/** + * 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 MyProgressModifier36 implements ContentModifier { + value: number = 30; + + constructor(value: number) { + this.value = value; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg36); + } +} + +@Builder +function myProg36(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier36).value, // 30 + type: ProgressType.ScaleRing + }) +} + +@Entry +@Component +struct ProgressBuilder0360 { + modifier = new MyProgressModifier36(30); + @State myModifier: (MyProgressModifier36 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 150, + total: 50.3, + type: ProgressType.ScaleRing }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0370.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d2ed65e4ceb34971ab39eab6cd3097193d8e505 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0370.ets @@ -0,0 +1,67 @@ +/** + * 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 MyProgressModifier2 implements ContentModifier { + value: number = 30; + + constructor(value: number) { + this.value = value; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg2); + } +} + +@Builder +function myProg2(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier2).value, // 30 + total: 100, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0370 { + modifier = new MyProgressModifier2(30); + @State myModifier: (MyProgressModifier2 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: null, + total: 100, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0380.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..877ed9cb2ffcbe24008611b2d711ae6740d6bb78 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0380.ets @@ -0,0 +1,67 @@ +/** + * 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 MyProgressModifier49 implements ContentModifier { + value: number = 30; + + constructor(value: number) { + this.value = value; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg49); + } +} + +@Builder +function myProg49(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier49).value, // 30 + total: 100, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0380 { + modifier = new MyProgressModifier49(30); + @State myModifier: (MyProgressModifier49 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: undefined, + total: 100, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0390.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..8fc93dce5e276e480637b0d2bb36ab775042286c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0390.ets @@ -0,0 +1,74 @@ +/** + * 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 MyProgressModifier42 implements ContentModifier { + value: number = 30; + + constructor(value: number) { + this.value = value; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg42); + } +} + +@Builder +function myProg42(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier42).value, // 30 + total: 100, + type: ProgressType.Capsule + }) + .style({ + borderWidth: 5, + font: { size: 13, style: FontStyle.Normal }, + enableScanEffect: false, + showDefaultPercentage: true + }) + .privacySensitive(true) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0390 { + modifier = new MyProgressModifier42(30); + @State myModifier: (MyProgressModifier42 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: -10, + total: 100, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0400.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b86e49971eaa7e12c91a1542c1b6633dc47fb33 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0400.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. + */ + + + +class MyProgressModifier46 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number) { + this.value = value; + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg46); + } +} + +@Builder +function myProg46(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier46).value, // 30 + total: (config.contentModifier as MyProgressModifier46).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0400 { + modifier = new MyProgressModifier46(30); + @State myModifier: (MyProgressModifier46 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 0, + total: 150, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0410.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c5ec008cc69c1f198c6b1fb7efa5a091a277d25 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0410.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier24 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg24); + } +} + +@Builder +function myProg24(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier24).value, // 30 + total: (config.contentModifier as MyProgressModifier24).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0410 { + modifier = new MyProgressModifier24(30,100); + @State myModifier: (MyProgressModifier24 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 1.5, + total: 150, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0420.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..b90c1df3287e9ad8c6fb437c2f912af004e7fd84 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0420.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier34 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg34); + } +} + +@Builder +function myProg34(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier34).value, // 30 + total: (config.contentModifier as MyProgressModifier34).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0420 { + modifier = new MyProgressModifier34(30,100); + @State myModifier: (MyProgressModifier34 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 100, + total: 150, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0430.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..613c638bf14c4f4243dafc89e17ca45d2707b8d0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0430.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier29 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg29); + } +} + +@Builder +function myProg29(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier29).value, // 30 + total: (config.contentModifier as MyProgressModifier29).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0430 { + modifier = new MyProgressModifier29(30,100); + @State myModifier: (MyProgressModifier29 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 50, + total: 150, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0440.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..72e03797707eb9ec8aea29395865246bc683792c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0440.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier19 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg19); + } +} + +@Builder +function myProg19(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier19).value, // 30 + total: (config.contentModifier as MyProgressModifier19).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0440 { + modifier = new MyProgressModifier19(30,80); + @State myModifier: (MyProgressModifier19 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 10, + total: 150, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0450.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..353a516c04d8bec46f1ec5f6ea9072721a808a20 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0450.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier3 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg3); + } +} + +@Builder +function myProg3(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier3).value, // 30 + total: (config.contentModifier as MyProgressModifier3).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0450 { + modifier = new MyProgressModifier3(30,80); + @State myModifier: (MyProgressModifier3 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0460.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..3061ade581986b846ee33c965342b2b30f7276ea --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0460.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier14 implements ContentModifier { + value: number = 30; + tot: number = 80.5 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg14); + } +} + +@Builder +function myProg14(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier14).value, // 30 + total: (config.contentModifier as MyProgressModifier14).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0460 { + modifier = new MyProgressModifier14(30,80.5); + @State myModifier: (MyProgressModifier14 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0470.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..15c7399f05bd1cb6c4c72fe3f4db887d6e51e4f8 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0470.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier26 implements ContentModifier { + value: number = 30; + tot: number = 80.5 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg26); + } +} + +@Builder +function myProg26(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier26).value, // 30 + total: (config.contentModifier as MyProgressModifier26).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0470 { + modifier = new MyProgressModifier26(80,-30); + @State myModifier: (MyProgressModifier26 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0480.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0480.ets new file mode 100644 index 0000000000000000000000000000000000000000..99ba632dd102c27f2ce7f3f5a460bded9a046eb4 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0480.ets @@ -0,0 +1,71 @@ +/** + * 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 MyProgressModifier11 implements ContentModifier { + value: number = 80; + tot: number = 30 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg11); + } +} + +@Builder +function myProg11(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier11).value, // 30 + total: (config.contentModifier as MyProgressModifier11).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) +} + +@Entry +@Component +struct ProgressBuilder0480 { + modifier = new MyProgressModifier11(80,30); + @State myModifier: (MyProgressModifier11 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50.3, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0490.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0490.ets new file mode 100644 index 0000000000000000000000000000000000000000..742a72fcb390fbdb87746949262833e0c50908f4 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0490.ets @@ -0,0 +1,71 @@ +/** + * 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 MyProgressModifier32 implements ContentModifier { + value: number = 80; + tot: number = 30 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg32); + } +} + +@Builder +function myProg32(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier32).value, // 30 + total: (config.contentModifier as MyProgressModifier32).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) +} + +@Entry +@Component +struct ProgressBuilder0490 { + modifier = new MyProgressModifier32(30,80); + @State myModifier: (MyProgressModifier32 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 -10 + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 80, + total: 50, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + .color(Color.Pink) + .backgroundColor(Color.Orange) + .style({strokeWidth:30,strokeRadius:15}) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + + diff --git a/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0500.ets b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..662b59e74b81368ae692c6617959dee85cd34654 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_07/entry/src/ohosTest/ets/testability/pages/ProgressBuilder/ProgressBuilder0500.ets @@ -0,0 +1,69 @@ +/** + * 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 MyProgressModifier5 implements ContentModifier { + value: number = 30; + tot: number = 80 + + constructor(value: number,tot:number) { + this.value = value; + this.tot = tot + } + + applyContent(): WrappedBuilder<[ProgressConfiguration]> { + return wrapBuilder(myProg5); + } +} + +@Builder +function myProg5(config: ProgressConfiguration) { + // 在 Builder 内部使用 contentModifier 提供的 value,覆盖 ProgressOptions 中的 null + Progress({ + value: (config.contentModifier as MyProgressModifier5).value, // 30 + total: (config.contentModifier as MyProgressModifier5).tot, + type: ProgressType.Linear + }) + .width('100%') + .height(10) + .color(Color.Pink); +} + +@Entry +@Component +struct ProgressBuilder0500 { + modifier = new MyProgressModifier5(30,80); + @State myModifier: (MyProgressModifier5 | undefined) = this.modifier; + + build() { + Column() { + // 1) ProgressOptions.value 置为 null(异常值) + // 2) 通过 contentModifier 传入有效 value: 30 + Progress({ + value: 10, + total: 0, + type: ProgressType.Linear }) + .contentModifier(this.modifier) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center); + } +} + + + +